A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

JSONSchema.js 975B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var SCHEMA_LIST = [];
  2. var CUR_AJV = new Ajv();
  3. export default Object.freeze({
  4. add:function(s){
  5. if (!("$id" in s))
  6. throw new Error("Missing '$id' property in schema.");
  7. for (let i=0; i < SCHEMA_LIST.length; i++){
  8. if (SCHEMA_LIST[i]["$id"] === s["$id"])
  9. throw new Error("Schema already exists with $id '" + s["$id"] + "'.");
  10. }
  11. SCHEMA_LIST.push(s);
  12. CUR_AJV.addSchema(s);
  13. },
  14. remove:function(id){
  15. var idx = SCHEMA_LIST.findIndex((item) => {
  16. return item["$id"] === id;
  17. });
  18. if (idx >= 0){
  19. SCHEMA_LIST.splice(idx, 1);
  20. CUR_AJV.removeSchema(id);
  21. }
  22. },
  23. has:function(id){
  24. return SCHEMA_LIST.findIndex((item) => {
  25. return item["$id"] === id;
  26. }) >= 0;
  27. },
  28. getValidator:function(id){
  29. return (CUR_AJV !== null) ? CUR_AJV.getSchema(id) : null;
  30. },
  31. getLastErrors:function(){
  32. if (CUR_AJV === null || CUR_AJV.errors === null){return null;}
  33. return CUR_AJV.errors;
  34. }
  35. });