1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isCompound = exports.isPrimitive = exports.getRootSchema = exports.Parent = void 0;
|
4 | var lodash_1 = require("lodash");
|
5 | exports.Parent = Symbol('Parent');
|
6 | exports.getRootSchema = lodash_1.memoize(function (schema) {
|
7 | var parent = schema[exports.Parent];
|
8 | if (!parent) {
|
9 | return schema;
|
10 | }
|
11 | return exports.getRootSchema(parent);
|
12 | });
|
13 | function isPrimitive(schema) {
|
14 | return !lodash_1.isPlainObject(schema);
|
15 | }
|
16 | exports.isPrimitive = isPrimitive;
|
17 | function isCompound(schema) {
|
18 | return Array.isArray(schema.type) || 'anyOf' in schema || 'oneOf' in schema;
|
19 | }
|
20 | exports.isCompound = isCompound;
|
21 |
|
\ | No newline at end of file |