UNPKG

schema-fun

Version:
14 lines 565 B
import { importDirectory } from './import-dir.js'; import { SchemaRegistry } from './registry.js'; SchemaRegistry.prototype.loadSchemasFromDirectory = async function (path, getSchemaId) { await importDirectory(path, { assertType: 'json', extensions: ['json'], importedModule: async (path, module) => { const schemaId = getSchemaId ? getSchemaId(path, module) : module.$id; this.registerSchema(schemaId, module); }, recurse: true }); }; //# sourceMappingURL=registry-filesystem-extension.js.map