Refs.js 963 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getRefs = void 0;
  4. const Options_js_1 = require("./Options.js");
  5. const getRefs = (options) => {
  6. const _options = (0, Options_js_1.getDefaultOptions)(options);
  7. const currentPath = _options.name !== undefined
  8. ? [..._options.basePath, _options.definitionPath, _options.name]
  9. : _options.basePath;
  10. return {
  11. ..._options,
  12. currentPath: currentPath,
  13. propertyPath: undefined,
  14. seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
  15. def._def,
  16. {
  17. def: def._def,
  18. path: [..._options.basePath, _options.definitionPath, name],
  19. // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
  20. jsonSchema: undefined,
  21. },
  22. ])),
  23. };
  24. };
  25. exports.getRefs = getRefs;