Refs.js 1017 B

1234567891011121314151617181920212223242526
  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. flags: { hasReferencedOpenAiAnyType: false },
  13. currentPath: currentPath,
  14. propertyPath: undefined,
  15. seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
  16. def._def,
  17. {
  18. def: def._def,
  19. path: [..._options.basePath, _options.definitionPath, name],
  20. // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
  21. jsonSchema: undefined,
  22. },
  23. ])),
  24. };
  25. };
  26. exports.getRefs = getRefs;