names.ts 925 B

12345678910111213141516171819202122
  1. import {Name} from "./codegen"
  2. const names = {
  3. // validation function arguments
  4. data: new Name("data"), // data passed to validation function
  5. // args passed from referencing schema
  6. valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
  7. dataPath: new Name("dataPath"),
  8. parentData: new Name("parentData"),
  9. parentDataProperty: new Name("parentDataProperty"),
  10. rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function
  11. dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
  12. // function scoped variables
  13. vErrors: new Name("vErrors"), // null or array of validation errors
  14. errors: new Name("errors"), // counter of validation errors
  15. this: new Name("this"),
  16. // "globals"
  17. self: new Name("self"),
  18. scope: new Name("scope"),
  19. }
  20. export default names