schema-fun
Version:
JSON schema tools
14 lines • 565 B
JavaScript
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