rules.js 918 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getRules = exports.isJSONType = void 0;
  4. const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
  5. const jsonTypes = new Set(_jsonTypes);
  6. function isJSONType(x) {
  7. return typeof x == "string" && jsonTypes.has(x);
  8. }
  9. exports.isJSONType = isJSONType;
  10. function getRules() {
  11. const groups = {
  12. number: { type: "number", rules: [] },
  13. string: { type: "string", rules: [] },
  14. array: { type: "array", rules: [] },
  15. object: { type: "object", rules: [] },
  16. };
  17. return {
  18. types: { ...groups, integer: true, boolean: true, null: true },
  19. rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
  20. post: { rules: [] },
  21. all: {},
  22. keywords: {},
  23. };
  24. }
  25. exports.getRules = getRules;
  26. //# sourceMappingURL=rules.js.map