From ba72d7c7f5cf9ba304a4c9a41719824279178e4d Mon Sep 17 00:00:00 2001 From: Sylvain Pollet-Villard Date: Sun, 13 Jun 2021 22:15:08 +0200 Subject: [PATCH] v4.3.0 --- dist/object-model.cjs | 74 +++--- dist/object-model.js | 74 +++--- dist/object-model.js.map | 2 +- dist/object-model.min.js | 4 +- dist/object-model.min.js.map | 2 +- index.html | 8 +- package-lock.json | 493 +++++++++++++++++++++-------------- package.json | 10 +- 8 files changed, 383 insertions(+), 284 deletions(-) diff --git a/dist/object-model.cjs b/dist/object-model.cjs index d45ad66..0b99038 100644 --- a/dist/object-model.cjs +++ b/dist/object-model.cjs @@ -1,4 +1,4 @@ -// ObjectModel v4.2.3 - http://objectmodel.js.org +// ObjectModel v4.3.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard const ObjectProto = Object.prototype, @@ -49,6 +49,7 @@ const _check = Symbol(), _checked = Symbol(), // used to skip validation at instanciation for perf _original = Symbol(), // used to bypass proxy + CHECK_ONCE = Symbol(), initModel = (def, constructor, parent, init, getTraps, useNew) => { const model = function (val = model.default, mode) { @@ -56,7 +57,7 @@ const if (init) val = init(val, model, this); if (mode === _checked || check(model, val)) - return getTraps ? proxify(val, getTraps(model)) : val + return getTraps && mode !== CHECK_ONCE ? proxify(val, getTraps(model)) : val }; if (parent) extend(model, parent); @@ -98,7 +99,7 @@ const const errors = model.errors.map(err => { if (!err.message) { err.message = "expecting " + (err.path ? err.path + " to be " : "") + formatDefinition(err.expected) - + ", got " + (err.received != null ? bettertypeof(err.received) + " " : "") + format(err.received); + + ", got " + (err.received != null ? bettertypeof(err.received) + " " : "") + format$1(err.received); } return err }); @@ -123,7 +124,7 @@ const }, formatDefinition = (def, stack) => { - const parts = parseDefinition(def).map(d => format(d, stack)); + const parts = parseDefinition(def).map(d => format$1(d, stack)); return parts.length > 1 ? parts.join(" or ") : parts[0] }, @@ -199,14 +200,14 @@ const } if (result !== true) { const onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) => - `assertion "${assertion.description}" returned ${format(assertionResult)} ` - + `for ${path ? path + " =" : "value"} ${format(value)}`; + `assertion "${assertion.description}" returned ${format$1(assertionResult)} ` + + `for ${path ? path + " =" : "value"} ${format$1(value)}`; stackError(errors, assertion, obj, path, onFail.call(model, result, obj, path)); } } }, - format = (obj, stack = []) => { + format$1 = (obj, stack = []) => { if (stack.length > 15 || stack.includes(obj)) return "..." if (obj === null || obj === undefined) return String(obj) if (isString(obj)) return `"${obj}"` @@ -215,14 +216,14 @@ const stack.unshift(obj); if (isFunction(obj)) return obj.name || obj.toString() - if (is(Map, obj) || is(Set, obj)) return format([...obj]) - if (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(", ")}]` + if (is(Map, obj) || is(Set, obj)) return format$1([...obj]) + if (Array.isArray(obj)) return `[${obj.map(item => format$1(item, stack)).join(", ")}]` if (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString() if (isObject(obj)) { const props = Object.keys(obj), indent = "\t".repeat(stack.length); return `{${props.map( - key => `\n${indent + key}: ${format(obj[key], [...stack])}` + key => `\n${indent + key}: ${format$1(obj[key], [...stack])}` ).join(", ")} ${props.length ? `\n${indent.slice(1)}` : ""}}` } @@ -231,7 +232,7 @@ const formatPath = (path, key) => path ? path + "." + key : key, - controlMutation = (model, def, path, o, key, privateAccess, applyMutation) => { + controlMutation$1 = (model, def, path, o, key, privateAccess, applyMutation) => { const newPath = formatPath(path, key), isPrivate = model.conventionForPrivate(key), isConstant = model.conventionForConstant(key), @@ -278,7 +279,7 @@ const } if (suitableModels.length > 1) - console.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(" or ")}`); + console.warn(`Ambiguous model for value ${format$1(obj)}, could be ${suitableModels.join(" or ")}`); return obj }, @@ -333,15 +334,15 @@ const }, set(o, key, val) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key]))) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key]))) }, deleteProperty(o, key) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key)) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key)) }, defineProperty(o, key, args) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args)) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args)) }, has(o, key) { @@ -421,13 +422,14 @@ Object.assign(Model.prototype, { throw e }, - assert(assertion, description = format(assertion)) { + assert(assertion, description = format$1(assertion)) { define(assertion, "description", description); this.assertions = this.assertions.concat(assertion); return this } }); +Model.CHECK_ONCE = CHECK_ONCE; function BasicModel(def) { return initModel(def, BasicModel) @@ -462,7 +464,7 @@ extend(ObjectModel, Model, { }, toString(stack) { - return format(this.definition, stack) + return format$1(this.definition, stack) }, extend(...newParts) { @@ -578,11 +580,11 @@ function ArrayModel(initialDefinition) { }, { set(arr, key, val) { - return controlMutation$1(model, arr, key, val, (a, v) => a[key] = v, true) + return controlMutation(model, arr, key, val, (a, v) => a[key] = v, true) }, deleteProperty(arr, key) { - return controlMutation$1(model, arr, key, undefined, a => delete a[key]) + return controlMutation(model, arr, key, undefined, a => delete a[key]) } } ); @@ -608,7 +610,7 @@ extend(ArrayModel, Model, { } }); -const controlMutation$1 = (model, array, key, value, applyMutation, canBeExtended) => { +const controlMutation = (model, array, key, value, applyMutation, canBeExtended) => { const path = `Array[${key}]`; const isInDef = (+key >= 0 && (canBeExtended || key in array)); if (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true); @@ -685,7 +687,7 @@ extend(MapModel, Model, { path = path || "Map"; for (let [key, value] of map) { checkDefinition(key, this.definition.key, `${path} key`, errors, stack); - checkDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack); + checkDefinition(value, this.definition.value, `${path}[${format$1(key)}]`, errors, stack); } } else stackError(errors, this, map, path); @@ -792,7 +794,7 @@ const getModel = (instance) => { const span = (style, ...children) => ["span", { style }, ...children]; -const format$1 = (x, config = {}) => { +const format = (x, config = {}) => { if (x === null || x === undefined) return span(styles.null, "" + x); @@ -806,7 +808,7 @@ const format$1 = (x, config = {}) => { return span(styles.string, `"${x}"`); if (Array.isArray(x) && config.isModelDefinition) { - return span("", ...x.flatMap(part => [format$1(part, config), " or "]).slice(0, -1)) + return span("", ...x.flatMap(part => [format(part, config), " or "]).slice(0, -1)) } if (isPlainObject(x)) @@ -821,7 +823,7 @@ const format$1 = (x, config = {}) => { const formatObject = (o, model, config) => span("", "{", ["ol", { style: styles.list }, ...Object.keys(o).map(prop => - ["li", { style: styles.listItem }, span(styles.property, prop), ": ", format$1(o[prop], config)]) + ["li", { style: styles.listItem }, span(styles.property, prop), ": ", format(o[prop], config)]) ], "}" ); @@ -833,13 +835,13 @@ const formatModel = model => { formatList = (list, map) => list.flatMap(e => [map(e), ", "]).slice(0, -1); let parts = []; - if (is(BasicModel, model)) parts = [format$1(def, cfg)]; - if (is(ArrayModel, model)) parts = ["Array of ", format$1(def, cfg)]; - if (is(SetModel, model)) parts = ["Set of ", format$1(def, cfg)]; - if (is(MapModel, model)) parts = ["Map of ", format$1(def.key, cfg), " : ", format$1(def.value, cfg)]; + if (is(BasicModel, model)) parts = [format(def, cfg)]; + if (is(ArrayModel, model)) parts = ["Array of ", format(def, cfg)]; + if (is(SetModel, model)) parts = ["Set of ", format(def, cfg)]; + if (is(MapModel, model)) parts = ["Map of ", format(def.key, cfg), " : ", format(def.value, cfg)]; if (is(FunctionModel, model)) { - parts = ["Function(", ...formatList(def.arguments, arg => format$1(arg, cfg)), ")"]; - if ("return" in def) parts.push(" => ", format$1(def.return, cfg)); + parts = ["Function(", ...formatList(def.arguments, arg => format(arg, cfg)), ")"]; + if ("return" in def) parts.push(" => ", format(def.return, cfg)); } if (model.assertions.length > 0) { @@ -855,7 +857,7 @@ const ModelFormatter = { return span(styles.model, "Any") if (is(Any.remaining, x)) - return span(styles.model, "...", format$1(x.definition, { isModelDefinition: true })) + return span(styles.model, "...", format(x.definition, { isModelDefinition: true })) if (is(ObjectModel, x)) return span(styles.model, x.name) @@ -865,7 +867,7 @@ const ModelFormatter = { } if (config.isModelDefinition && isPlainObject(x)) - return format$1(x, config) + return format(x, config) return null; }, @@ -888,8 +890,8 @@ const ModelFormatter = { } return ["li", { style: styles.listItem }, - span(style, prop), ": ", format$1(model.definition[prop], { isModelDefinition: true }), - hasDefault ? span(styles.proto, " = ", format$1(model.default[prop])) : "" + span(style, prop), ": ", format(model.definition[prop], { isModelDefinition: true }), + hasDefault ? span(styles.proto, " = ", format(model.default[prop])) : "" ] })], "}" @@ -900,7 +902,7 @@ const ModelFormatter = { const ModelInstanceFormatter = { header(x, config = {}) { if (config.isInstanceProperty && isPlainObject(x)) { - return format$1(x, config) + return format(x, config) } const model = getModel(x); @@ -937,7 +939,7 @@ const ModelInstanceFormatter = { } return ["li", { style: styles.listItem }, - span(style, prop), ": ", format$1(o[prop], { isInstanceProperty: true }) + span(style, prop), ": ", format(o[prop], { isInstanceProperty: true }) ] }), ["li", { style: styles.listItem }, diff --git a/dist/object-model.js b/dist/object-model.js index b1ce392..05d684e 100644 --- a/dist/object-model.js +++ b/dist/object-model.js @@ -1,4 +1,4 @@ -// ObjectModel v4.2.3 - http://objectmodel.js.org +// ObjectModel v4.3.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard const ObjectProto = Object.prototype, @@ -49,6 +49,7 @@ const _check = Symbol(), _checked = Symbol(), // used to skip validation at instanciation for perf _original = Symbol(), // used to bypass proxy + CHECK_ONCE = Symbol(), initModel = (def, constructor, parent, init, getTraps, useNew) => { const model = function (val = model.default, mode) { @@ -56,7 +57,7 @@ const if (init) val = init(val, model, this); if (mode === _checked || check(model, val)) - return getTraps ? proxify(val, getTraps(model)) : val + return getTraps && mode !== CHECK_ONCE ? proxify(val, getTraps(model)) : val }; if (parent) extend(model, parent); @@ -98,7 +99,7 @@ const const errors = model.errors.map(err => { if (!err.message) { err.message = "expecting " + (err.path ? err.path + " to be " : "") + formatDefinition(err.expected) - + ", got " + (err.received != null ? bettertypeof(err.received) + " " : "") + format(err.received); + + ", got " + (err.received != null ? bettertypeof(err.received) + " " : "") + format$1(err.received); } return err }); @@ -123,7 +124,7 @@ const }, formatDefinition = (def, stack) => { - const parts = parseDefinition(def).map(d => format(d, stack)); + const parts = parseDefinition(def).map(d => format$1(d, stack)); return parts.length > 1 ? parts.join(" or ") : parts[0] }, @@ -199,14 +200,14 @@ const } if (result !== true) { const onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) => - `assertion "${assertion.description}" returned ${format(assertionResult)} ` - + `for ${path ? path + " =" : "value"} ${format(value)}`; + `assertion "${assertion.description}" returned ${format$1(assertionResult)} ` + + `for ${path ? path + " =" : "value"} ${format$1(value)}`; stackError(errors, assertion, obj, path, onFail.call(model, result, obj, path)); } } }, - format = (obj, stack = []) => { + format$1 = (obj, stack = []) => { if (stack.length > 15 || stack.includes(obj)) return "..." if (obj === null || obj === undefined) return String(obj) if (isString(obj)) return `"${obj}"` @@ -215,14 +216,14 @@ const stack.unshift(obj); if (isFunction(obj)) return obj.name || obj.toString() - if (is(Map, obj) || is(Set, obj)) return format([...obj]) - if (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(", ")}]` + if (is(Map, obj) || is(Set, obj)) return format$1([...obj]) + if (Array.isArray(obj)) return `[${obj.map(item => format$1(item, stack)).join(", ")}]` if (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString() if (isObject(obj)) { const props = Object.keys(obj), indent = "\t".repeat(stack.length); return `{${props.map( - key => `\n${indent + key}: ${format(obj[key], [...stack])}` + key => `\n${indent + key}: ${format$1(obj[key], [...stack])}` ).join(", ")} ${props.length ? `\n${indent.slice(1)}` : ""}}` } @@ -231,7 +232,7 @@ const formatPath = (path, key) => path ? path + "." + key : key, - controlMutation = (model, def, path, o, key, privateAccess, applyMutation) => { + controlMutation$1 = (model, def, path, o, key, privateAccess, applyMutation) => { const newPath = formatPath(path, key), isPrivate = model.conventionForPrivate(key), isConstant = model.conventionForConstant(key), @@ -278,7 +279,7 @@ const } if (suitableModels.length > 1) - console.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(" or ")}`); + console.warn(`Ambiguous model for value ${format$1(obj)}, could be ${suitableModels.join(" or ")}`); return obj }, @@ -333,15 +334,15 @@ const }, set(o, key, val) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key]))) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key]))) }, deleteProperty(o, key) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key)) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key)) }, defineProperty(o, key, args) { - return controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args)) + return controlMutation$1(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args)) }, has(o, key) { @@ -421,13 +422,14 @@ Object.assign(Model.prototype, { throw e }, - assert(assertion, description = format(assertion)) { + assert(assertion, description = format$1(assertion)) { define(assertion, "description", description); this.assertions = this.assertions.concat(assertion); return this } }); +Model.CHECK_ONCE = CHECK_ONCE; function BasicModel(def) { return initModel(def, BasicModel) @@ -462,7 +464,7 @@ extend(ObjectModel, Model, { }, toString(stack) { - return format(this.definition, stack) + return format$1(this.definition, stack) }, extend(...newParts) { @@ -578,11 +580,11 @@ function ArrayModel(initialDefinition) { }, { set(arr, key, val) { - return controlMutation$1(model, arr, key, val, (a, v) => a[key] = v, true) + return controlMutation(model, arr, key, val, (a, v) => a[key] = v, true) }, deleteProperty(arr, key) { - return controlMutation$1(model, arr, key, undefined, a => delete a[key]) + return controlMutation(model, arr, key, undefined, a => delete a[key]) } } ); @@ -608,7 +610,7 @@ extend(ArrayModel, Model, { } }); -const controlMutation$1 = (model, array, key, value, applyMutation, canBeExtended) => { +const controlMutation = (model, array, key, value, applyMutation, canBeExtended) => { const path = `Array[${key}]`; const isInDef = (+key >= 0 && (canBeExtended || key in array)); if (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true); @@ -685,7 +687,7 @@ extend(MapModel, Model, { path = path || "Map"; for (let [key, value] of map) { checkDefinition(key, this.definition.key, `${path} key`, errors, stack); - checkDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack); + checkDefinition(value, this.definition.value, `${path}[${format$1(key)}]`, errors, stack); } } else stackError(errors, this, map, path); @@ -792,7 +794,7 @@ const getModel = (instance) => { const span = (style, ...children) => ["span", { style }, ...children]; -const format$1 = (x, config = {}) => { +const format = (x, config = {}) => { if (x === null || x === undefined) return span(styles.null, "" + x); @@ -806,7 +808,7 @@ const format$1 = (x, config = {}) => { return span(styles.string, `"${x}"`); if (Array.isArray(x) && config.isModelDefinition) { - return span("", ...x.flatMap(part => [format$1(part, config), " or "]).slice(0, -1)) + return span("", ...x.flatMap(part => [format(part, config), " or "]).slice(0, -1)) } if (isPlainObject(x)) @@ -821,7 +823,7 @@ const format$1 = (x, config = {}) => { const formatObject = (o, model, config) => span("", "{", ["ol", { style: styles.list }, ...Object.keys(o).map(prop => - ["li", { style: styles.listItem }, span(styles.property, prop), ": ", format$1(o[prop], config)]) + ["li", { style: styles.listItem }, span(styles.property, prop), ": ", format(o[prop], config)]) ], "}" ); @@ -833,13 +835,13 @@ const formatModel = model => { formatList = (list, map) => list.flatMap(e => [map(e), ", "]).slice(0, -1); let parts = []; - if (is(BasicModel, model)) parts = [format$1(def, cfg)]; - if (is(ArrayModel, model)) parts = ["Array of ", format$1(def, cfg)]; - if (is(SetModel, model)) parts = ["Set of ", format$1(def, cfg)]; - if (is(MapModel, model)) parts = ["Map of ", format$1(def.key, cfg), " : ", format$1(def.value, cfg)]; + if (is(BasicModel, model)) parts = [format(def, cfg)]; + if (is(ArrayModel, model)) parts = ["Array of ", format(def, cfg)]; + if (is(SetModel, model)) parts = ["Set of ", format(def, cfg)]; + if (is(MapModel, model)) parts = ["Map of ", format(def.key, cfg), " : ", format(def.value, cfg)]; if (is(FunctionModel, model)) { - parts = ["Function(", ...formatList(def.arguments, arg => format$1(arg, cfg)), ")"]; - if ("return" in def) parts.push(" => ", format$1(def.return, cfg)); + parts = ["Function(", ...formatList(def.arguments, arg => format(arg, cfg)), ")"]; + if ("return" in def) parts.push(" => ", format(def.return, cfg)); } if (model.assertions.length > 0) { @@ -855,7 +857,7 @@ const ModelFormatter = { return span(styles.model, "Any") if (is(Any.remaining, x)) - return span(styles.model, "...", format$1(x.definition, { isModelDefinition: true })) + return span(styles.model, "...", format(x.definition, { isModelDefinition: true })) if (is(ObjectModel, x)) return span(styles.model, x.name) @@ -865,7 +867,7 @@ const ModelFormatter = { } if (config.isModelDefinition && isPlainObject(x)) - return format$1(x, config) + return format(x, config) return null; }, @@ -888,8 +890,8 @@ const ModelFormatter = { } return ["li", { style: styles.listItem }, - span(style, prop), ": ", format$1(model.definition[prop], { isModelDefinition: true }), - hasDefault ? span(styles.proto, " = ", format$1(model.default[prop])) : "" + span(style, prop), ": ", format(model.definition[prop], { isModelDefinition: true }), + hasDefault ? span(styles.proto, " = ", format(model.default[prop])) : "" ] })], "}" @@ -900,7 +902,7 @@ const ModelFormatter = { const ModelInstanceFormatter = { header(x, config = {}) { if (config.isInstanceProperty && isPlainObject(x)) { - return format$1(x, config) + return format(x, config) } const model = getModel(x); @@ -937,7 +939,7 @@ const ModelInstanceFormatter = { } return ["li", { style: styles.listItem }, - span(style, prop), ": ", format$1(o[prop], { isInstanceProperty: true }) + span(style, prop), ": ", format(o[prop], { isInstanceProperty: true }) ] }), ["li", { style: styles.listItem }, diff --git a/dist/object-model.js.map b/dist/object-model.js.map index cade411..f114fe9 100644 --- a/dist/object-model.js.map +++ b/dist/object-model.js.map @@ -1 +1 @@ -{"version":3,"file":"object-model.js","sources":["../src/helpers.js","../src/object-model.js","../src/list-model.js","../src/array-model.js","../src/set-model.js","../src/map-model.js","../src/function-model.js","../src/devtool-formatter.js"],"sourcesContent":["export const\n\tObjectProto = Object.prototype,\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\n\tgetProto = Object.getPrototypeOf,\n\tsetProto = Object.setPrototypeOf,\n\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\n\tis = (Constructor, obj) => obj instanceof Constructor,\n\tisFunction = f => typeof f === \"function\",\n\tisObject = o => o && typeof o === \"object\",\n\tisString = s => typeof s === \"string\",\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\n\n\tproxify = (val, traps) => new Proxy(val, traps),\n\n\tmerge = (target, src = {}) => {\n\t\tfor (let key in src) {\n\t\t\tif (isPlainObject(src[key])) {\n\t\t\t\tconst o = {}\n\t\t\t\tmerge(o, target[key])\n\t\t\t\tmerge(o, src[key])\n\t\t\t\ttarget[key] = o\n\t\t\t} else {\n\t\t\t\ttarget[key] = src[key]\n\t\t\t}\n\t\t}\n\t\treturn target\n\t},\n\n\tdefine = (obj, key, value, enumerable = false) => {\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\n\t},\n\n\textend = (child, parent, props) => {\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\n\t\t\tconstructor: {\n\t\t\t\tvalue: child,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t}\n\t\t}), props)\n\t\tsetProto(child, parent)\n\t}","import {\n\tbettertypeof, define, extend, getProto, has,\n\tis, isFunction, isObject, isPlainObject, isString,\n\tmerge, ObjectProto, proxify, setProto\n} from \"./helpers.js\"\n\nexport const\n\t_check = Symbol(),\n\t_checked = Symbol(), // used to skip validation at instanciation for perf\n\t_original = Symbol(), // used to bypass proxy\n\n\tinitModel = (def, constructor, parent, init, getTraps, useNew) => {\n\t\tconst model = function (val = model.default, mode) {\n\t\t\tif (useNew && !is(model, this)) return new model(val)\n\t\t\tif (init) val = init(val, model, this)\n\n\t\t\tif (mode === _checked || check(model, val))\n\t\t\t\treturn getTraps ? proxify(val, getTraps(model)) : val\n\t\t}\n\n\t\tif (parent) extend(model, parent)\n\t\tsetProto(model, constructor.prototype)\n\t\tmodel.constructor = constructor\n\t\tmodel.definition = def\n\t\tmodel.assertions = [...model.assertions]\n\t\tdefine(model, \"errors\", [])\n\t\tdelete model.name\n\t\treturn model\n\t},\n\n\tinitObjectModel = (obj, model, _this) => {\n\t\tif (is(model, obj)) return obj\n\n\t\tif (!isObject(obj) && !isFunction(obj) && obj !== undefined) {\n\t\t\tstackError(model.errors, Object, obj)\n\t\t}\n\n\t\tmerge(_this, model.default)\n\t\tif (model.parentClass) merge(obj, new model.parentClass(obj))\n\t\tmerge(_this, obj)\n\t\treturn _this\n\t},\n\n\textendModel = (child, parent, newProps) => {\n\t\textend(child, parent, newProps)\n\t\tchild.assertions.push(...parent.assertions)\n\t\treturn child\n\t},\n\n\tstackError = (errors, expected, received, path, message) => {\n\t\terrors.push({ expected, received, path, message })\n\t},\n\n\tunstackErrors = (model, collector = model.errorCollector) => {\n\t\tconst nbErrors = model.errors.length\n\t\tif (nbErrors > 0) {\n\t\t\tconst errors = model.errors.map(err => {\n\t\t\t\tif (!err.message) {\n\t\t\t\t\terr.message = \"expecting \" + (err.path ? err.path + \" to be \" : \"\") + formatDefinition(err.expected)\n\t\t\t\t\t\t+ \", got \" + (err.received != null ? bettertypeof(err.received) + \" \" : \"\") + format(err.received)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\tmodel.errors.length = 0\n\t\t\tcollector.call(model, errors) // throw all errors collected\n\t\t}\n\t\treturn nbErrors\n\t},\n\n\tisModelInstance = i => i && getProto(i) && is(Model, getProto(i).constructor),\n\n\tparseDefinition = (def) => {\n\t\tif (isPlainObject(def)) {\n\t\t\tdef = {}\n\t\t\tfor (let key in def) { def[key] = parseDefinition(def[key]) }\n\t\t}\n\t\telse if (!Array.isArray(def)) return [def]\n\t\telse if (def.length === 1) return [def[0], undefined, null]\n\n\t\treturn def\n\t},\n\n\tformatDefinition = (def, stack) => {\n\t\tconst parts = parseDefinition(def).map(d => format(d, stack))\n\t\treturn parts.length > 1 ? parts.join(\" or \") : parts[0]\n\t},\n\n\tformatAssertions = fns => fns.length ? `(${fns.map(f => f.name || f.description || f)})` : \"\",\n\n\textendDefinition = (def, newParts = []) => {\n\t\tif (newParts.length > 0) {\n\t\t\tdef = [].concat(def, ...[].concat(newParts))// clone to lose ref\n\t\t\t\t.filter((value, index, self) => self.indexOf(value) === index) // remove duplicates\n\t\t}\n\n\t\treturn def\n\t},\n\n\tcheck = (model, obj) => {\n\t\tmodel[_check](obj, null, model.errors, [], true);\n\t\treturn !unstackErrors(model)\n\t},\n\n\tcheckDefinition = (obj, def, path, errors, stack, shouldCast) => {\n\t\tconst indexFound = stack.indexOf(def)\n\t\tif (indexFound !== -1 && stack.indexOf(def, indexFound + 1) !== -1)\n\t\t\treturn obj // if found twice in call stack, cycle detected, skip validation\n\n\t\tif (Array.isArray(def) && def.length === 1 && obj != null) {\n\t\t\tdef = def[0] // shorten validation path for optionals\n\t\t}\n\n\t\tif (is(Model, def)) {\n\t\t\tif (shouldCast) obj = cast(obj, def)\n\t\t\tdef[_check](obj, path, errors, stack.concat(def))\n\t\t}\n\t\telse if (isPlainObject(def)) {\n\t\t\tfor (let key in def) {\n\t\t\t\tconst val = obj ? obj[key] : undefined\n\t\t\t\tcheckDefinition(val, def[key], formatPath(path, key), errors, stack, shouldCast)\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconst pdef = parseDefinition(def)\n\t\t\tif (pdef.some(part => checkDefinitionPart(obj, part, path, stack))) {\n\t\t\t\treturn shouldCast ? cast(obj, def) : obj\n\t\t\t}\n\n\t\t\tstackError(errors, def, obj, path)\n\t\t}\n\n\t\treturn obj\n\t},\n\n\tcheckDefinitionPart = (obj, def, path, stack, shouldCast) => {\n\t\tif (def === Any) return true\n\t\tif (obj == null) return obj === def\n\t\tif (isPlainObject(def) || is(Model, def)) { // object or model as part of union type\n\t\t\tconst errors = []\n\t\t\tcheckDefinition(obj, def, path, errors, stack, shouldCast)\n\t\t\treturn !errors.length\n\t\t}\n\t\tif (is(RegExp, def)) return def.test(obj)\n\t\tif (def === Number || def === Date) return obj.constructor === def && !isNaN(obj)\n\t\treturn obj === def\n\t\t\t|| (isFunction(def) && is(def, obj))\n\t\t\t|| obj.constructor === def\n\t},\n\n\tcheckAssertions = (obj, model, path, errors = model.errors) => {\n\t\tfor (let assertion of model.assertions) {\n\t\t\tlet result\n\t\t\ttry {\n\t\t\t\tresult = assertion.call(model, obj)\n\t\t\t} catch (err) {\n\t\t\t\tresult = err\n\t\t\t}\n\t\t\tif (result !== true) {\n\t\t\t\tconst onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) =>\n\t\t\t\t\t`assertion \"${assertion.description}\" returned ${format(assertionResult)} `\n\t\t\t\t\t+ `for ${path ? path + \" =\" : \"value\"} ${format(value)}`\n\t\t\t\tstackError(errors, assertion, obj, path, onFail.call(model, result, obj, path))\n\t\t\t}\n\t\t}\n\t},\n\n\tformat = (obj, stack = []) => {\n\t\tif (stack.length > 15 || stack.includes(obj)) return \"...\"\n\t\tif (obj === null || obj === undefined) return String(obj)\n\t\tif (isString(obj)) return `\"${obj}\"`\n\t\tif (is(Model, obj)) return obj.toString(stack)\n\n\t\tstack.unshift(obj)\n\n\t\tif (isFunction(obj)) return obj.name || obj.toString()\n\t\tif (is(Map, obj) || is(Set, obj)) return format([...obj])\n\t\tif (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(\", \")}]`\n\t\tif (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString()\n\t\tif (isObject(obj)) {\n\t\t\tconst props = Object.keys(obj),\n\t\t\t\tindent = \"\\t\".repeat(stack.length)\n\t\t\treturn `{${props.map(\n\t\t\t\tkey => `\\n${indent + key}: ${format(obj[key], [...stack])}`\n\t\t\t).join(\", \")} ${props.length ? `\\n${indent.slice(1)}` : \"\"}}`\n\t\t}\n\n\t\treturn String(obj)\n\t},\n\n\tformatPath = (path, key) => path ? path + \".\" + key : key,\n\n\tcontrolMutation = (model, def, path, o, key, privateAccess, applyMutation) => {\n\t\tconst newPath = formatPath(path, key),\n\t\t\tisPrivate = model.conventionForPrivate(key),\n\t\t\tisConstant = model.conventionForConstant(key),\n\t\t\tisOwnProperty = has(o, key),\n\t\t\tinitialPropDescriptor = isOwnProperty && Object.getOwnPropertyDescriptor(o, key)\n\n\t\tif (key in def && ((isPrivate && !privateAccess) || (isConstant && o[key] !== undefined)))\n\t\t\tcannot(`modify ${isPrivate ? \"private\" : \"constant\"} property ${key}`, model)\n\n\t\tapplyMutation()\n\t\tif (has(def, key)) checkDefinition(o[key], def[key], newPath, model.errors, [])\n\t\tcheckAssertions(o, model, newPath)\n\n\t\tconst nbErrors = model.errors.length\n\t\tif (nbErrors) {\n\t\t\tif (isOwnProperty) Object.defineProperty(o, key, initialPropDescriptor)\n\t\t\telse delete o[key] // back to the initial property defined in prototype chain\n\n\t\t\tunstackErrors(model)\n\t\t}\n\n\t\treturn !nbErrors\n\t},\n\n\tcannot = (msg, model) => {\n\t\tmodel.errors.push({ message: \"cannot \" + msg })\n\t},\n\n\tcast = (obj, defNode = []) => {\n\t\tif (!obj || isPlainObject(defNode) || is(BasicModel, defNode) || isModelInstance(obj))\n\t\t\treturn obj // no value or not leaf or already a model instance\n\n\t\tconst def = parseDefinition(defNode),\n\t\t\tsuitableModels = []\n\n\t\tfor (let part of def) {\n\t\t\tif (is(Model, part) && !is(BasicModel, part) && part.test(obj))\n\t\t\t\tsuitableModels.push(part)\n\t\t}\n\n\t\tif (suitableModels.length === 1) {\n\t\t\t// automatically cast to suitable model when explicit (autocasting)\n\t\t\treturn new suitableModels[0](obj, _checked)\n\t\t}\n\n\t\tif (suitableModels.length > 1)\n\t\t\tconsole.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(\" or \")}`)\n\n\t\treturn obj\n\t},\n\n\n\tgetProp = (val, model, def, path, privateAccess) => {\n\t\tif (!isPlainObject(def)) return cast(val, def)\n\t\treturn proxify(val, getTraps(model, def, path, privateAccess))\n\t},\n\n\tgetTraps = (model, def, path, privateAccess) => {\n\t\tconst grantPrivateAccess = f => proxify(f, {\n\t\t\tapply(fn, ctx, args) {\n\t\t\t\tprivateAccess = true\n\t\t\t\tconst result = Reflect.apply(fn, ctx, args)\n\t\t\t\tprivateAccess = false\n\t\t\t\treturn result\n\t\t\t}\n\t\t})\n\n\t\treturn {\n\t\t\tget(o, key) {\n\t\t\t\tif (key === _original) return o\n\n\t\t\t\tif (!isString(key)) return Reflect.get(o, key)\n\n\t\t\t\tconst newPath = formatPath(path, key)\n\t\t\t\tconst inDef = has(def, key)\n\t\t\t\tconst defPart = def[key]\n\n\t\t\t\tif (!privateAccess && inDef && model.conventionForPrivate(key)) {\n\t\t\t\t\tcannot(`access to private property ${newPath}`, model)\n\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tlet value = o[key]\n\n\t\t\t\tif (inDef && value && has(o, key) && !isPlainObject(defPart) && !isModelInstance(value)) {\n\t\t\t\t\tReflect.set(o, key, value = cast(value, defPart)) // cast nested models\n\t\t\t\t}\n\n\t\t\t\tif (isFunction(value) && key !== \"constructor\" && !privateAccess) {\n\t\t\t\t\treturn grantPrivateAccess(value)\n\t\t\t\t}\n\n\t\t\t\tif (isPlainObject(defPart) && !value) {\n\t\t\t\t\to[key] = value = {} // null-safe traversal\n\t\t\t\t}\n\n\t\t\t\treturn getProp(value, model, defPart, newPath, privateAccess)\n\t\t\t},\n\n\t\t\tset(o, key, val) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key])))\n\t\t\t},\n\n\t\t\tdeleteProperty(o, key) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key))\n\t\t\t},\n\n\t\t\tdefineProperty(o, key, args) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args))\n\t\t\t},\n\n\t\t\thas(o, key) {\n\t\t\t\treturn Reflect.has(o, key) && Reflect.has(def, key) && !model.conventionForPrivate(key)\n\t\t\t},\n\n\t\t\townKeys(o) {\n\t\t\t\treturn Reflect.ownKeys(o).filter(key => Reflect.has(def, key) && !model.conventionForPrivate(key))\n\t\t\t},\n\n\t\t\tgetOwnPropertyDescriptor(o, key) {\n\t\t\t\tlet descriptor\n\t\t\t\tif (!model.conventionForPrivate(key)) {\n\t\t\t\t\tdescriptor = Object.getOwnPropertyDescriptor(def, key)\n\t\t\t\t\tif (descriptor !== undefined) descriptor.value = o[key]\n\t\t\t\t}\n\n\t\t\t\treturn descriptor\n\t\t\t}\n\t\t}\n\t}\n\n\nexport function Model(def, params) {\n\treturn isPlainObject(def) ? new ObjectModel(def, params) : new BasicModel(def)\n}\n\nObject.assign(Model.prototype, {\n\tname: \"Model\",\n\tassertions: [],\n\n\tconventionForConstant: key => key.toUpperCase() === key,\n\tconventionForPrivate: key => key[0] === \"_\",\n\n\ttoString(stack) {\n\t\treturn has(this, \"name\") ? this.name : formatDefinition(this.definition, stack) + formatAssertions(this.assertions)\n\t},\n\n\tas(name) {\n\t\tdefine(this, \"name\", name)\n\t\treturn this\n\t},\n\n\tdefaultTo(val) {\n\t\tthis.default = val\n\t\treturn this\n\t},\n\n\t[_check](obj, path, errors, stack) {\n\t\tcheckDefinition(obj, this.definition, path, errors, stack)\n\t\tcheckAssertions(obj, this, path, errors)\n\t},\n\n\ttest(obj, errorCollector) {\n\t\tlet model = this\n\t\twhile (!has(model, \"errorCollector\")) {\n\t\t\tmodel = getProto(model)\n\t\t}\n\n\t\tconst initialErrorCollector = model.errorCollector\n\t\tlet failed\n\n\t\tmodel.errorCollector = errors => {\n\t\t\tfailed = true\n\t\t\tif (errorCollector) errorCollector.call(this, errors)\n\t\t}\n\n\t\tnew this(obj) // may trigger errorCollector\n\n\t\tmodel.errorCollector = initialErrorCollector\n\t\treturn !failed\n\t},\n\n\terrorCollector(errors) {\n\t\tconst e = new TypeError(errors.map(e => e.message).join(\"\\n\"))\n\t\te.stack = e.stack.replace(/\\n.*object-model(.|\\n)*object-model.*/, \"\") // blackbox objectmodel in stacktrace\n\t\tthrow e\n\t},\n\n\tassert(assertion, description = format(assertion)) {\n\t\tdefine(assertion, \"description\", description)\n\t\tthis.assertions = this.assertions.concat(assertion)\n\t\treturn this\n\t}\n})\n\n\nexport function BasicModel(def) {\n\treturn initModel(def, BasicModel)\n}\n\nextend(BasicModel, Model, {\n\textend(...newParts) {\n\t\tconst child = extendModel(new BasicModel(extendDefinition(this.definition, newParts)), this)\n\t\tfor (let part of newParts) {\n\t\t\tif (is(BasicModel, part)) child.assertions.push(...part.assertions)\n\t\t}\n\n\t\treturn child\n\t}\n})\n\nexport function ObjectModel(def) {\n\treturn initModel(def, ObjectModel, Object, initObjectModel, model => getTraps(model, def), true)\n}\n\nextend(ObjectModel, Model, {\n\tdefaultTo(obj) {\n\t\tconst def = this.definition\n\t\tfor (let key in obj) {\n\t\t\tif (has(def, key)) {\n\t\t\t\tobj[key] = checkDefinition(obj[key], def[key], key, this.errors, [], true)\n\t\t\t}\n\t\t}\n\t\tunstackErrors(this)\n\t\tthis.default = obj;\n\t\treturn this\n\t},\n\n\ttoString(stack) {\n\t\treturn format(this.definition, stack)\n\t},\n\n\textend(...newParts) {\n\t\tconst definition = { ...this.definition }\n\t\tconst proto = { ...this.prototype }\n\t\tconst defaults = { ...this.default }\n\t\tconst newAssertions = []\n\n\t\tfor (let part of newParts) {\n\t\t\tif (is(Model, part)) {\n\t\t\t\tmerge(definition, part.definition)\n\t\t\t\tmerge(defaults, part.default)\n\t\t\t\tnewAssertions.push(...part.assertions)\n\t\t\t}\n\t\t\tif (isFunction(part)) merge(proto, part.prototype)\n\t\t\tif (isObject(part)) merge(definition, part)\n\t\t}\n\n\t\tconst submodel = extendModel(new ObjectModel(definition), this, proto).defaultTo(defaults)\n\t\tsubmodel.assertions = [...this.assertions, ...newAssertions]\n\n\t\tif (getProto(this) !== ObjectModel.prototype) { // extended class\n\t\t\tsubmodel.parentClass = this\n\t\t}\n\n\t\treturn submodel\n\t},\n\n\t[_check](obj, path, errors, stack, shouldCast) {\n\t\tif (isObject(obj)) {\n\t\t\tcheckDefinition(obj[_original] || obj, this.definition, path, errors, stack, shouldCast)\n\t\t}\n\t\telse stackError(errors, this, obj, path)\n\n\t\tcheckAssertions(obj, this, path, errors)\n\t}\n})\n\nexport const Any = proxify(BasicModel(), {\n\tapply(target, ctx, [def]) {\n\t\tconst anyOf = Object.create(Any)\n\t\tanyOf.definition = def;\n\t\treturn anyOf\n\t}\n})\nAny.definition = Any\nAny.toString = () => \"Any\"\n\nAny.remaining = function (def) { this.definition = def }\nextend(Any.remaining, Any, {\n\ttoString() { return \"...\" + formatDefinition(this.definition) }\n})\nAny[Symbol.iterator] = function* () { yield new Any.remaining(this.definition) }","\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\nimport { has, isFunction, proxify } from \"./helpers.js\"\n\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\n\n\treturn initModel(def, constructor, base, init, model => Object.assign({\n\t\tgetPrototypeOf: () => model.prototype,\n\t\tget(l, key) {\n\t\t\tif (key === _original) return l\n\n\t\t\tconst val = l[key]\n\t\t\treturn isFunction(val) ? proxify(val, {\n\t\t\t\tapply(fn, ctx, args) {\n\t\t\t\t\tif (has(mutators, key)) {\n\t\t\t\t\t\t// indexes of arguments to check def + cast\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\n\t\t\t\t\t\t\targs[i] = checkDefinition(\n\t\t\t\t\t\t\t\targs[i],\n\t\t\t\t\t\t\t\targDef,\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\n\t\t\t\t\t\t\t\tmodel.errors,\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (model.assertions.length > 0) {\n\t\t\t\t\t\t\tconst testingClone = clone(l)\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fn.apply(l, args)\n\t\t\t\t}\n\t\t\t}) : val\n\t\t}\n\t}, otherTraps))\n}","import {\n\t_original, _check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend } from \"./helpers.js\"\n\nexport default function ArrayModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tArray,\n\t\tArrayModel,\n\t\tinitialDefinition,\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\n\t\ta => [...a],\n\t\t{\n\t\t\t\"copyWithin\": [],\n\t\t\t\"fill\": [0, 0],\n\t\t\t\"pop\": [],\n\t\t\t\"push\": [0],\n\t\t\t\"reverse\": [],\n\t\t\t\"shift\": [],\n\t\t\t\"sort\": [],\n\t\t\t\"splice\": [2],\n\t\t\t\"unshift\": [0]\n\t\t},\n\t\t{\n\t\t\tset(arr, key, val) {\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\n\t\t\t},\n\n\t\t\tdeleteProperty(arr, key) {\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\n\t\t\t}\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(ArrayModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](arr, path, errors, stack) {\n\t\tif (Array.isArray(arr))\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\n\t\telse stackError(errors, this, arr, path)\n\n\t\tcheckAssertions(arr, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})\n\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\n\tconst path = `Array[${key}]`\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\n\n\tconst testArray = [...array]\n\tapplyMutation(testArray)\n\tcheckAssertions(testArray, model, path)\n\tconst isSuccess = !unstackErrors(model)\n\tif (isSuccess) applyMutation(array, value)\n\treturn isSuccess\n}","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function SetModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tSet,\n\t\tSetModel,\n\t\tinitialDefinition,\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\n\t\tset => new Set(set),\n\t\t{\n\t\t\t\"add\": [0, 0],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(SetModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](set, path, errors, stack) {\n\t\tif (is(Set, set)) {\n\t\t\tfor (let item of set.values()) {\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, set, path)\n\t\tcheckAssertions(set, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\n\tconst model = initListModel(\n\t\tMap,\n\t\tMapModel,\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\n\t\tmap => new Map(map),\n\t\t{\n\t\t\t\"set\": [0, 1, getDef],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(MapModel, Model, {\n\ttoString(stack) {\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\n\t},\n\n\t[_check](map, path, errors, stack) {\n\t\tif (is(Map, map)) {\n\t\t\tpath = path || \"Map\"\n\t\t\tfor (let [key, value] of map) {\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, map, path)\n\n\t\tcheckAssertions(map, this, path, errors)\n\t},\n\n\textend(keyParts, valueParts) {\n\t\treturn extendModel(new MapModel(\n\t\t\textendDefinition(this.definition.key, keyParts),\n\t\t\textendDefinition(this.definition.value, valueParts)\n\t\t), this)\n\t}\n})","import {\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\n\tformatDefinition, initModel, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { extend, is, isFunction } from \"./helpers.js\"\n\nexport default function FunctionModel(...argsDef) {\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\n\t\tgetPrototypeOf: () => model.prototype,\n\n\t\tget(fn, key) {\n\t\t\treturn key === _original ? fn : fn[key]\n\t\t},\n\n\t\tapply(fn, ctx, args) {\n\t\t\tconst def = model.definition\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\n\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\n\t\t\t}\n\n\t\t\tcheckAssertions(args, model, \"arguments\")\n\n\t\t\tlet result\n\t\t\tif (!model.errors.length) {\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\n\t\t\t\tif (\"return\" in def)\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\n\t\t\t}\n\t\t\tunstackErrors(model)\n\t\t\treturn result\n\t\t}\n\t}))\n}\n\nextend(FunctionModel, Model, {\n\ttoString(stack = []) {\n\t\tlet out = `Function(${this.definition.arguments.map(\n\t\t\targDef => formatDefinition(argDef, [...stack])\n\t\t).join(\", \")})`\n\n\t\tif (\"return\" in this.definition) {\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\n\t\t}\n\t\treturn out\n\t},\n\n\treturn(def) {\n\t\tthis.definition.return = def\n\t\treturn this\n\t},\n\n\textend(newArgs, newReturns) {\n\t\tconst args = this.definition.arguments,\n\t\t\t mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])),\n\t\t\t mixedReturns = extendDefinition(this.definition.return, newReturns)\n\t\treturn extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this)\n\t},\n\n\t[_check](f, path, errors) {\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\n\t}\n})","import { _original, Model, Any, BasicModel, ObjectModel } from \"./object-model.js\"\nimport ArrayModel from \"./array-model.js\"\nimport SetModel from \"./set-model.js\"\nimport MapModel from \"./map-model.js\"\nimport FunctionModel from \"./function-model.js\"\nimport { getProto, has, is, isFunction, isPlainObject } from \"./helpers.js\"\n\nconst styles = {\n\tlist: \"list-style-type: none; padding: 0; margin: 0;\",\n\tlistItem: \"padding: 0 0 0 1em;\",\n\tmodel: \"color: #3e999f;\",\n\tinstance: \"color: #718c00; font-style: italic\",\n\tfunction: \"color: #4271AE\",\n\tstring: \"color: #C41A16\",\n\tnumber: \"color: #1C00CF\",\n\tboolean: \"color: #AA0D91\",\n\tproperty: \"color: #8959a8\",\n\tprivate: \"color: #C19ED8\",\n\tconstant: \"color: #8959a8; font-weight: bold\",\n\tprivateConstant: \"color: #C19ED8; font-weight: bold\",\n\tnull: \"color: #8e908c\",\n\tundeclared: \"color: #C0C0C0;\",\n\tproto: \"color: #B871BD; font-style: italic\"\n};\n\nconst getModel = (instance) => {\n\tif (instance === undefined || instance === null)\n\t\treturn null\n\n\tconst proto = getProto(instance);\n\tif (!proto || !proto.constructor || !is(Model, proto.constructor))\n\t\treturn null\n\n\treturn proto.constructor\n}\n\nconst span = (style, ...children) => [\"span\", { style }, ...children]\n\nconst format = (x, config = {}) => {\n\tif (x === null || x === undefined)\n\t\treturn span(styles.null, \"\" + x);\n\n\tif (typeof x === \"boolean\")\n\t\treturn span(styles.boolean, x);\n\n\tif (typeof x === \"number\")\n\t\treturn span(styles.number, x);\n\n\tif (typeof x === \"string\")\n\t\treturn span(styles.string, `\"${x}\"`);\n\n\tif (Array.isArray(x) && config.isModelDefinition) {\n\t\treturn span(\"\", ...x.flatMap(part => [format(part, config), \" or \"]).slice(0, -1))\n\t}\n\n\tif (isPlainObject(x))\n\t\treturn formatObject(x, getModel(x), config)\n\n\tif (isFunction(x) && !is(Model, x) && config.isModelDefinition)\n\t\treturn span(styles.function, x.name || x.toString());\n\n\treturn [\"object\", { object: x, config }]\n}\n\nconst formatObject = (o, model, config) => span(\"\",\n\t\"{\",\n\t[\"ol\", { style: styles.list }, ...Object.keys(o).map(prop =>\n\t\t[\"li\", { style: styles.listItem }, span(styles.property, prop), \": \", format(o[prop], config)])\n\t],\n\t\"}\"\n)\n\nconst formatModel = model => {\n\tconst\n\t\tcfg = { isModelDefinition: true },\n\t\tdef = model.definition,\n\t\tformatList = (list, map) => list.flatMap(e => [map(e), \", \"]).slice(0, -1);\n\tlet parts = []\n\n\tif (is(BasicModel, model)) parts = [format(def, cfg)]\n\tif (is(ArrayModel, model)) parts = [\"Array of \", format(def, cfg)]\n\tif (is(SetModel, model)) parts = [\"Set of \", format(def, cfg)]\n\tif (is(MapModel, model)) parts = [\"Map of \", format(def.key, cfg), \" : \", format(def.value, cfg)]\n\tif (is(FunctionModel, model)) {\n\t\tparts = [\"Function(\", ...formatList(def.arguments, arg => format(arg, cfg)), \")\"]\n\t\tif (\"return\" in def) parts.push(\" => \", format(def.return, cfg))\n\t}\n\n\tif (model.assertions.length > 0) {\n\t\tparts.push(\"\\n(assertions: \", ...formatList(model.assertions, f => [\"object\", { object: f }]), \")\")\n\t}\n\n\treturn span(styles.model, ...parts)\n}\n\nconst ModelFormatter = {\n\theader(x, config = {}) {\n\t\tif (x === Any)\n\t\t\treturn span(styles.model, \"Any\")\n\n\t\tif (is(Any.remaining, x))\n\t\t\treturn span(styles.model, \"...\", format(x.definition, { isModelDefinition: true }))\n\n\t\tif (is(ObjectModel, x))\n\t\t\treturn span(styles.model, x.name)\n\n\t\tif (is(Model, x)) {\n\t\t\treturn formatModel(x)\n\t\t}\n\n\t\tif (config.isModelDefinition && isPlainObject(x))\n\t\t\treturn format(x, config)\n\n\t\treturn null;\n\t},\n\thasBody(x) {\n\t\treturn is(ObjectModel, x)\n\t},\n\tbody(model) {\n\t\treturn span(\"\",\n\t\t\t\"{\",\n\t\t\t[\"ol\", { style: styles.list }, ...Object.keys(model.definition).map(prop => {\n\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\n\t\t\t\tconst isConstant = model.conventionForConstant(prop)\n\t\t\t\tconst hasDefault = model.default && has(model.default, prop);\n\t\t\t\tlet style = styles.property;\n\n\t\t\t\tif (isPrivate) {\n\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\n\t\t\t\t} else if (isConstant) {\n\t\t\t\t\tstyle = styles.constant\n\t\t\t\t}\n\n\t\t\t\treturn [\"li\", { style: styles.listItem },\n\t\t\t\t\tspan(style, prop), \": \", format(model.definition[prop], { isModelDefinition: true }),\n\t\t\t\t\thasDefault ? span(styles.proto, \" = \", format(model.default[prop])) : \"\"\n\t\t\t\t]\n\t\t\t})],\n\t\t\t\"}\"\n\t\t)\n\t}\n}\n\nconst ModelInstanceFormatter = {\n\theader(x, config = {}) {\n\t\tif (config.isInstanceProperty && isPlainObject(x)) {\n\t\t\treturn format(x, config)\n\t\t}\n\n\t\tconst model = getModel(x);\n\t\tif (is(Model, model)) {\n\t\t\tconst parts = is(ObjectModel, model) ? [model.name] : [[\"object\", { object: x[_original] }], ` (${model.name})`];\n\t\t\treturn span(styles.instance, ...parts)\n\t\t}\n\n\t\treturn null;\n\t},\n\thasBody(x) {\n\t\treturn x && is(ObjectModel, getModel(x))\n\t},\n\tbody(x) {\n\t\tconst model = getModel(x)\n\t\tconst o = x[_original] || x;\n\t\treturn span(\"\",\n\t\t\t\"{\",\n\t\t\t[\n\t\t\t\t\"ol\",\n\t\t\t\t{ style: styles.list },\n\t\t\t\t...Object.keys(o).map(prop => {\n\t\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\n\t\t\t\t\tconst isConstant = model.conventionForConstant(prop)\n\t\t\t\t\tconst isDeclared = prop in model.definition;\n\t\t\t\t\tlet style = styles.property;\n\n\t\t\t\t\tif (!isDeclared) {\n\t\t\t\t\t\tstyle = styles.undeclared\n\t\t\t\t\t} else if (isPrivate) {\n\t\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\n\t\t\t\t\t} else if (isConstant) {\n\t\t\t\t\t\tstyle = styles.constant\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\"li\", { style: styles.listItem },\n\t\t\t\t\t\tspan(style, prop), \": \", format(o[prop], { isInstanceProperty: true })\n\t\t\t\t\t]\n\t\t\t\t}),\n\t\t\t\t[\"li\", { style: styles.listItem },\n\t\t\t\t\tspan(styles.proto, \"__proto__\", \": \", [\"object\", { object: getProto(x) }])\n\t\t\t\t]\n\t\t\t],\n\t\t\t\"}\"\n\t\t)\n\t}\n}\n\nif (typeof window !== \"undefined\") {\n\twindow.devtoolsFormatters = (window.devtoolsFormatters || [])\n\t\t.concat(ModelFormatter, ModelInstanceFormatter);\n}"],"names":["controlMutation","format"],"mappings":"AAAO;AACP,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS;AAC/B,CAAC,YAAY,GAAG,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,QAAQ,GAAG,MAAM,CAAC,cAAc;AACjC,CAAC,QAAQ,GAAG,MAAM,CAAC,cAAc;AACjC;AACA,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAC5D,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,KAAK,GAAG,YAAY,WAAW;AACtD,CAAC,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,UAAU;AAC1C,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;AAC3C,CAAC,QAAQ,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;AACtC,CAAC,aAAa,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,WAAW;AAChE,CAAC,UAAU,GAAG,CAAC,IAA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5B,MAAM,KAAK,GAAG,MAAM,CAAC,SAAQ;AAC7B,MAAM;AACN;AACA,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;AAC7C,MAAM,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,EAAEA,QAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;AAC5E,MAAM;AACN,KAAK,CAAC;AACN,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;AACrC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/E,KAAK;AACL,IAAI;AACJ,GAAG,GAAG;AACN,GAAG;AACH,EAAE;AACF,EAAC;AACD;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,CAAC,MAAM,CAAC,kBAAkB,GAAG,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE;AAC7D,GAAG,MAAM,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;AAClD;;;;"} \ No newline at end of file +{"version":3,"file":"object-model.js","sources":["../src/helpers.js","../src/object-model.js","../src/list-model.js","../src/array-model.js","../src/set-model.js","../src/map-model.js","../src/function-model.js","../src/devtool-formatter.js"],"sourcesContent":["export const\n\tObjectProto = Object.prototype,\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\n\tgetProto = Object.getPrototypeOf,\n\tsetProto = Object.setPrototypeOf,\n\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\n\tis = (Constructor, obj) => obj instanceof Constructor,\n\tisFunction = f => typeof f === \"function\",\n\tisObject = o => o && typeof o === \"object\",\n\tisString = s => typeof s === \"string\",\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\n\n\tproxify = (val, traps) => new Proxy(val, traps),\n\n\tmerge = (target, src = {}) => {\n\t\tfor (let key in src) {\n\t\t\tif (isPlainObject(src[key])) {\n\t\t\t\tconst o = {}\n\t\t\t\tmerge(o, target[key])\n\t\t\t\tmerge(o, src[key])\n\t\t\t\ttarget[key] = o\n\t\t\t} else {\n\t\t\t\ttarget[key] = src[key]\n\t\t\t}\n\t\t}\n\t\treturn target\n\t},\n\n\tdefine = (obj, key, value, enumerable = false) => {\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\n\t},\n\n\textend = (child, parent, props) => {\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\n\t\t\tconstructor: {\n\t\t\t\tvalue: child,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t}\n\t\t}), props)\n\t\tsetProto(child, parent)\n\t}","import {\r\n\tbettertypeof, define, extend, getProto, has,\r\n\tis, isFunction, isObject, isPlainObject, isString,\r\n\tmerge, ObjectProto, proxify, setProto\r\n} from \"./helpers.js\"\r\n\r\nexport const\r\n\t_check = Symbol(),\r\n\t_checked = Symbol(), // used to skip validation at instanciation for perf\r\n\t_original = Symbol(), // used to bypass proxy\r\n\tCHECK_ONCE = Symbol(),\r\n\r\n\tinitModel = (def, constructor, parent, init, getTraps, useNew) => {\r\n\t\tconst model = function (val = model.default, mode) {\r\n\t\t\tif (useNew && !is(model, this)) return new model(val)\r\n\t\t\tif (init) val = init(val, model, this)\r\n\r\n\t\t\tif (mode === _checked || check(model, val))\r\n\t\t\t\treturn getTraps && mode !== CHECK_ONCE ? proxify(val, getTraps(model)) : val\r\n\t\t}\r\n\r\n\t\tif (parent) extend(model, parent)\r\n\t\tsetProto(model, constructor.prototype)\r\n\t\tmodel.constructor = constructor\r\n\t\tmodel.definition = def\r\n\t\tmodel.assertions = [...model.assertions]\r\n\t\tdefine(model, \"errors\", [])\r\n\t\tdelete model.name\r\n\t\treturn model\r\n\t},\r\n\r\n\tinitObjectModel = (obj, model, _this) => {\r\n\t\tif (is(model, obj)) return obj\r\n\r\n\t\tif (!isObject(obj) && !isFunction(obj) && obj !== undefined) {\r\n\t\t\tstackError(model.errors, Object, obj)\r\n\t\t}\r\n\r\n\t\tmerge(_this, model.default)\r\n\t\tif (model.parentClass) merge(obj, new model.parentClass(obj))\r\n\t\tmerge(_this, obj)\r\n\t\treturn _this\r\n\t},\r\n\r\n\textendModel = (child, parent, newProps) => {\r\n\t\textend(child, parent, newProps)\r\n\t\tchild.assertions.push(...parent.assertions)\r\n\t\treturn child\r\n\t},\r\n\r\n\tstackError = (errors, expected, received, path, message) => {\r\n\t\terrors.push({ expected, received, path, message })\r\n\t},\r\n\r\n\tunstackErrors = (model, collector = model.errorCollector) => {\r\n\t\tconst nbErrors = model.errors.length\r\n\t\tif (nbErrors > 0) {\r\n\t\t\tconst errors = model.errors.map(err => {\r\n\t\t\t\tif (!err.message) {\r\n\t\t\t\t\terr.message = \"expecting \" + (err.path ? err.path + \" to be \" : \"\") + formatDefinition(err.expected)\r\n\t\t\t\t\t\t+ \", got \" + (err.received != null ? bettertypeof(err.received) + \" \" : \"\") + format(err.received)\r\n\t\t\t\t}\r\n\t\t\t\treturn err\r\n\t\t\t})\r\n\r\n\t\t\tmodel.errors.length = 0\r\n\t\t\tcollector.call(model, errors) // throw all errors collected\r\n\t\t}\r\n\t\treturn nbErrors\r\n\t},\r\n\r\n\tisModelInstance = i => i && getProto(i) && is(Model, getProto(i).constructor),\r\n\r\n\tparseDefinition = (def) => {\r\n\t\tif (isPlainObject(def)) {\r\n\t\t\tdef = {}\r\n\t\t\tfor (let key in def) { def[key] = parseDefinition(def[key]) }\r\n\t\t}\r\n\t\telse if (!Array.isArray(def)) return [def]\r\n\t\telse if (def.length === 1) return [def[0], undefined, null]\r\n\r\n\t\treturn def\r\n\t},\r\n\r\n\tformatDefinition = (def, stack) => {\r\n\t\tconst parts = parseDefinition(def).map(d => format(d, stack))\r\n\t\treturn parts.length > 1 ? parts.join(\" or \") : parts[0]\r\n\t},\r\n\r\n\tformatAssertions = fns => fns.length ? `(${fns.map(f => f.name || f.description || f)})` : \"\",\r\n\r\n\textendDefinition = (def, newParts = []) => {\r\n\t\tif (newParts.length > 0) {\r\n\t\t\tdef = [].concat(def, ...[].concat(newParts))// clone to lose ref\r\n\t\t\t\t.filter((value, index, self) => self.indexOf(value) === index) // remove duplicates\r\n\t\t}\r\n\r\n\t\treturn def\r\n\t},\r\n\r\n\tcheck = (model, obj) => {\r\n\t\tmodel[_check](obj, null, model.errors, [], true);\r\n\t\treturn !unstackErrors(model)\r\n\t},\r\n\r\n\tcheckDefinition = (obj, def, path, errors, stack, shouldCast) => {\r\n\t\tconst indexFound = stack.indexOf(def)\r\n\t\tif (indexFound !== -1 && stack.indexOf(def, indexFound + 1) !== -1)\r\n\t\t\treturn obj // if found twice in call stack, cycle detected, skip validation\r\n\r\n\t\tif (Array.isArray(def) && def.length === 1 && obj != null) {\r\n\t\t\tdef = def[0] // shorten validation path for optionals\r\n\t\t}\r\n\r\n\t\tif (is(Model, def)) {\r\n\t\t\tif (shouldCast) obj = cast(obj, def)\r\n\t\t\tdef[_check](obj, path, errors, stack.concat(def))\r\n\t\t}\r\n\t\telse if (isPlainObject(def)) {\r\n\t\t\tfor (let key in def) {\r\n\t\t\t\tconst val = obj ? obj[key] : undefined\r\n\t\t\t\tcheckDefinition(val, def[key], formatPath(path, key), errors, stack, shouldCast)\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst pdef = parseDefinition(def)\r\n\t\t\tif (pdef.some(part => checkDefinitionPart(obj, part, path, stack))) {\r\n\t\t\t\treturn shouldCast ? cast(obj, def) : obj\r\n\t\t\t}\r\n\r\n\t\t\tstackError(errors, def, obj, path)\r\n\t\t}\r\n\r\n\t\treturn obj\r\n\t},\r\n\r\n\tcheckDefinitionPart = (obj, def, path, stack, shouldCast) => {\r\n\t\tif (def === Any) return true\r\n\t\tif (obj == null) return obj === def\r\n\t\tif (isPlainObject(def) || is(Model, def)) { // object or model as part of union type\r\n\t\t\tconst errors = []\r\n\t\t\tcheckDefinition(obj, def, path, errors, stack, shouldCast)\r\n\t\t\treturn !errors.length\r\n\t\t}\r\n\t\tif (is(RegExp, def)) return def.test(obj)\r\n\t\tif (def === Number || def === Date) return obj.constructor === def && !isNaN(obj)\r\n\t\treturn obj === def\r\n\t\t\t|| (isFunction(def) && is(def, obj))\r\n\t\t\t|| obj.constructor === def\r\n\t},\r\n\r\n\tcheckAssertions = (obj, model, path, errors = model.errors) => {\r\n\t\tfor (let assertion of model.assertions) {\r\n\t\t\tlet result\r\n\t\t\ttry {\r\n\t\t\t\tresult = assertion.call(model, obj)\r\n\t\t\t} catch (err) {\r\n\t\t\t\tresult = err\r\n\t\t\t}\r\n\t\t\tif (result !== true) {\r\n\t\t\t\tconst onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) =>\r\n\t\t\t\t\t`assertion \"${assertion.description}\" returned ${format(assertionResult)} `\r\n\t\t\t\t\t+ `for ${path ? path + \" =\" : \"value\"} ${format(value)}`\r\n\t\t\t\tstackError(errors, assertion, obj, path, onFail.call(model, result, obj, path))\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tformat = (obj, stack = []) => {\r\n\t\tif (stack.length > 15 || stack.includes(obj)) return \"...\"\r\n\t\tif (obj === null || obj === undefined) return String(obj)\r\n\t\tif (isString(obj)) return `\"${obj}\"`\r\n\t\tif (is(Model, obj)) return obj.toString(stack)\r\n\r\n\t\tstack.unshift(obj)\r\n\r\n\t\tif (isFunction(obj)) return obj.name || obj.toString()\r\n\t\tif (is(Map, obj) || is(Set, obj)) return format([...obj])\r\n\t\tif (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(\", \")}]`\r\n\t\tif (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString()\r\n\t\tif (isObject(obj)) {\r\n\t\t\tconst props = Object.keys(obj),\r\n\t\t\t\tindent = \"\\t\".repeat(stack.length)\r\n\t\t\treturn `{${props.map(\r\n\t\t\t\tkey => `\\n${indent + key}: ${format(obj[key], [...stack])}`\r\n\t\t\t).join(\", \")} ${props.length ? `\\n${indent.slice(1)}` : \"\"}}`\r\n\t\t}\r\n\r\n\t\treturn String(obj)\r\n\t},\r\n\r\n\tformatPath = (path, key) => path ? path + \".\" + key : key,\r\n\r\n\tcontrolMutation = (model, def, path, o, key, privateAccess, applyMutation) => {\r\n\t\tconst newPath = formatPath(path, key),\r\n\t\t\tisPrivate = model.conventionForPrivate(key),\r\n\t\t\tisConstant = model.conventionForConstant(key),\r\n\t\t\tisOwnProperty = has(o, key),\r\n\t\t\tinitialPropDescriptor = isOwnProperty && Object.getOwnPropertyDescriptor(o, key)\r\n\r\n\t\tif (key in def && ((isPrivate && !privateAccess) || (isConstant && o[key] !== undefined)))\r\n\t\t\tcannot(`modify ${isPrivate ? \"private\" : \"constant\"} property ${key}`, model)\r\n\r\n\t\tapplyMutation()\r\n\t\tif (has(def, key)) checkDefinition(o[key], def[key], newPath, model.errors, [])\r\n\t\tcheckAssertions(o, model, newPath)\r\n\r\n\t\tconst nbErrors = model.errors.length\r\n\t\tif (nbErrors) {\r\n\t\t\tif (isOwnProperty) Object.defineProperty(o, key, initialPropDescriptor)\r\n\t\t\telse delete o[key] // back to the initial property defined in prototype chain\r\n\r\n\t\t\tunstackErrors(model)\r\n\t\t}\r\n\r\n\t\treturn !nbErrors\r\n\t},\r\n\r\n\tcannot = (msg, model) => {\r\n\t\tmodel.errors.push({ message: \"cannot \" + msg })\r\n\t},\r\n\r\n\tcast = (obj, defNode = []) => {\r\n\t\tif (!obj || isPlainObject(defNode) || is(BasicModel, defNode) || isModelInstance(obj))\r\n\t\t\treturn obj // no value or not leaf or already a model instance\r\n\r\n\t\tconst def = parseDefinition(defNode),\r\n\t\t\tsuitableModels = []\r\n\r\n\t\tfor (let part of def) {\r\n\t\t\tif (is(Model, part) && !is(BasicModel, part) && part.test(obj))\r\n\t\t\t\tsuitableModels.push(part)\r\n\t\t}\r\n\r\n\t\tif (suitableModels.length === 1) {\r\n\t\t\t// automatically cast to suitable model when explicit (autocasting)\r\n\t\t\treturn new suitableModels[0](obj, _checked)\r\n\t\t}\r\n\r\n\t\tif (suitableModels.length > 1)\r\n\t\t\tconsole.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(\" or \")}`)\r\n\r\n\t\treturn obj\r\n\t},\r\n\r\n\r\n\tgetProp = (val, model, def, path, privateAccess) => {\r\n\t\tif (!isPlainObject(def)) return cast(val, def)\r\n\t\treturn proxify(val, getTraps(model, def, path, privateAccess))\r\n\t},\r\n\r\n\tgetTraps = (model, def, path, privateAccess) => {\r\n\t\tconst grantPrivateAccess = f => proxify(f, {\r\n\t\t\tapply(fn, ctx, args) {\r\n\t\t\t\tprivateAccess = true\r\n\t\t\t\tconst result = Reflect.apply(fn, ctx, args)\r\n\t\t\t\tprivateAccess = false\r\n\t\t\t\treturn result\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn {\r\n\t\t\tget(o, key) {\r\n\t\t\t\tif (key === _original) return o\r\n\r\n\t\t\t\tif (!isString(key)) return Reflect.get(o, key)\r\n\r\n\t\t\t\tconst newPath = formatPath(path, key)\r\n\t\t\t\tconst inDef = has(def, key)\r\n\t\t\t\tconst defPart = def[key]\r\n\r\n\t\t\t\tif (!privateAccess && inDef && model.conventionForPrivate(key)) {\r\n\t\t\t\t\tcannot(`access to private property ${newPath}`, model)\r\n\t\t\t\t\tunstackErrors(model)\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet value = o[key]\r\n\r\n\t\t\t\tif (inDef && value && has(o, key) && !isPlainObject(defPart) && !isModelInstance(value)) {\r\n\t\t\t\t\tReflect.set(o, key, value = cast(value, defPart)) // cast nested models\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isFunction(value) && key !== \"constructor\" && !privateAccess) {\r\n\t\t\t\t\treturn grantPrivateAccess(value)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isPlainObject(defPart) && !value) {\r\n\t\t\t\t\to[key] = value = {} // null-safe traversal\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn getProp(value, model, defPart, newPath, privateAccess)\r\n\t\t\t},\r\n\r\n\t\t\tset(o, key, val) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key])))\r\n\t\t\t},\r\n\r\n\t\t\tdeleteProperty(o, key) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key))\r\n\t\t\t},\r\n\r\n\t\t\tdefineProperty(o, key, args) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args))\r\n\t\t\t},\r\n\r\n\t\t\thas(o, key) {\r\n\t\t\t\treturn Reflect.has(o, key) && Reflect.has(def, key) && !model.conventionForPrivate(key)\r\n\t\t\t},\r\n\r\n\t\t\townKeys(o) {\r\n\t\t\t\treturn Reflect.ownKeys(o).filter(key => Reflect.has(def, key) && !model.conventionForPrivate(key))\r\n\t\t\t},\r\n\r\n\t\t\tgetOwnPropertyDescriptor(o, key) {\r\n\t\t\t\tlet descriptor\r\n\t\t\t\tif (!model.conventionForPrivate(key)) {\r\n\t\t\t\t\tdescriptor = Object.getOwnPropertyDescriptor(def, key)\r\n\t\t\t\t\tif (descriptor !== undefined) descriptor.value = o[key]\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn descriptor\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\nexport function Model(def, params) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def, params) : new BasicModel(def)\r\n}\r\n\r\nObject.assign(Model.prototype, {\r\n\tname: \"Model\",\r\n\tassertions: [],\r\n\r\n\tconventionForConstant: key => key.toUpperCase() === key,\r\n\tconventionForPrivate: key => key[0] === \"_\",\r\n\r\n\ttoString(stack) {\r\n\t\treturn has(this, \"name\") ? this.name : formatDefinition(this.definition, stack) + formatAssertions(this.assertions)\r\n\t},\r\n\r\n\tas(name) {\r\n\t\tdefine(this, \"name\", name)\r\n\t\treturn this\r\n\t},\r\n\r\n\tdefaultTo(val) {\r\n\t\tthis.default = val\r\n\t\treturn this\r\n\t},\r\n\r\n\t[_check](obj, path, errors, stack) {\r\n\t\tcheckDefinition(obj, this.definition, path, errors, stack)\r\n\t\tcheckAssertions(obj, this, path, errors)\r\n\t},\r\n\r\n\ttest(obj, errorCollector) {\r\n\t\tlet model = this\r\n\t\twhile (!has(model, \"errorCollector\")) {\r\n\t\t\tmodel = getProto(model)\r\n\t\t}\r\n\r\n\t\tconst initialErrorCollector = model.errorCollector\r\n\t\tlet failed\r\n\r\n\t\tmodel.errorCollector = errors => {\r\n\t\t\tfailed = true\r\n\t\t\tif (errorCollector) errorCollector.call(this, errors)\r\n\t\t}\r\n\r\n\t\tnew this(obj) // may trigger errorCollector\r\n\r\n\t\tmodel.errorCollector = initialErrorCollector\r\n\t\treturn !failed\r\n\t},\r\n\r\n\terrorCollector(errors) {\r\n\t\tconst e = new TypeError(errors.map(e => e.message).join(\"\\n\"))\r\n\t\te.stack = e.stack.replace(/\\n.*object-model(.|\\n)*object-model.*/, \"\") // blackbox objectmodel in stacktrace\r\n\t\tthrow e\r\n\t},\r\n\r\n\tassert(assertion, description = format(assertion)) {\r\n\t\tdefine(assertion, \"description\", description)\r\n\t\tthis.assertions = this.assertions.concat(assertion)\r\n\t\treturn this\r\n\t}\r\n})\r\n\r\nModel.CHECK_ONCE = CHECK_ONCE\r\n\r\nexport function BasicModel(def) {\r\n\treturn initModel(def, BasicModel)\r\n}\r\n\r\nextend(BasicModel, Model, {\r\n\textend(...newParts) {\r\n\t\tconst child = extendModel(new BasicModel(extendDefinition(this.definition, newParts)), this)\r\n\t\tfor (let part of newParts) {\r\n\t\t\tif (is(BasicModel, part)) child.assertions.push(...part.assertions)\r\n\t\t}\r\n\r\n\t\treturn child\r\n\t}\r\n})\r\n\r\nexport function ObjectModel(def) {\r\n\treturn initModel(def, ObjectModel, Object, initObjectModel, model => getTraps(model, def), true)\r\n}\r\n\r\nextend(ObjectModel, Model, {\r\n\tdefaultTo(obj) {\r\n\t\tconst def = this.definition\r\n\t\tfor (let key in obj) {\r\n\t\t\tif (has(def, key)) {\r\n\t\t\t\tobj[key] = checkDefinition(obj[key], def[key], key, this.errors, [], true)\r\n\t\t\t}\r\n\t\t}\r\n\t\tunstackErrors(this)\r\n\t\tthis.default = obj;\r\n\t\treturn this\r\n\t},\r\n\r\n\ttoString(stack) {\r\n\t\treturn format(this.definition, stack)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\tconst definition = { ...this.definition }\r\n\t\tconst proto = { ...this.prototype }\r\n\t\tconst defaults = { ...this.default }\r\n\t\tconst newAssertions = []\r\n\r\n\t\tfor (let part of newParts) {\r\n\t\t\tif (is(Model, part)) {\r\n\t\t\t\tmerge(definition, part.definition)\r\n\t\t\t\tmerge(defaults, part.default)\r\n\t\t\t\tnewAssertions.push(...part.assertions)\r\n\t\t\t}\r\n\t\t\tif (isFunction(part)) merge(proto, part.prototype)\r\n\t\t\tif (isObject(part)) merge(definition, part)\r\n\t\t}\r\n\r\n\t\tconst submodel = extendModel(new ObjectModel(definition), this, proto).defaultTo(defaults)\r\n\t\tsubmodel.assertions = [...this.assertions, ...newAssertions]\r\n\r\n\t\tif (getProto(this) !== ObjectModel.prototype) { // extended class\r\n\t\t\tsubmodel.parentClass = this\r\n\t\t}\r\n\r\n\t\treturn submodel\r\n\t},\r\n\r\n\t[_check](obj, path, errors, stack, shouldCast) {\r\n\t\tif (isObject(obj)) {\r\n\t\t\tcheckDefinition(obj[_original] || obj, this.definition, path, errors, stack, shouldCast)\r\n\t\t}\r\n\t\telse stackError(errors, this, obj, path)\r\n\r\n\t\tcheckAssertions(obj, this, path, errors)\r\n\t}\r\n})\r\n\r\nexport const Any = proxify(BasicModel(), {\r\n\tapply(target, ctx, [def]) {\r\n\t\tconst anyOf = Object.create(Any)\r\n\t\tanyOf.definition = def;\r\n\t\treturn anyOf\r\n\t}\r\n})\r\nAny.definition = Any\r\nAny.toString = () => \"Any\"\r\n\r\nAny.remaining = function (def) { this.definition = def }\r\nextend(Any.remaining, Any, {\r\n\ttoString() { return \"...\" + formatDefinition(this.definition) }\r\n})\r\nAny[Symbol.iterator] = function* () { yield new Any.remaining(this.definition) }","\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\nimport { has, isFunction, proxify } from \"./helpers.js\"\n\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\n\n\treturn initModel(def, constructor, base, init, model => Object.assign({\n\t\tgetPrototypeOf: () => model.prototype,\n\t\tget(l, key) {\n\t\t\tif (key === _original) return l\n\n\t\t\tconst val = l[key]\n\t\t\treturn isFunction(val) ? proxify(val, {\n\t\t\t\tapply(fn, ctx, args) {\n\t\t\t\t\tif (has(mutators, key)) {\n\t\t\t\t\t\t// indexes of arguments to check def + cast\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\n\t\t\t\t\t\t\targs[i] = checkDefinition(\n\t\t\t\t\t\t\t\targs[i],\n\t\t\t\t\t\t\t\targDef,\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\n\t\t\t\t\t\t\t\tmodel.errors,\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (model.assertions.length > 0) {\n\t\t\t\t\t\t\tconst testingClone = clone(l)\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fn.apply(l, args)\n\t\t\t\t}\n\t\t\t}) : val\n\t\t}\n\t}, otherTraps))\n}","import {\n\t_original, _check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend } from \"./helpers.js\"\n\nexport default function ArrayModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tArray,\n\t\tArrayModel,\n\t\tinitialDefinition,\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\n\t\ta => [...a],\n\t\t{\n\t\t\t\"copyWithin\": [],\n\t\t\t\"fill\": [0, 0],\n\t\t\t\"pop\": [],\n\t\t\t\"push\": [0],\n\t\t\t\"reverse\": [],\n\t\t\t\"shift\": [],\n\t\t\t\"sort\": [],\n\t\t\t\"splice\": [2],\n\t\t\t\"unshift\": [0]\n\t\t},\n\t\t{\n\t\t\tset(arr, key, val) {\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\n\t\t\t},\n\n\t\t\tdeleteProperty(arr, key) {\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\n\t\t\t}\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(ArrayModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](arr, path, errors, stack) {\n\t\tif (Array.isArray(arr))\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\n\t\telse stackError(errors, this, arr, path)\n\n\t\tcheckAssertions(arr, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})\n\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\n\tconst path = `Array[${key}]`\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\n\n\tconst testArray = [...array]\n\tapplyMutation(testArray)\n\tcheckAssertions(testArray, model, path)\n\tconst isSuccess = !unstackErrors(model)\n\tif (isSuccess) applyMutation(array, value)\n\treturn isSuccess\n}","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function SetModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tSet,\n\t\tSetModel,\n\t\tinitialDefinition,\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\n\t\tset => new Set(set),\n\t\t{\n\t\t\t\"add\": [0, 0],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(SetModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](set, path, errors, stack) {\n\t\tif (is(Set, set)) {\n\t\t\tfor (let item of set.values()) {\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, set, path)\n\t\tcheckAssertions(set, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\n\tconst model = initListModel(\n\t\tMap,\n\t\tMapModel,\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\n\t\tmap => new Map(map),\n\t\t{\n\t\t\t\"set\": [0, 1, getDef],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(MapModel, Model, {\n\ttoString(stack) {\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\n\t},\n\n\t[_check](map, path, errors, stack) {\n\t\tif (is(Map, map)) {\n\t\t\tpath = path || \"Map\"\n\t\t\tfor (let [key, value] of map) {\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, map, path)\n\n\t\tcheckAssertions(map, this, path, errors)\n\t},\n\n\textend(keyParts, valueParts) {\n\t\treturn extendModel(new MapModel(\n\t\t\textendDefinition(this.definition.key, keyParts),\n\t\t\textendDefinition(this.definition.value, valueParts)\n\t\t), this)\n\t}\n})","import {\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\n\tformatDefinition, initModel, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { extend, is, isFunction } from \"./helpers.js\"\n\nexport default function FunctionModel(...argsDef) {\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\n\t\tgetPrototypeOf: () => model.prototype,\n\n\t\tget(fn, key) {\n\t\t\treturn key === _original ? fn : fn[key]\n\t\t},\n\n\t\tapply(fn, ctx, args) {\n\t\t\tconst def = model.definition\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\n\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\n\t\t\t}\n\n\t\t\tcheckAssertions(args, model, \"arguments\")\n\n\t\t\tlet result\n\t\t\tif (!model.errors.length) {\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\n\t\t\t\tif (\"return\" in def)\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\n\t\t\t}\n\t\t\tunstackErrors(model)\n\t\t\treturn result\n\t\t}\n\t}))\n}\n\nextend(FunctionModel, Model, {\n\ttoString(stack = []) {\n\t\tlet out = `Function(${this.definition.arguments.map(\n\t\t\targDef => formatDefinition(argDef, [...stack])\n\t\t).join(\", \")})`\n\n\t\tif (\"return\" in this.definition) {\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\n\t\t}\n\t\treturn out\n\t},\n\n\treturn(def) {\n\t\tthis.definition.return = def\n\t\treturn this\n\t},\n\n\textend(newArgs, newReturns) {\n\t\tconst args = this.definition.arguments,\n\t\t\t mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])),\n\t\t\t mixedReturns = extendDefinition(this.definition.return, newReturns)\n\t\treturn extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this)\n\t},\n\n\t[_check](f, path, errors) {\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\n\t}\n})","import { _original, Model, Any, BasicModel, ObjectModel } from \"./object-model.js\"\nimport ArrayModel from \"./array-model.js\"\nimport SetModel from \"./set-model.js\"\nimport MapModel from \"./map-model.js\"\nimport FunctionModel from \"./function-model.js\"\nimport { getProto, has, is, isFunction, isPlainObject } from \"./helpers.js\"\n\nconst styles = {\n\tlist: \"list-style-type: none; padding: 0; margin: 0;\",\n\tlistItem: \"padding: 0 0 0 1em;\",\n\tmodel: \"color: #3e999f;\",\n\tinstance: \"color: #718c00; font-style: italic\",\n\tfunction: \"color: #4271AE\",\n\tstring: \"color: #C41A16\",\n\tnumber: \"color: #1C00CF\",\n\tboolean: \"color: #AA0D91\",\n\tproperty: \"color: #8959a8\",\n\tprivate: \"color: #C19ED8\",\n\tconstant: \"color: #8959a8; font-weight: bold\",\n\tprivateConstant: \"color: #C19ED8; font-weight: bold\",\n\tnull: \"color: #8e908c\",\n\tundeclared: \"color: #C0C0C0;\",\n\tproto: \"color: #B871BD; font-style: italic\"\n};\n\nconst getModel = (instance) => {\n\tif (instance === undefined || instance === null)\n\t\treturn null\n\n\tconst proto = getProto(instance);\n\tif (!proto || !proto.constructor || !is(Model, proto.constructor))\n\t\treturn null\n\n\treturn proto.constructor\n}\n\nconst span = (style, ...children) => [\"span\", { style }, ...children]\n\nconst format = (x, config = {}) => {\n\tif (x === null || x === undefined)\n\t\treturn span(styles.null, \"\" + x);\n\n\tif (typeof x === \"boolean\")\n\t\treturn span(styles.boolean, x);\n\n\tif (typeof x === \"number\")\n\t\treturn span(styles.number, x);\n\n\tif (typeof x === \"string\")\n\t\treturn span(styles.string, `\"${x}\"`);\n\n\tif (Array.isArray(x) && config.isModelDefinition) {\n\t\treturn span(\"\", ...x.flatMap(part => [format(part, config), \" or \"]).slice(0, -1))\n\t}\n\n\tif (isPlainObject(x))\n\t\treturn formatObject(x, getModel(x), config)\n\n\tif (isFunction(x) && !is(Model, x) && config.isModelDefinition)\n\t\treturn span(styles.function, x.name || x.toString());\n\n\treturn [\"object\", { object: x, config }]\n}\n\nconst formatObject = (o, model, config) => span(\"\",\n\t\"{\",\n\t[\"ol\", { style: styles.list }, ...Object.keys(o).map(prop =>\n\t\t[\"li\", { style: styles.listItem }, span(styles.property, prop), \": \", format(o[prop], config)])\n\t],\n\t\"}\"\n)\n\nconst formatModel = model => {\n\tconst\n\t\tcfg = { isModelDefinition: true },\n\t\tdef = model.definition,\n\t\tformatList = (list, map) => list.flatMap(e => [map(e), \", \"]).slice(0, -1);\n\tlet parts = []\n\n\tif (is(BasicModel, model)) parts = [format(def, cfg)]\n\tif (is(ArrayModel, model)) parts = [\"Array of \", format(def, cfg)]\n\tif (is(SetModel, model)) parts = [\"Set of \", format(def, cfg)]\n\tif (is(MapModel, model)) parts = [\"Map of \", format(def.key, cfg), \" : \", format(def.value, cfg)]\n\tif (is(FunctionModel, model)) {\n\t\tparts = [\"Function(\", ...formatList(def.arguments, arg => format(arg, cfg)), \")\"]\n\t\tif (\"return\" in def) parts.push(\" => \", format(def.return, cfg))\n\t}\n\n\tif (model.assertions.length > 0) {\n\t\tparts.push(\"\\n(assertions: \", ...formatList(model.assertions, f => [\"object\", { object: f }]), \")\")\n\t}\n\n\treturn span(styles.model, ...parts)\n}\n\nconst ModelFormatter = {\n\theader(x, config = {}) {\n\t\tif (x === Any)\n\t\t\treturn span(styles.model, \"Any\")\n\n\t\tif (is(Any.remaining, x))\n\t\t\treturn span(styles.model, \"...\", format(x.definition, { isModelDefinition: true }))\n\n\t\tif (is(ObjectModel, x))\n\t\t\treturn span(styles.model, x.name)\n\n\t\tif (is(Model, x)) {\n\t\t\treturn formatModel(x)\n\t\t}\n\n\t\tif (config.isModelDefinition && isPlainObject(x))\n\t\t\treturn format(x, config)\n\n\t\treturn null;\n\t},\n\thasBody(x) {\n\t\treturn is(ObjectModel, x)\n\t},\n\tbody(model) {\n\t\treturn span(\"\",\n\t\t\t\"{\",\n\t\t\t[\"ol\", { style: styles.list }, ...Object.keys(model.definition).map(prop => {\n\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\n\t\t\t\tconst isConstant = model.conventionForConstant(prop)\n\t\t\t\tconst hasDefault = model.default && has(model.default, prop);\n\t\t\t\tlet style = styles.property;\n\n\t\t\t\tif (isPrivate) {\n\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\n\t\t\t\t} else if (isConstant) {\n\t\t\t\t\tstyle = styles.constant\n\t\t\t\t}\n\n\t\t\t\treturn [\"li\", { style: styles.listItem },\n\t\t\t\t\tspan(style, prop), \": \", format(model.definition[prop], { isModelDefinition: true }),\n\t\t\t\t\thasDefault ? span(styles.proto, \" = \", format(model.default[prop])) : \"\"\n\t\t\t\t]\n\t\t\t})],\n\t\t\t\"}\"\n\t\t)\n\t}\n}\n\nconst ModelInstanceFormatter = {\n\theader(x, config = {}) {\n\t\tif (config.isInstanceProperty && isPlainObject(x)) {\n\t\t\treturn format(x, config)\n\t\t}\n\n\t\tconst model = getModel(x);\n\t\tif (is(Model, model)) {\n\t\t\tconst parts = is(ObjectModel, model) ? [model.name] : [[\"object\", { object: x[_original] }], ` (${model.name})`];\n\t\t\treturn span(styles.instance, ...parts)\n\t\t}\n\n\t\treturn null;\n\t},\n\thasBody(x) {\n\t\treturn x && is(ObjectModel, getModel(x))\n\t},\n\tbody(x) {\n\t\tconst model = getModel(x)\n\t\tconst o = x[_original] || x;\n\t\treturn span(\"\",\n\t\t\t\"{\",\n\t\t\t[\n\t\t\t\t\"ol\",\n\t\t\t\t{ style: styles.list },\n\t\t\t\t...Object.keys(o).map(prop => {\n\t\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\n\t\t\t\t\tconst isConstant = model.conventionForConstant(prop)\n\t\t\t\t\tconst isDeclared = prop in model.definition;\n\t\t\t\t\tlet style = styles.property;\n\n\t\t\t\t\tif (!isDeclared) {\n\t\t\t\t\t\tstyle = styles.undeclared\n\t\t\t\t\t} else if (isPrivate) {\n\t\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\n\t\t\t\t\t} else if (isConstant) {\n\t\t\t\t\t\tstyle = styles.constant\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\"li\", { style: styles.listItem },\n\t\t\t\t\t\tspan(style, prop), \": \", format(o[prop], { isInstanceProperty: true })\n\t\t\t\t\t]\n\t\t\t\t}),\n\t\t\t\t[\"li\", { style: styles.listItem },\n\t\t\t\t\tspan(styles.proto, \"__proto__\", \": \", [\"object\", { object: getProto(x) }])\n\t\t\t\t]\n\t\t\t],\n\t\t\t\"}\"\n\t\t)\n\t}\n}\n\nif (typeof window !== \"undefined\") {\n\twindow.devtoolsFormatters = (window.devtoolsFormatters || [])\n\t\t.concat(ModelFormatter, ModelInstanceFormatter);\n}"],"names":["format","controlMutation"],"mappings":"AAAO;AACP,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS;AAC/B,CAAC,YAAY,GAAG,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,QAAQ,GAAG,MAAM,CAAC,cAAc;AACjC,CAAC,QAAQ,GAAG,MAAM,CAAC,cAAc;AACjC;AACA,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,IAAI,KAAK,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAC5D,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,KAAK,GAAG,YAAY,WAAW;AACtD,CAAC,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,UAAU;AAC1C,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;AAC3C,CAAC,QAAQ,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;AACtC,CAAC,aAAa,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,WAAW;AAChE,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACtD;AACA,CAAC,OAAO,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC;AAChD;AACA,CAAC,KAAK,GAAG,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE,KAAK;AAC/B,EAAE,KAAK,IAAI,GAAG,IAAI,GAAG,EAAE;AACvB,GAA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AAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;AAC5E,MAAM;AACN,KAAK,CAAC;AACN,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;AACrC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC/E,KAAK;AACL,IAAI;AACJ,GAAG,GAAG;AACN,GAAG;AACH,EAAE;AACF,EAAC;AACD;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,CAAC,MAAM,CAAC,kBAAkB,GAAG,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE;AAC7D,GAAG,MAAM,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/dist/object-model.min.js b/dist/object-model.min.js index cd3189f..42187fc 100644 --- a/dist/object-model.min.js +++ b/dist/object-model.min.js @@ -1,4 +1,4 @@ -// ObjectModel v4.2.3 - http://objectmodel.js.org +// ObjectModel v4.3.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard -const t=Object.prototype,e=Object.getPrototypeOf,r=Object.setPrototypeOf,n=(e,r)=>t.hasOwnProperty.call(e,r),i=(t,e)=>e instanceof t,o=t=>"function"==typeof t,s=t=>t&&"object"==typeof t,a=t=>"string"==typeof t,l=r=>s(r)&&e(r)===t,c=t=>t&&o(t[Symbol.iterator]),u=(t,e)=>new Proxy(t,e),f=(t,e={})=>{for(let r in e)if(l(e[r])){const n={};f(n,t[r]),f(n,e[r]),t[r]=n}else t[r]=e[r];return t},p=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{value:r,enumerable:n,writable:!0,configurable:!0})},h=(t,e,n)=>{t.prototype=Object.assign(Object.create(e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n),r(t,e)},d=Symbol(),g=Symbol(),y=Symbol(),m=(t,e,n,o,s,a)=>{const l=function(t=l.default,e){return a&&!i(l,this)?new l(t):(o&&(t=o(t,l,this)),e===g||A(l,t)?s?u(t,s(l)):t:void 0)};return n&&h(l,n),r(l,e.prototype),l.constructor=e,l.definition=t,l.assertions=[...l.assertions],p(l,"errors",[]),delete l.name,l},v=(t,e,r)=>i(e,t)?t:(s(t)||o(t)||void 0===t||$(e.errors,Object,t),f(r,e.default),e.parentClass&&f(t,new e.parentClass(t)),f(r,t),r),b=(t,e,r)=>(h(t,e,r),t.assertions.push(...e.assertions),t),$=(t,e,r,n,i)=>{t.push({expected:e,received:r,path:n,message:i})},w=(e,r=e.errorCollector)=>{const n=e.errors.length;if(n>0){const n=e.errors.map((e=>{var r;return e.message||(e.message="expecting "+(e.path?e.path+" to be ":"")+j(e.expected)+", got "+(null!=e.received?(r=e.received,t.toString.call(r).match(/\s([a-zA-Z]+)/)[1]+" "):"")+F(e.received)),e}));e.errors.length=0,r.call(e,n)}return n},S=t=>t&&e(t)&&i(N,e(t).constructor),O=t=>{if(l(t)){t={};for(let e in t)t[e]=O(t[e])}else{if(!Array.isArray(t))return[t];if(1===t.length)return[t[0],void 0,null]}return t},j=(t,e)=>{const r=O(t).map((t=>F(t,e)));return r.length>1?r.join(" or "):r[0]},P=(t,e=[])=>(e.length>0&&(t=[].concat(t,...[].concat(e)).filter(((t,e,r)=>r.indexOf(t)===e))),t),A=(t,e)=>(t[d](e,null,t.errors,[],!0),!w(t)),x=(t,e,r,n,o,s)=>{const a=o.indexOf(e);if(-1!==a&&-1!==o.indexOf(e,a+1))return t;if(Array.isArray(e)&&1===e.length&&null!=t&&(e=e[0]),i(N,e))s&&(t=T(t,e)),e[d](t,r,n,o.concat(e));else if(l(e))for(let i in e){const a=t?t[i]:void 0;x(a,e[i],k(r,i),n,o,s)}else{if(O(e).some((e=>C(t,e,r,o))))return s?T(t,e):t;$(n,e,t,r)}return t},C=(t,e,r,n,s)=>{if(e===U)return!0;if(null==t)return t===e;if(l(e)||i(N,e)){const i=[];return x(t,e,r,i,n,s),!i.length}return i(RegExp,e)?e.test(t):e===Number||e===Date?t.constructor===e&&!isNaN(t):t===e||o(e)&&i(e,t)||t.constructor===e},R=(t,e,r,n=e.errors)=>{for(let i of e.assertions){let s;try{s=i.call(e,t)}catch(t){s=t}if(!0!==s){const a=o(i.description)?i.description:(t,e)=>`assertion "${i.description}" returned ${F(t)} for ${r?r+" =":"value"} ${F(e)}`;$(n,i,t,r,a.call(e,s,t,r))}}},F=(e,r=[])=>{if(r.length>15||r.includes(e))return"...";if(null==e)return String(e);if(a(e))return`"${e}"`;if(i(N,e))return e.toString(r);if(r.unshift(e),o(e))return e.name||e.toString();if(i(Map,e)||i(Set,e))return F([...e]);if(Array.isArray(e))return`[${e.map((t=>F(t,r))).join(", ")}]`;if(e.toString&&e.toString!==t.toString)return e.toString();if(s(e)){const t=Object.keys(e),n="\t".repeat(r.length);return`{${t.map((t=>`\n${n+t}: ${F(e[t],[...r])}`)).join(", ")} ${t.length?`\n${n.slice(1)}`:""}}`}return String(e)},k=(t,e)=>t?t+"."+e:e,M=(t,e,r,i,o,s,a)=>{const l=k(r,o),c=t.conventionForPrivate(o),u=t.conventionForConstant(o),f=n(i,o),p=f&&Object.getOwnPropertyDescriptor(i,o);o in e&&(c&&!s||u&&void 0!==i[o])&&D(`modify ${c?"private":"constant"} property ${o}`,t),a(),n(e,o)&&x(i[o],e[o],l,t.errors,[]),R(i,t,l);const h=t.errors.length;return h&&(f?Object.defineProperty(i,o,p):delete i[o],w(t)),!h},D=(t,e)=>{e.errors.push({message:"cannot "+t})},T=(t,e=[])=>{if(!t||l(e)||i(K,e)||S(t))return t;const r=O(e),n=[];for(let e of r)i(N,e)&&!i(K,e)&&e.test(t)&&n.push(e);return 1===n.length?new n[0](t,g):(n.length>1&&console.warn(`Ambiguous model for value ${F(t)}, could be ${n.join(" or ")}`),t)},E=(t,e,r,i)=>({get(s,c){if(c===y)return s;if(!a(c))return Reflect.get(s,c);const f=k(r,c),p=n(e,c),h=e[c];if(!i&&p&&t.conventionForPrivate(c))return D(`access to private property ${f}`,t),void w(t);let d=s[c];return p&&d&&n(s,c)&&!l(h)&&!S(d)&&Reflect.set(s,c,d=T(d,h)),o(d)&&"constructor"!==c&&!i?u(d,{apply(t,e,r){i=!0;const n=Reflect.apply(t,e,r);return i=!1,n}}):(l(h)&&!d&&(s[c]=d={}),((t,e,r,n,i)=>l(r)?u(t,E(e,r,n,i)):T(t,r))(d,t,h,f,i))},set:(n,o,s)=>M(t,e,r,n,o,i,(()=>Reflect.set(n,o,T(s,e[o])))),deleteProperty:(n,o)=>M(t,e,r,n,o,i,(()=>Reflect.deleteProperty(n,o))),defineProperty:(n,o,s)=>M(t,e,r,n,o,i,(()=>Reflect.defineProperty(n,o,s))),has:(r,n)=>Reflect.has(r,n)&&Reflect.has(e,n)&&!t.conventionForPrivate(n),ownKeys:r=>Reflect.ownKeys(r).filter((r=>Reflect.has(e,r)&&!t.conventionForPrivate(r))),getOwnPropertyDescriptor(r,n){let i;return t.conventionForPrivate(n)||(i=Object.getOwnPropertyDescriptor(e,n),void 0!==i&&(i.value=r[n])),i}});function N(t,e){return l(t)?new z(t,e):new K(t)}function K(t){return m(t,K)}function z(t){return m(t,z,Object,v,(e=>E(e,t)),!0)}Object.assign(N.prototype,{name:"Model",assertions:[],conventionForConstant:t=>t.toUpperCase()===t,conventionForPrivate:t=>"_"===t[0],toString(t){return n(this,"name")?this.name:j(this.definition,t)+((e=this.assertions).length?`(${e.map((t=>t.name||t.description||t))})`:"");var e},as(t){return p(this,"name",t),this},defaultTo(t){return this.default=t,this},[d](t,e,r,n){x(t,this.definition,e,r,n),R(t,this,e,r)},test(t,r){let i=this;for(;!n(i,"errorCollector");)i=e(i);const o=i.errorCollector;let s;return i.errorCollector=t=>{s=!0,r&&r.call(this,t)},new this(t),i.errorCollector=o,!s},errorCollector(t){const e=new TypeError(t.map((t=>t.message)).join("\n"));throw e.stack=e.stack.replace(/\n.*object-model(.|\n)*object-model.*/,""),e},assert(t,e=F(t)){return p(t,"description",e),this.assertions=this.assertions.concat(t),this}}),h(K,N,{extend(...t){const e=b(new K(P(this.definition,t)),this);for(let r of t)i(K,r)&&e.assertions.push(...r.assertions);return e}}),h(z,N,{defaultTo(t){const e=this.definition;for(let r in t)n(e,r)&&(t[r]=x(t[r],e[r],r,this.errors,[],!0));return w(this),this.default=t,this},toString(t){return F(this.definition,t)},extend(...t){const r={...this.definition},n={...this.prototype},a={...this.default},l=[];for(let e of t)i(N,e)&&(f(r,e.definition),f(a,e.default),l.push(...e.assertions)),o(e)&&f(n,e.prototype),s(e)&&f(r,e);const c=b(new z(r),this,n).defaultTo(a);return c.assertions=[...this.assertions,...l],e(this)!==z.prototype&&(c.parentClass=this),c},[d](t,e,r,n,i){s(t)?x(t[y]||t,this.definition,e,r,n,i):$(r,this,t,e),R(t,this,e,r)}});const U=u(K(),{apply(t,e,[r]){const n=Object.create(U);return n.definition=r,n}});U.definition=U,U.toString=()=>"Any",U.remaining=function(t){this.definition=t},h(U.remaining,U,{toString(){return"..."+j(this.definition)}}),U[Symbol.iterator]=function*(){yield new U.remaining(this.definition)};const W=(t,e,r,i,s,a,l)=>m(r,e,t,i,(e=>Object.assign({getPrototypeOf:()=>e.prototype,get(r,i){if(i===y)return r;const l=r[i];return o(l)?u(l,{apply(o,l,c){if(n(a,i)){const[n,l=c.length-1,u]=a[i];for(let r=n;r<=l;r++){const n=u?u(r):e.definition;c[r]=x(c[r],n,`${t.name}.${i} arguments[${r}]`,e.errors,[],!0)}if(e.assertions.length>0){const t=s(r);o.apply(t,c),R(t,e,`after ${i} mutation`)}w(e)}return o.apply(r,c)}}):l}},l)));function Z(t){const e=W(Array,Z,t,(t=>Array.isArray(t)?t.map((t=>T(t,e.definition))):t),(t=>[...t]),{copyWithin:[],fill:[0,0],pop:[],push:[0],reverse:[],shift:[],sort:[],splice:[2],unshift:[0]},{set:(t,r,n)=>_(e,t,r,n,((t,e)=>t[r]=e),!0),deleteProperty:(t,r)=>_(e,t,r,void 0,(t=>delete t[r]))});return e}h(Z,N,{toString(t){return"Array of "+j(this.definition,t)},[d](t,e,r,n){Array.isArray(t)?(t[y]||t).forEach(((t,i)=>x(t,this.definition,`${e||"Array"}[${i}]`,r,n))):$(r,this,t,e),R(t,this,e,r)},extend(...t){return b(new Z(P(this.definition,t)),this)}});const _=(t,e,r,n,i,o)=>{const s=`Array[${r}]`;+r>=0&&(o||r in e)&&(n=x(n,t.definition,s,t.errors,[],!0));const a=[...e];i(a),R(a,t,s);const l=!w(t);return l&&i(e,n),l};function q(...t){return m({arguments:t},q,Function,null,(t=>({getPrototypeOf:()=>t.prototype,get:(t,e)=>e===y?t:t[e],apply(e,r,n){const o=t.definition,s=o.arguments.find((t=>i(U.remaining,t))),a=s?Math.max(n.length,o.arguments.length-1):o.arguments.length;for(let e=0;e=o.arguments.length-1?s.definition:o.arguments[e];n[e]=x(n[e],r,`arguments[${e}]`,t.errors,[],!0)}let l;return R(n,t,"arguments"),t.errors.length||(l=Reflect.apply(e,r,n),"return"in o&&(l=x(l,o.return,"return value",t.errors,[],!0))),w(t),l}})))}function B(t,e){const r=t=>0===t?n.definition.key:n.definition.value,n=W(Map,B,{key:t,value:e},(t=>c(t)?new Map([...t].map((t=>t.map(((t,e)=>T(t,r(e))))))):t),(t=>new Map(t)),{set:[0,1,r],delete:[],clear:[]});return n}function G(t){const e=W(Set,G,t,(t=>c(t)?new Set([...t].map((t=>T(t,e.definition)))):t),(t=>new Set(t)),{add:[0,0],delete:[],clear:[]});return e}h(q,N,{toString(t=[]){let e=`Function(${this.definition.arguments.map((e=>j(e,[...t]))).join(", ")})`;return"return"in this.definition&&(e+=" => "+j(this.definition.return,t)),e},return(t){return this.definition.return=t,this},extend(t,e){const r=this.definition.arguments,n=t.map(((e,n)=>P(n in r?r[n]:[],t[n]))),i=P(this.definition.return,e);return b(new q(...n).return(i),this)},[d](t,e,r){o(t)||$(r,"Function",t,e)}}),h(B,N,{toString(t){return`Map of ${j(this.definition.key,t)} : ${j(this.definition.value,t)}`},[d](t,e,r,n){if(i(Map,t)){e=e||"Map";for(let[i,o]of t)x(i,this.definition.key,`${e} key`,r,n),x(o,this.definition.value,`${e}[${F(i)}]`,r,n)}else $(r,this,t,e);R(t,this,e,r)},extend(t,e){return b(new B(P(this.definition.key,t),P(this.definition.value,e)),this)}}),h(G,N,{toString(t){return"Set of "+j(this.definition,t)},[d](t,e,r,n){if(i(Set,t))for(let i of t.values())x(i,this.definition,`${e||"Set"} value`,r,n);else $(r,this,t,e);R(t,this,e,r)},extend(...t){return b(new G(P(this.definition,t)),this)}});export{U as Any,Z as ArrayModel,K as BasicModel,q as FunctionModel,B as MapModel,N as Model,z as ObjectModel,G as SetModel}; +const t=Object.prototype,e=Object.getPrototypeOf,r=Object.setPrototypeOf,n=(e,r)=>t.hasOwnProperty.call(e,r),i=(t,e)=>e instanceof t,o=t=>"function"==typeof t,s=t=>t&&"object"==typeof t,a=t=>"string"==typeof t,l=r=>s(r)&&e(r)===t,c=t=>t&&o(t[Symbol.iterator]),u=(t,e)=>new Proxy(t,e),f=(t,e={})=>{for(let r in e)if(l(e[r])){const n={};f(n,t[r]),f(n,e[r]),t[r]=n}else t[r]=e[r];return t},p=(t,e,r,n=!1)=>{Object.defineProperty(t,e,{value:r,enumerable:n,writable:!0,configurable:!0})},h=(t,e,n)=>{t.prototype=Object.assign(Object.create(e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n),r(t,e)},d=Symbol(),g=Symbol(),y=Symbol(),m=Symbol(),v=(t,e,n,o,s,a)=>{const l=function(t=l.default,e){return a&&!i(l,this)?new l(t):(o&&(t=o(t,l,this)),e===g||x(l,t)?s&&e!==m?u(t,s(l)):t:void 0)};return n&&h(l,n),r(l,e.prototype),l.constructor=e,l.definition=t,l.assertions=[...l.assertions],p(l,"errors",[]),delete l.name,l},b=(t,e,r)=>i(e,t)?t:(s(t)||o(t)||void 0===t||S(e.errors,Object,t),f(r,e.default),e.parentClass&&f(t,new e.parentClass(t)),f(r,t),r),$=(t,e,r)=>(h(t,e,r),t.assertions.push(...e.assertions),t),S=(t,e,r,n,i)=>{t.push({expected:e,received:r,path:n,message:i})},w=(e,r=e.errorCollector)=>{const n=e.errors.length;if(n>0){const n=e.errors.map((e=>{var r;return e.message||(e.message="expecting "+(e.path?e.path+" to be ":"")+P(e.expected)+", got "+(null!=e.received?(r=e.received,t.toString.call(r).match(/\s([a-zA-Z]+)/)[1]+" "):"")+k(e.received)),e}));e.errors.length=0,r.call(e,n)}return n},O=t=>t&&e(t)&&i(K,e(t).constructor),j=t=>{if(l(t)){t={};for(let e in t)t[e]=j(t[e])}else{if(!Array.isArray(t))return[t];if(1===t.length)return[t[0],void 0,null]}return t},P=(t,e)=>{const r=j(t).map((t=>k(t,e)));return r.length>1?r.join(" or "):r[0]},A=(t,e=[])=>(e.length>0&&(t=[].concat(t,...[].concat(e)).filter(((t,e,r)=>r.indexOf(t)===e))),t),x=(t,e)=>(t[d](e,null,t.errors,[],!0),!w(t)),C=(t,e,r,n,o,s)=>{const a=o.indexOf(e);if(-1!==a&&-1!==o.indexOf(e,a+1))return t;if(Array.isArray(e)&&1===e.length&&null!=t&&(e=e[0]),i(K,e))s&&(t=N(t,e)),e[d](t,r,n,o.concat(e));else if(l(e))for(let i in e){const a=t?t[i]:void 0;C(a,e[i],M(r,i),n,o,s)}else{if(j(e).some((e=>R(t,e,r,o))))return s?N(t,e):t;S(n,e,t,r)}return t},R=(t,e,r,n,s)=>{if(e===H)return!0;if(null==t)return t===e;if(l(e)||i(K,e)){const i=[];return C(t,e,r,i,n,s),!i.length}return i(RegExp,e)?e.test(t):e===Number||e===Date?t.constructor===e&&!isNaN(t):t===e||o(e)&&i(e,t)||t.constructor===e},F=(t,e,r,n=e.errors)=>{for(let i of e.assertions){let s;try{s=i.call(e,t)}catch(t){s=t}if(!0!==s){const a=o(i.description)?i.description:(t,e)=>`assertion "${i.description}" returned ${k(t)} for ${r?r+" =":"value"} ${k(e)}`;S(n,i,t,r,a.call(e,s,t,r))}}},k=(e,r=[])=>{if(r.length>15||r.includes(e))return"...";if(null==e)return String(e);if(a(e))return`"${e}"`;if(i(K,e))return e.toString(r);if(r.unshift(e),o(e))return e.name||e.toString();if(i(Map,e)||i(Set,e))return k([...e]);if(Array.isArray(e))return`[${e.map((t=>k(t,r))).join(", ")}]`;if(e.toString&&e.toString!==t.toString)return e.toString();if(s(e)){const t=Object.keys(e),n="\t".repeat(r.length);return`{${t.map((t=>`\n${n+t}: ${k(e[t],[...r])}`)).join(", ")} ${t.length?`\n${n.slice(1)}`:""}}`}return String(e)},M=(t,e)=>t?t+"."+e:e,E=(t,e,r,i,o,s,a)=>{const l=M(r,o),c=t.conventionForPrivate(o),u=t.conventionForConstant(o),f=n(i,o),p=f&&Object.getOwnPropertyDescriptor(i,o);o in e&&(c&&!s||u&&void 0!==i[o])&&D(`modify ${c?"private":"constant"} property ${o}`,t),a(),n(e,o)&&C(i[o],e[o],l,t.errors,[]),F(i,t,l);const h=t.errors.length;return h&&(f?Object.defineProperty(i,o,p):delete i[o],w(t)),!h},D=(t,e)=>{e.errors.push({message:"cannot "+t})},N=(t,e=[])=>{if(!t||l(e)||i(_,e)||O(t))return t;const r=j(e),n=[];for(let e of r)i(K,e)&&!i(_,e)&&e.test(t)&&n.push(e);return 1===n.length?new n[0](t,g):(n.length>1&&console.warn(`Ambiguous model for value ${k(t)}, could be ${n.join(" or ")}`),t)},T=(t,e,r,i)=>({get(s,c){if(c===y)return s;if(!a(c))return Reflect.get(s,c);const f=M(r,c),p=n(e,c),h=e[c];if(!i&&p&&t.conventionForPrivate(c))return D(`access to private property ${f}`,t),void w(t);let d=s[c];return p&&d&&n(s,c)&&!l(h)&&!O(d)&&Reflect.set(s,c,d=N(d,h)),o(d)&&"constructor"!==c&&!i?u(d,{apply(t,e,r){i=!0;const n=Reflect.apply(t,e,r);return i=!1,n}}):(l(h)&&!d&&(s[c]=d={}),((t,e,r,n,i)=>l(r)?u(t,T(e,r,n,i)):N(t,r))(d,t,h,f,i))},set:(n,o,s)=>E(t,e,r,n,o,i,(()=>Reflect.set(n,o,N(s,e[o])))),deleteProperty:(n,o)=>E(t,e,r,n,o,i,(()=>Reflect.deleteProperty(n,o))),defineProperty:(n,o,s)=>E(t,e,r,n,o,i,(()=>Reflect.defineProperty(n,o,s))),has:(r,n)=>Reflect.has(r,n)&&Reflect.has(e,n)&&!t.conventionForPrivate(n),ownKeys:r=>Reflect.ownKeys(r).filter((r=>Reflect.has(e,r)&&!t.conventionForPrivate(r))),getOwnPropertyDescriptor(r,n){let i;return t.conventionForPrivate(n)||(i=Object.getOwnPropertyDescriptor(e,n),void 0!==i&&(i.value=r[n])),i}});function K(t,e){return l(t)?new z(t,e):new _(t)}function _(t){return v(t,_)}function z(t){return v(t,z,Object,b,(e=>T(e,t)),!0)}Object.assign(K.prototype,{name:"Model",assertions:[],conventionForConstant:t=>t.toUpperCase()===t,conventionForPrivate:t=>"_"===t[0],toString(t){return n(this,"name")?this.name:P(this.definition,t)+((e=this.assertions).length?`(${e.map((t=>t.name||t.description||t))})`:"");var e},as(t){return p(this,"name",t),this},defaultTo(t){return this.default=t,this},[d](t,e,r,n){C(t,this.definition,e,r,n),F(t,this,e,r)},test(t,r){let i=this;for(;!n(i,"errorCollector");)i=e(i);const o=i.errorCollector;let s;return i.errorCollector=t=>{s=!0,r&&r.call(this,t)},new this(t),i.errorCollector=o,!s},errorCollector(t){const e=new TypeError(t.map((t=>t.message)).join("\n"));throw e.stack=e.stack.replace(/\n.*object-model(.|\n)*object-model.*/,""),e},assert(t,e=k(t)){return p(t,"description",e),this.assertions=this.assertions.concat(t),this}}),K.CHECK_ONCE=m,h(_,K,{extend(...t){const e=$(new _(A(this.definition,t)),this);for(let r of t)i(_,r)&&e.assertions.push(...r.assertions);return e}}),h(z,K,{defaultTo(t){const e=this.definition;for(let r in t)n(e,r)&&(t[r]=C(t[r],e[r],r,this.errors,[],!0));return w(this),this.default=t,this},toString(t){return k(this.definition,t)},extend(...t){const r={...this.definition},n={...this.prototype},a={...this.default},l=[];for(let e of t)i(K,e)&&(f(r,e.definition),f(a,e.default),l.push(...e.assertions)),o(e)&&f(n,e.prototype),s(e)&&f(r,e);const c=$(new z(r),this,n).defaultTo(a);return c.assertions=[...this.assertions,...l],e(this)!==z.prototype&&(c.parentClass=this),c},[d](t,e,r,n,i){s(t)?C(t[y]||t,this.definition,e,r,n,i):S(r,this,t,e),F(t,this,e,r)}});const H=u(_(),{apply(t,e,[r]){const n=Object.create(H);return n.definition=r,n}});H.definition=H,H.toString=()=>"Any",H.remaining=function(t){this.definition=t},h(H.remaining,H,{toString(){return"..."+P(this.definition)}}),H[Symbol.iterator]=function*(){yield new H.remaining(this.definition)};const U=(t,e,r,i,s,a,l)=>v(r,e,t,i,(e=>Object.assign({getPrototypeOf:()=>e.prototype,get(r,i){if(i===y)return r;const l=r[i];return o(l)?u(l,{apply(o,l,c){if(n(a,i)){const[n,l=c.length-1,u]=a[i];for(let r=n;r<=l;r++){const n=u?u(r):e.definition;c[r]=C(c[r],n,`${t.name}.${i} arguments[${r}]`,e.errors,[],!0)}if(e.assertions.length>0){const t=s(r);o.apply(t,c),F(t,e,`after ${i} mutation`)}w(e)}return o.apply(r,c)}}):l}},l)));function W(t){const e=U(Array,W,t,(t=>Array.isArray(t)?t.map((t=>N(t,e.definition))):t),(t=>[...t]),{copyWithin:[],fill:[0,0],pop:[],push:[0],reverse:[],shift:[],sort:[],splice:[2],unshift:[0]},{set:(t,r,n)=>Z(e,t,r,n,((t,e)=>t[r]=e),!0),deleteProperty:(t,r)=>Z(e,t,r,void 0,(t=>delete t[r]))});return e}h(W,K,{toString(t){return"Array of "+P(this.definition,t)},[d](t,e,r,n){Array.isArray(t)?(t[y]||t).forEach(((t,i)=>C(t,this.definition,`${e||"Array"}[${i}]`,r,n))):S(r,this,t,e),F(t,this,e,r)},extend(...t){return $(new W(A(this.definition,t)),this)}});const Z=(t,e,r,n,i,o)=>{const s=`Array[${r}]`;+r>=0&&(o||r in e)&&(n=C(n,t.definition,s,t.errors,[],!0));const a=[...e];i(a),F(a,t,s);const l=!w(t);return l&&i(e,n),l};function q(...t){return v({arguments:t},q,Function,null,(t=>({getPrototypeOf:()=>t.prototype,get:(t,e)=>e===y?t:t[e],apply(e,r,n){const o=t.definition,s=o.arguments.find((t=>i(H.remaining,t))),a=s?Math.max(n.length,o.arguments.length-1):o.arguments.length;for(let e=0;e=o.arguments.length-1?s.definition:o.arguments[e];n[e]=C(n[e],r,`arguments[${e}]`,t.errors,[],!0)}let l;return F(n,t,"arguments"),t.errors.length||(l=Reflect.apply(e,r,n),"return"in o&&(l=C(l,o.return,"return value",t.errors,[],!0))),w(t),l}})))}function B(t,e){const r=t=>0===t?n.definition.key:n.definition.value,n=U(Map,B,{key:t,value:e},(t=>c(t)?new Map([...t].map((t=>t.map(((t,e)=>N(t,r(e))))))):t),(t=>new Map(t)),{set:[0,1,r],delete:[],clear:[]});return n}function G(t){const e=U(Set,G,t,(t=>c(t)?new Set([...t].map((t=>N(t,e.definition)))):t),(t=>new Set(t)),{add:[0,0],delete:[],clear:[]});return e}h(q,K,{toString(t=[]){let e=`Function(${this.definition.arguments.map((e=>P(e,[...t]))).join(", ")})`;return"return"in this.definition&&(e+=" => "+P(this.definition.return,t)),e},return(t){return this.definition.return=t,this},extend(t,e){const r=this.definition.arguments,n=t.map(((e,n)=>A(n in r?r[n]:[],t[n]))),i=A(this.definition.return,e);return $(new q(...n).return(i),this)},[d](t,e,r){o(t)||S(r,"Function",t,e)}}),h(B,K,{toString(t){return`Map of ${P(this.definition.key,t)} : ${P(this.definition.value,t)}`},[d](t,e,r,n){if(i(Map,t)){e=e||"Map";for(let[i,o]of t)C(i,this.definition.key,`${e} key`,r,n),C(o,this.definition.value,`${e}[${k(i)}]`,r,n)}else S(r,this,t,e);F(t,this,e,r)},extend(t,e){return $(new B(A(this.definition.key,t),A(this.definition.value,e)),this)}}),h(G,K,{toString(t){return"Set of "+P(this.definition,t)},[d](t,e,r,n){if(i(Set,t))for(let i of t.values())C(i,this.definition,`${e||"Set"} value`,r,n);else S(r,this,t,e);F(t,this,e,r)},extend(...t){return $(new G(A(this.definition,t)),this)}});export{H as Any,W as ArrayModel,_ as BasicModel,q as FunctionModel,B as MapModel,K as Model,z as ObjectModel,G as SetModel}; //# sourceMappingURL=object-model.min.js.map diff --git a/dist/object-model.min.js.map b/dist/object-model.min.js.map index 656ddbd..5f1e74c 100644 --- a/dist/object-model.min.js.map +++ b/dist/object-model.min.js.map @@ -1 +1 @@ -{"version":3,"file":"object-model.min.js","sources":["../src/helpers.js","../src/object-model.js","../src/list-model.js","../src/array-model.js","../src/function-model.js","../src/map-model.js","../src/set-model.js"],"sourcesContent":["export const\n\tObjectProto = Object.prototype,\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\n\tgetProto = Object.getPrototypeOf,\n\tsetProto = Object.setPrototypeOf,\n\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\n\tis = (Constructor, obj) => obj instanceof Constructor,\n\tisFunction = f => typeof f === \"function\",\n\tisObject = o => o && typeof o === \"object\",\n\tisString = s => typeof s === \"string\",\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\n\n\tproxify = (val, traps) => new Proxy(val, traps),\n\n\tmerge = (target, src = {}) => {\n\t\tfor (let key in src) {\n\t\t\tif (isPlainObject(src[key])) {\n\t\t\t\tconst o = {}\n\t\t\t\tmerge(o, target[key])\n\t\t\t\tmerge(o, src[key])\n\t\t\t\ttarget[key] = o\n\t\t\t} else {\n\t\t\t\ttarget[key] = src[key]\n\t\t\t}\n\t\t}\n\t\treturn target\n\t},\n\n\tdefine = (obj, key, value, enumerable = false) => {\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\n\t},\n\n\textend = (child, parent, props) => {\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\n\t\t\tconstructor: {\n\t\t\t\tvalue: child,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t}\n\t\t}), props)\n\t\tsetProto(child, parent)\n\t}","import {\n\tbettertypeof, define, extend, getProto, has,\n\tis, isFunction, isObject, isPlainObject, isString,\n\tmerge, ObjectProto, proxify, setProto\n} from \"./helpers.js\"\n\nexport const\n\t_check = Symbol(),\n\t_checked = Symbol(), // used to skip validation at instanciation for perf\n\t_original = Symbol(), // used to bypass proxy\n\n\tinitModel = (def, constructor, parent, init, getTraps, useNew) => {\n\t\tconst model = function (val = model.default, mode) {\n\t\t\tif (useNew && !is(model, this)) return new model(val)\n\t\t\tif (init) val = init(val, model, this)\n\n\t\t\tif (mode === _checked || check(model, val))\n\t\t\t\treturn getTraps ? proxify(val, getTraps(model)) : val\n\t\t}\n\n\t\tif (parent) extend(model, parent)\n\t\tsetProto(model, constructor.prototype)\n\t\tmodel.constructor = constructor\n\t\tmodel.definition = def\n\t\tmodel.assertions = [...model.assertions]\n\t\tdefine(model, \"errors\", [])\n\t\tdelete model.name\n\t\treturn model\n\t},\n\n\tinitObjectModel = (obj, model, _this) => {\n\t\tif (is(model, obj)) return obj\n\n\t\tif (!isObject(obj) && !isFunction(obj) && obj !== undefined) {\n\t\t\tstackError(model.errors, Object, obj)\n\t\t}\n\n\t\tmerge(_this, model.default)\n\t\tif (model.parentClass) merge(obj, new model.parentClass(obj))\n\t\tmerge(_this, obj)\n\t\treturn _this\n\t},\n\n\textendModel = (child, parent, newProps) => {\n\t\textend(child, parent, newProps)\n\t\tchild.assertions.push(...parent.assertions)\n\t\treturn child\n\t},\n\n\tstackError = (errors, expected, received, path, message) => {\n\t\terrors.push({ expected, received, path, message })\n\t},\n\n\tunstackErrors = (model, collector = model.errorCollector) => {\n\t\tconst nbErrors = model.errors.length\n\t\tif (nbErrors > 0) {\n\t\t\tconst errors = model.errors.map(err => {\n\t\t\t\tif (!err.message) {\n\t\t\t\t\terr.message = \"expecting \" + (err.path ? err.path + \" to be \" : \"\") + formatDefinition(err.expected)\n\t\t\t\t\t\t+ \", got \" + (err.received != null ? bettertypeof(err.received) + \" \" : \"\") + format(err.received)\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t})\n\n\t\t\tmodel.errors.length = 0\n\t\t\tcollector.call(model, errors) // throw all errors collected\n\t\t}\n\t\treturn nbErrors\n\t},\n\n\tisModelInstance = i => i && getProto(i) && is(Model, getProto(i).constructor),\n\n\tparseDefinition = (def) => {\n\t\tif (isPlainObject(def)) {\n\t\t\tdef = {}\n\t\t\tfor (let key in def) { def[key] = parseDefinition(def[key]) }\n\t\t}\n\t\telse if (!Array.isArray(def)) return [def]\n\t\telse if (def.length === 1) return [def[0], undefined, null]\n\n\t\treturn def\n\t},\n\n\tformatDefinition = (def, stack) => {\n\t\tconst parts = parseDefinition(def).map(d => format(d, stack))\n\t\treturn parts.length > 1 ? parts.join(\" or \") : parts[0]\n\t},\n\n\tformatAssertions = fns => fns.length ? `(${fns.map(f => f.name || f.description || f)})` : \"\",\n\n\textendDefinition = (def, newParts = []) => {\n\t\tif (newParts.length > 0) {\n\t\t\tdef = [].concat(def, ...[].concat(newParts))// clone to lose ref\n\t\t\t\t.filter((value, index, self) => self.indexOf(value) === index) // remove duplicates\n\t\t}\n\n\t\treturn def\n\t},\n\n\tcheck = (model, obj) => {\n\t\tmodel[_check](obj, null, model.errors, [], true);\n\t\treturn !unstackErrors(model)\n\t},\n\n\tcheckDefinition = (obj, def, path, errors, stack, shouldCast) => {\n\t\tconst indexFound = stack.indexOf(def)\n\t\tif (indexFound !== -1 && stack.indexOf(def, indexFound + 1) !== -1)\n\t\t\treturn obj // if found twice in call stack, cycle detected, skip validation\n\n\t\tif (Array.isArray(def) && def.length === 1 && obj != null) {\n\t\t\tdef = def[0] // shorten validation path for optionals\n\t\t}\n\n\t\tif (is(Model, def)) {\n\t\t\tif (shouldCast) obj = cast(obj, def)\n\t\t\tdef[_check](obj, path, errors, stack.concat(def))\n\t\t}\n\t\telse if (isPlainObject(def)) {\n\t\t\tfor (let key in def) {\n\t\t\t\tconst val = obj ? obj[key] : undefined\n\t\t\t\tcheckDefinition(val, def[key], formatPath(path, key), errors, stack, shouldCast)\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tconst pdef = parseDefinition(def)\n\t\t\tif (pdef.some(part => checkDefinitionPart(obj, part, path, stack))) {\n\t\t\t\treturn shouldCast ? cast(obj, def) : obj\n\t\t\t}\n\n\t\t\tstackError(errors, def, obj, path)\n\t\t}\n\n\t\treturn obj\n\t},\n\n\tcheckDefinitionPart = (obj, def, path, stack, shouldCast) => {\n\t\tif (def === Any) return true\n\t\tif (obj == null) return obj === def\n\t\tif (isPlainObject(def) || is(Model, def)) { // object or model as part of union type\n\t\t\tconst errors = []\n\t\t\tcheckDefinition(obj, def, path, errors, stack, shouldCast)\n\t\t\treturn !errors.length\n\t\t}\n\t\tif (is(RegExp, def)) return def.test(obj)\n\t\tif (def === Number || def === Date) return obj.constructor === def && !isNaN(obj)\n\t\treturn obj === def\n\t\t\t|| (isFunction(def) && is(def, obj))\n\t\t\t|| obj.constructor === def\n\t},\n\n\tcheckAssertions = (obj, model, path, errors = model.errors) => {\n\t\tfor (let assertion of model.assertions) {\n\t\t\tlet result\n\t\t\ttry {\n\t\t\t\tresult = assertion.call(model, obj)\n\t\t\t} catch (err) {\n\t\t\t\tresult = err\n\t\t\t}\n\t\t\tif (result !== true) {\n\t\t\t\tconst onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) =>\n\t\t\t\t\t`assertion \"${assertion.description}\" returned ${format(assertionResult)} `\n\t\t\t\t\t+ `for ${path ? path + \" =\" : \"value\"} ${format(value)}`\n\t\t\t\tstackError(errors, assertion, obj, path, onFail.call(model, result, obj, path))\n\t\t\t}\n\t\t}\n\t},\n\n\tformat = (obj, stack = []) => {\n\t\tif (stack.length > 15 || stack.includes(obj)) return \"...\"\n\t\tif (obj === null || obj === undefined) return String(obj)\n\t\tif (isString(obj)) return `\"${obj}\"`\n\t\tif (is(Model, obj)) return obj.toString(stack)\n\n\t\tstack.unshift(obj)\n\n\t\tif (isFunction(obj)) return obj.name || obj.toString()\n\t\tif (is(Map, obj) || is(Set, obj)) return format([...obj])\n\t\tif (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(\", \")}]`\n\t\tif (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString()\n\t\tif (isObject(obj)) {\n\t\t\tconst props = Object.keys(obj),\n\t\t\t\tindent = \"\\t\".repeat(stack.length)\n\t\t\treturn `{${props.map(\n\t\t\t\tkey => `\\n${indent + key}: ${format(obj[key], [...stack])}`\n\t\t\t).join(\", \")} ${props.length ? `\\n${indent.slice(1)}` : \"\"}}`\n\t\t}\n\n\t\treturn String(obj)\n\t},\n\n\tformatPath = (path, key) => path ? path + \".\" + key : key,\n\n\tcontrolMutation = (model, def, path, o, key, privateAccess, applyMutation) => {\n\t\tconst newPath = formatPath(path, key),\n\t\t\tisPrivate = model.conventionForPrivate(key),\n\t\t\tisConstant = model.conventionForConstant(key),\n\t\t\tisOwnProperty = has(o, key),\n\t\t\tinitialPropDescriptor = isOwnProperty && Object.getOwnPropertyDescriptor(o, key)\n\n\t\tif (key in def && ((isPrivate && !privateAccess) || (isConstant && o[key] !== undefined)))\n\t\t\tcannot(`modify ${isPrivate ? \"private\" : \"constant\"} property ${key}`, model)\n\n\t\tapplyMutation()\n\t\tif (has(def, key)) checkDefinition(o[key], def[key], newPath, model.errors, [])\n\t\tcheckAssertions(o, model, newPath)\n\n\t\tconst nbErrors = model.errors.length\n\t\tif (nbErrors) {\n\t\t\tif (isOwnProperty) Object.defineProperty(o, key, initialPropDescriptor)\n\t\t\telse delete o[key] // back to the initial property defined in prototype chain\n\n\t\t\tunstackErrors(model)\n\t\t}\n\n\t\treturn !nbErrors\n\t},\n\n\tcannot = (msg, model) => {\n\t\tmodel.errors.push({ message: \"cannot \" + msg })\n\t},\n\n\tcast = (obj, defNode = []) => {\n\t\tif (!obj || isPlainObject(defNode) || is(BasicModel, defNode) || isModelInstance(obj))\n\t\t\treturn obj // no value or not leaf or already a model instance\n\n\t\tconst def = parseDefinition(defNode),\n\t\t\tsuitableModels = []\n\n\t\tfor (let part of def) {\n\t\t\tif (is(Model, part) && !is(BasicModel, part) && part.test(obj))\n\t\t\t\tsuitableModels.push(part)\n\t\t}\n\n\t\tif (suitableModels.length === 1) {\n\t\t\t// automatically cast to suitable model when explicit (autocasting)\n\t\t\treturn new suitableModels[0](obj, _checked)\n\t\t}\n\n\t\tif (suitableModels.length > 1)\n\t\t\tconsole.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(\" or \")}`)\n\n\t\treturn obj\n\t},\n\n\n\tgetProp = (val, model, def, path, privateAccess) => {\n\t\tif (!isPlainObject(def)) return cast(val, def)\n\t\treturn proxify(val, getTraps(model, def, path, privateAccess))\n\t},\n\n\tgetTraps = (model, def, path, privateAccess) => {\n\t\tconst grantPrivateAccess = f => proxify(f, {\n\t\t\tapply(fn, ctx, args) {\n\t\t\t\tprivateAccess = true\n\t\t\t\tconst result = Reflect.apply(fn, ctx, args)\n\t\t\t\tprivateAccess = false\n\t\t\t\treturn result\n\t\t\t}\n\t\t})\n\n\t\treturn {\n\t\t\tget(o, key) {\n\t\t\t\tif (key === _original) return o\n\n\t\t\t\tif (!isString(key)) return Reflect.get(o, key)\n\n\t\t\t\tconst newPath = formatPath(path, key)\n\t\t\t\tconst inDef = has(def, key)\n\t\t\t\tconst defPart = def[key]\n\n\t\t\t\tif (!privateAccess && inDef && model.conventionForPrivate(key)) {\n\t\t\t\t\tcannot(`access to private property ${newPath}`, model)\n\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tlet value = o[key]\n\n\t\t\t\tif (inDef && value && has(o, key) && !isPlainObject(defPart) && !isModelInstance(value)) {\n\t\t\t\t\tReflect.set(o, key, value = cast(value, defPart)) // cast nested models\n\t\t\t\t}\n\n\t\t\t\tif (isFunction(value) && key !== \"constructor\" && !privateAccess) {\n\t\t\t\t\treturn grantPrivateAccess(value)\n\t\t\t\t}\n\n\t\t\t\tif (isPlainObject(defPart) && !value) {\n\t\t\t\t\to[key] = value = {} // null-safe traversal\n\t\t\t\t}\n\n\t\t\t\treturn getProp(value, model, defPart, newPath, privateAccess)\n\t\t\t},\n\n\t\t\tset(o, key, val) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key])))\n\t\t\t},\n\n\t\t\tdeleteProperty(o, key) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key))\n\t\t\t},\n\n\t\t\tdefineProperty(o, key, args) {\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args))\n\t\t\t},\n\n\t\t\thas(o, key) {\n\t\t\t\treturn Reflect.has(o, key) && Reflect.has(def, key) && !model.conventionForPrivate(key)\n\t\t\t},\n\n\t\t\townKeys(o) {\n\t\t\t\treturn Reflect.ownKeys(o).filter(key => Reflect.has(def, key) && !model.conventionForPrivate(key))\n\t\t\t},\n\n\t\t\tgetOwnPropertyDescriptor(o, key) {\n\t\t\t\tlet descriptor\n\t\t\t\tif (!model.conventionForPrivate(key)) {\n\t\t\t\t\tdescriptor = Object.getOwnPropertyDescriptor(def, key)\n\t\t\t\t\tif (descriptor !== undefined) descriptor.value = o[key]\n\t\t\t\t}\n\n\t\t\t\treturn descriptor\n\t\t\t}\n\t\t}\n\t}\n\n\nexport function Model(def, params) {\n\treturn isPlainObject(def) ? new ObjectModel(def, params) : new BasicModel(def)\n}\n\nObject.assign(Model.prototype, {\n\tname: \"Model\",\n\tassertions: [],\n\n\tconventionForConstant: key => key.toUpperCase() === key,\n\tconventionForPrivate: key => key[0] === \"_\",\n\n\ttoString(stack) {\n\t\treturn has(this, \"name\") ? this.name : formatDefinition(this.definition, stack) + formatAssertions(this.assertions)\n\t},\n\n\tas(name) {\n\t\tdefine(this, \"name\", name)\n\t\treturn this\n\t},\n\n\tdefaultTo(val) {\n\t\tthis.default = val\n\t\treturn this\n\t},\n\n\t[_check](obj, path, errors, stack) {\n\t\tcheckDefinition(obj, this.definition, path, errors, stack)\n\t\tcheckAssertions(obj, this, path, errors)\n\t},\n\n\ttest(obj, errorCollector) {\n\t\tlet model = this\n\t\twhile (!has(model, \"errorCollector\")) {\n\t\t\tmodel = getProto(model)\n\t\t}\n\n\t\tconst initialErrorCollector = model.errorCollector\n\t\tlet failed\n\n\t\tmodel.errorCollector = errors => {\n\t\t\tfailed = true\n\t\t\tif (errorCollector) errorCollector.call(this, errors)\n\t\t}\n\n\t\tnew this(obj) // may trigger errorCollector\n\n\t\tmodel.errorCollector = initialErrorCollector\n\t\treturn !failed\n\t},\n\n\terrorCollector(errors) {\n\t\tconst e = new TypeError(errors.map(e => e.message).join(\"\\n\"))\n\t\te.stack = e.stack.replace(/\\n.*object-model(.|\\n)*object-model.*/, \"\") // blackbox objectmodel in stacktrace\n\t\tthrow e\n\t},\n\n\tassert(assertion, description = format(assertion)) {\n\t\tdefine(assertion, \"description\", description)\n\t\tthis.assertions = this.assertions.concat(assertion)\n\t\treturn this\n\t}\n})\n\n\nexport function BasicModel(def) {\n\treturn initModel(def, BasicModel)\n}\n\nextend(BasicModel, Model, {\n\textend(...newParts) {\n\t\tconst child = extendModel(new BasicModel(extendDefinition(this.definition, newParts)), this)\n\t\tfor (let part of newParts) {\n\t\t\tif (is(BasicModel, part)) child.assertions.push(...part.assertions)\n\t\t}\n\n\t\treturn child\n\t}\n})\n\nexport function ObjectModel(def) {\n\treturn initModel(def, ObjectModel, Object, initObjectModel, model => getTraps(model, def), true)\n}\n\nextend(ObjectModel, Model, {\n\tdefaultTo(obj) {\n\t\tconst def = this.definition\n\t\tfor (let key in obj) {\n\t\t\tif (has(def, key)) {\n\t\t\t\tobj[key] = checkDefinition(obj[key], def[key], key, this.errors, [], true)\n\t\t\t}\n\t\t}\n\t\tunstackErrors(this)\n\t\tthis.default = obj;\n\t\treturn this\n\t},\n\n\ttoString(stack) {\n\t\treturn format(this.definition, stack)\n\t},\n\n\textend(...newParts) {\n\t\tconst definition = { ...this.definition }\n\t\tconst proto = { ...this.prototype }\n\t\tconst defaults = { ...this.default }\n\t\tconst newAssertions = []\n\n\t\tfor (let part of newParts) {\n\t\t\tif (is(Model, part)) {\n\t\t\t\tmerge(definition, part.definition)\n\t\t\t\tmerge(defaults, part.default)\n\t\t\t\tnewAssertions.push(...part.assertions)\n\t\t\t}\n\t\t\tif (isFunction(part)) merge(proto, part.prototype)\n\t\t\tif (isObject(part)) merge(definition, part)\n\t\t}\n\n\t\tconst submodel = extendModel(new ObjectModel(definition), this, proto).defaultTo(defaults)\n\t\tsubmodel.assertions = [...this.assertions, ...newAssertions]\n\n\t\tif (getProto(this) !== ObjectModel.prototype) { // extended class\n\t\t\tsubmodel.parentClass = this\n\t\t}\n\n\t\treturn submodel\n\t},\n\n\t[_check](obj, path, errors, stack, shouldCast) {\n\t\tif (isObject(obj)) {\n\t\t\tcheckDefinition(obj[_original] || obj, this.definition, path, errors, stack, shouldCast)\n\t\t}\n\t\telse stackError(errors, this, obj, path)\n\n\t\tcheckAssertions(obj, this, path, errors)\n\t}\n})\n\nexport const Any = proxify(BasicModel(), {\n\tapply(target, ctx, [def]) {\n\t\tconst anyOf = Object.create(Any)\n\t\tanyOf.definition = def;\n\t\treturn anyOf\n\t}\n})\nAny.definition = Any\nAny.toString = () => \"Any\"\n\nAny.remaining = function (def) { this.definition = def }\nextend(Any.remaining, Any, {\n\ttoString() { return \"...\" + formatDefinition(this.definition) }\n})\nAny[Symbol.iterator] = function* () { yield new Any.remaining(this.definition) }","\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\nimport { has, isFunction, proxify } from \"./helpers.js\"\n\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\n\n\treturn initModel(def, constructor, base, init, model => Object.assign({\n\t\tgetPrototypeOf: () => model.prototype,\n\t\tget(l, key) {\n\t\t\tif (key === _original) return l\n\n\t\t\tconst val = l[key]\n\t\t\treturn isFunction(val) ? proxify(val, {\n\t\t\t\tapply(fn, ctx, args) {\n\t\t\t\t\tif (has(mutators, key)) {\n\t\t\t\t\t\t// indexes of arguments to check def + cast\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\n\t\t\t\t\t\t\targs[i] = checkDefinition(\n\t\t\t\t\t\t\t\targs[i],\n\t\t\t\t\t\t\t\targDef,\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\n\t\t\t\t\t\t\t\tmodel.errors,\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (model.assertions.length > 0) {\n\t\t\t\t\t\t\tconst testingClone = clone(l)\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fn.apply(l, args)\n\t\t\t\t}\n\t\t\t}) : val\n\t\t}\n\t}, otherTraps))\n}","import {\n\t_original, _check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend } from \"./helpers.js\"\n\nexport default function ArrayModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tArray,\n\t\tArrayModel,\n\t\tinitialDefinition,\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\n\t\ta => [...a],\n\t\t{\n\t\t\t\"copyWithin\": [],\n\t\t\t\"fill\": [0, 0],\n\t\t\t\"pop\": [],\n\t\t\t\"push\": [0],\n\t\t\t\"reverse\": [],\n\t\t\t\"shift\": [],\n\t\t\t\"sort\": [],\n\t\t\t\"splice\": [2],\n\t\t\t\"unshift\": [0]\n\t\t},\n\t\t{\n\t\t\tset(arr, key, val) {\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\n\t\t\t},\n\n\t\t\tdeleteProperty(arr, key) {\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\n\t\t\t}\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(ArrayModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](arr, path, errors, stack) {\n\t\tif (Array.isArray(arr))\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\n\t\telse stackError(errors, this, arr, path)\n\n\t\tcheckAssertions(arr, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})\n\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\n\tconst path = `Array[${key}]`\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\n\n\tconst testArray = [...array]\n\tapplyMutation(testArray)\n\tcheckAssertions(testArray, model, path)\n\tconst isSuccess = !unstackErrors(model)\n\tif (isSuccess) applyMutation(array, value)\n\treturn isSuccess\n}","import {\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\n\tformatDefinition, initModel, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { extend, is, isFunction } from \"./helpers.js\"\n\nexport default function FunctionModel(...argsDef) {\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\n\t\tgetPrototypeOf: () => model.prototype,\n\n\t\tget(fn, key) {\n\t\t\treturn key === _original ? fn : fn[key]\n\t\t},\n\n\t\tapply(fn, ctx, args) {\n\t\t\tconst def = model.definition\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\n\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\n\t\t\t}\n\n\t\t\tcheckAssertions(args, model, \"arguments\")\n\n\t\t\tlet result\n\t\t\tif (!model.errors.length) {\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\n\t\t\t\tif (\"return\" in def)\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\n\t\t\t}\n\t\t\tunstackErrors(model)\n\t\t\treturn result\n\t\t}\n\t}))\n}\n\nextend(FunctionModel, Model, {\n\ttoString(stack = []) {\n\t\tlet out = `Function(${this.definition.arguments.map(\n\t\t\targDef => formatDefinition(argDef, [...stack])\n\t\t).join(\", \")})`\n\n\t\tif (\"return\" in this.definition) {\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\n\t\t}\n\t\treturn out\n\t},\n\n\treturn(def) {\n\t\tthis.definition.return = def\n\t\treturn this\n\t},\n\n\textend(newArgs, newReturns) {\n\t\tconst args = this.definition.arguments,\n\t\t\t mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])),\n\t\t\t mixedReturns = extendDefinition(this.definition.return, newReturns)\n\t\treturn extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this)\n\t},\n\n\t[_check](f, path, errors) {\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\n\tconst model = initListModel(\n\t\tMap,\n\t\tMapModel,\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\n\t\tmap => new Map(map),\n\t\t{\n\t\t\t\"set\": [0, 1, getDef],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(MapModel, Model, {\n\ttoString(stack) {\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\n\t},\n\n\t[_check](map, path, errors, stack) {\n\t\tif (is(Map, map)) {\n\t\t\tpath = path || \"Map\"\n\t\t\tfor (let [key, value] of map) {\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, map, path)\n\n\t\tcheckAssertions(map, this, path, errors)\n\t},\n\n\textend(keyParts, valueParts) {\n\t\treturn extendModel(new MapModel(\n\t\t\textendDefinition(this.definition.key, keyParts),\n\t\t\textendDefinition(this.definition.value, valueParts)\n\t\t), this)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function SetModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tSet,\n\t\tSetModel,\n\t\tinitialDefinition,\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\n\t\tset => new Set(set),\n\t\t{\n\t\t\t\"add\": [0, 0],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(SetModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](set, path, errors, stack) {\n\t\tif (is(Set, set)) {\n\t\t\tfor (let item of set.values()) {\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, set, path)\n\t\tcheckAssertions(set, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})"],"names":["ObjectProto","Object","prototype","getProto","getPrototypeOf","setProto","setPrototypeOf","has","o","prop","hasOwnProperty","call","is","Constructor","obj","isFunction","f","isObject","isString","s","isPlainObject","isIterable","x","Symbol","iterator","proxify","val","traps","Proxy","merge","target","src","key","define","value","enumerable","defineProperty","writable","configurable","extend","child","parent","props","assign","create","constructor","_check","_checked","_original","initModel","def","init","getTraps","useNew","model","default","mode","this","check","definition","assertions","name","initObjectModel","_this","undefined","stackError","errors","parentClass","extendModel","newProps","push","expected","received","path","message","unstackErrors","collector","errorCollector","nbErrors","length","map","err","formatDefinition","toString","match","format","isModelInstance","i","Model","parseDefinition","Array","isArray","stack","parts","d","join","extendDefinition","newParts","concat","filter","index","self","indexOf","checkDefinition","shouldCast","indexFound","cast","formatPath","some","part","checkDefinitionPart","Any","RegExp","test","Number","Date","isNaN","checkAssertions","assertion","result","onFail","description","assertionResult","includes","String","unshift","Map","Set","item","keys","indent","repeat","slice","controlMutation","privateAccess","applyMutation","newPath","isPrivate","conventionForPrivate","isConstant","conventionForConstant","isOwnProperty","initialPropDescriptor","getOwnPropertyDescriptor","cannot","msg","defNode","BasicModel","suitableModels","console","warn","[object Object]","Reflect","get","inDef","defPart","set","fn","ctx","args","apply","getProp","deleteProperty","ownKeys","descriptor","params","ObjectModel","toUpperCase","fns","initialErrorCollector","failed","e","TypeError","replace","proto","defaults","newAssertions","submodel","defaultTo","anyOf","remaining","initListModel","base","clone","mutators","otherTraps","l","begin","end","getArgDef","argDef","testingClone","ArrayModel","initialDefinition","a","arg","copyWithin","fill","pop","reverse","shift","sort","splice","arr","v","forEach","array","canBeExtended","testArray","isSuccess","FunctionModel","argsDef","arguments","Function","remainingArgDef","find","nbArgsToCheck","Math","max","return","MapModel","initialKeyDefinition","initialValueDefinition","getDef","it","pair","delete","clear","SetModel","add","out","newArgs","newReturns","mixedArgs","mixedReturns","keyParts","valueParts","values"],"mappings":"AAAO,MACNA,EAAcC,OAAOC,UAErBC,EAAWF,OAAOG,eAClBC,EAAWJ,OAAOK,eAElBC,EAAM,CAACC,EAAGC,IAAST,EAAYU,eAAeC,KAAKH,EAAGC,GACtDG,EAAK,CAACC,EAAaC,IAAQA,aAAeD,EAC1CE,EAAaC,GAAkB,mBAANA,EACzBC,EAAWT,GAAKA,GAAkB,iBAANA,EAC5BU,EAAWC,GAAkB,iBAANA,EACvBC,EAAgBZ,GAAKS,EAAST,IAAML,EAASK,KAAOR,EACpDqB,EAAaC,GAAKA,GAAKP,EAAWO,EAAEC,OAAOC,WAE3CC,EAAU,CAACC,EAAKC,IAAU,IAAIC,MAAMF,EAAKC,GAEzCE,EAAQ,CAACC,EAAQC,EAAM,MACtB,IAAK,IAAIC,KAAOD,EACf,GAAIX,EAAcW,EAAIC,IAAO,CAC5B,MAAMxB,EAAI,GACVqB,EAAMrB,EAAGsB,EAAOE,IAChBH,EAAMrB,EAAGuB,EAAIC,IACbF,EAAOE,GAAOxB,OAEdsB,EAAOE,GAAOD,EAAIC,GAGpB,OAAOF,GAGRG,EAAS,CAACnB,EAAKkB,EAAKE,EAAOC,GAAa,KACvClC,OAAOmC,eAAetB,EAAKkB,EAAK,CAAEE,MAAAA,EAAOC,WAAAA,EAAYE,UAAU,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Q4B,EAAIiF,SACpBtI,EAAgByB,EAAMvE,KAAKE,WAAY,GAAGc,GAAQ,cAAeP,EAAQ0B,QAEpE3B,EAAWC,EAAQT,KAAMmG,EAAKnF,GACrC4C,EAAgBuC,EAAKnG,KAAMgB,EAAMP,IAGlCqF,UAAUtD,GACT,OAAO7B,EAAY,IAAIgK,EAASpI,EAAiBvC,KAAKE,WAAYsC,IAAYxC"} \ No newline at end of file +{"version":3,"file":"object-model.min.js","sources":["../src/helpers.js","../src/object-model.js","../src/list-model.js","../src/array-model.js","../src/function-model.js","../src/map-model.js","../src/set-model.js"],"sourcesContent":["export const\n\tObjectProto = Object.prototype,\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\n\tgetProto = Object.getPrototypeOf,\n\tsetProto = Object.setPrototypeOf,\n\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\n\tis = (Constructor, obj) => obj instanceof Constructor,\n\tisFunction = f => typeof f === \"function\",\n\tisObject = o => o && typeof o === \"object\",\n\tisString = s => typeof s === \"string\",\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\n\n\tproxify = (val, traps) => new Proxy(val, traps),\n\n\tmerge = (target, src = {}) => {\n\t\tfor (let key in src) {\n\t\t\tif (isPlainObject(src[key])) {\n\t\t\t\tconst o = {}\n\t\t\t\tmerge(o, target[key])\n\t\t\t\tmerge(o, src[key])\n\t\t\t\ttarget[key] = o\n\t\t\t} else {\n\t\t\t\ttarget[key] = src[key]\n\t\t\t}\n\t\t}\n\t\treturn target\n\t},\n\n\tdefine = (obj, key, value, enumerable = false) => {\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\n\t},\n\n\textend = (child, parent, props) => {\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\n\t\t\tconstructor: {\n\t\t\t\tvalue: child,\n\t\t\t\twritable: true,\n\t\t\t\tconfigurable: true\n\t\t\t}\n\t\t}), props)\n\t\tsetProto(child, parent)\n\t}","import {\r\n\tbettertypeof, define, extend, getProto, has,\r\n\tis, isFunction, isObject, isPlainObject, isString,\r\n\tmerge, ObjectProto, proxify, setProto\r\n} from \"./helpers.js\"\r\n\r\nexport const\r\n\t_check = Symbol(),\r\n\t_checked = Symbol(), // used to skip validation at instanciation for perf\r\n\t_original = Symbol(), // used to bypass proxy\r\n\tCHECK_ONCE = Symbol(),\r\n\r\n\tinitModel = (def, constructor, parent, init, getTraps, useNew) => {\r\n\t\tconst model = function (val = model.default, mode) {\r\n\t\t\tif (useNew && !is(model, this)) return new model(val)\r\n\t\t\tif (init) val = init(val, model, this)\r\n\r\n\t\t\tif (mode === _checked || check(model, val))\r\n\t\t\t\treturn getTraps && mode !== CHECK_ONCE ? proxify(val, getTraps(model)) : val\r\n\t\t}\r\n\r\n\t\tif (parent) extend(model, parent)\r\n\t\tsetProto(model, constructor.prototype)\r\n\t\tmodel.constructor = constructor\r\n\t\tmodel.definition = def\r\n\t\tmodel.assertions = [...model.assertions]\r\n\t\tdefine(model, \"errors\", [])\r\n\t\tdelete model.name\r\n\t\treturn model\r\n\t},\r\n\r\n\tinitObjectModel = (obj, model, _this) => {\r\n\t\tif (is(model, obj)) return obj\r\n\r\n\t\tif (!isObject(obj) && !isFunction(obj) && obj !== undefined) {\r\n\t\t\tstackError(model.errors, Object, obj)\r\n\t\t}\r\n\r\n\t\tmerge(_this, model.default)\r\n\t\tif (model.parentClass) merge(obj, new model.parentClass(obj))\r\n\t\tmerge(_this, obj)\r\n\t\treturn _this\r\n\t},\r\n\r\n\textendModel = (child, parent, newProps) => {\r\n\t\textend(child, parent, newProps)\r\n\t\tchild.assertions.push(...parent.assertions)\r\n\t\treturn child\r\n\t},\r\n\r\n\tstackError = (errors, expected, received, path, message) => {\r\n\t\terrors.push({ expected, received, path, message })\r\n\t},\r\n\r\n\tunstackErrors = (model, collector = model.errorCollector) => {\r\n\t\tconst nbErrors = model.errors.length\r\n\t\tif (nbErrors > 0) {\r\n\t\t\tconst errors = model.errors.map(err => {\r\n\t\t\t\tif (!err.message) {\r\n\t\t\t\t\terr.message = \"expecting \" + (err.path ? err.path + \" to be \" : \"\") + formatDefinition(err.expected)\r\n\t\t\t\t\t\t+ \", got \" + (err.received != null ? bettertypeof(err.received) + \" \" : \"\") + format(err.received)\r\n\t\t\t\t}\r\n\t\t\t\treturn err\r\n\t\t\t})\r\n\r\n\t\t\tmodel.errors.length = 0\r\n\t\t\tcollector.call(model, errors) // throw all errors collected\r\n\t\t}\r\n\t\treturn nbErrors\r\n\t},\r\n\r\n\tisModelInstance = i => i && getProto(i) && is(Model, getProto(i).constructor),\r\n\r\n\tparseDefinition = (def) => {\r\n\t\tif (isPlainObject(def)) {\r\n\t\t\tdef = {}\r\n\t\t\tfor (let key in def) { def[key] = parseDefinition(def[key]) }\r\n\t\t}\r\n\t\telse if (!Array.isArray(def)) return [def]\r\n\t\telse if (def.length === 1) return [def[0], undefined, null]\r\n\r\n\t\treturn def\r\n\t},\r\n\r\n\tformatDefinition = (def, stack) => {\r\n\t\tconst parts = parseDefinition(def).map(d => format(d, stack))\r\n\t\treturn parts.length > 1 ? parts.join(\" or \") : parts[0]\r\n\t},\r\n\r\n\tformatAssertions = fns => fns.length ? `(${fns.map(f => f.name || f.description || f)})` : \"\",\r\n\r\n\textendDefinition = (def, newParts = []) => {\r\n\t\tif (newParts.length > 0) {\r\n\t\t\tdef = [].concat(def, ...[].concat(newParts))// clone to lose ref\r\n\t\t\t\t.filter((value, index, self) => self.indexOf(value) === index) // remove duplicates\r\n\t\t}\r\n\r\n\t\treturn def\r\n\t},\r\n\r\n\tcheck = (model, obj) => {\r\n\t\tmodel[_check](obj, null, model.errors, [], true);\r\n\t\treturn !unstackErrors(model)\r\n\t},\r\n\r\n\tcheckDefinition = (obj, def, path, errors, stack, shouldCast) => {\r\n\t\tconst indexFound = stack.indexOf(def)\r\n\t\tif (indexFound !== -1 && stack.indexOf(def, indexFound + 1) !== -1)\r\n\t\t\treturn obj // if found twice in call stack, cycle detected, skip validation\r\n\r\n\t\tif (Array.isArray(def) && def.length === 1 && obj != null) {\r\n\t\t\tdef = def[0] // shorten validation path for optionals\r\n\t\t}\r\n\r\n\t\tif (is(Model, def)) {\r\n\t\t\tif (shouldCast) obj = cast(obj, def)\r\n\t\t\tdef[_check](obj, path, errors, stack.concat(def))\r\n\t\t}\r\n\t\telse if (isPlainObject(def)) {\r\n\t\t\tfor (let key in def) {\r\n\t\t\t\tconst val = obj ? obj[key] : undefined\r\n\t\t\t\tcheckDefinition(val, def[key], formatPath(path, key), errors, stack, shouldCast)\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tconst pdef = parseDefinition(def)\r\n\t\t\tif (pdef.some(part => checkDefinitionPart(obj, part, path, stack))) {\r\n\t\t\t\treturn shouldCast ? cast(obj, def) : obj\r\n\t\t\t}\r\n\r\n\t\t\tstackError(errors, def, obj, path)\r\n\t\t}\r\n\r\n\t\treturn obj\r\n\t},\r\n\r\n\tcheckDefinitionPart = (obj, def, path, stack, shouldCast) => {\r\n\t\tif (def === Any) return true\r\n\t\tif (obj == null) return obj === def\r\n\t\tif (isPlainObject(def) || is(Model, def)) { // object or model as part of union type\r\n\t\t\tconst errors = []\r\n\t\t\tcheckDefinition(obj, def, path, errors, stack, shouldCast)\r\n\t\t\treturn !errors.length\r\n\t\t}\r\n\t\tif (is(RegExp, def)) return def.test(obj)\r\n\t\tif (def === Number || def === Date) return obj.constructor === def && !isNaN(obj)\r\n\t\treturn obj === def\r\n\t\t\t|| (isFunction(def) && is(def, obj))\r\n\t\t\t|| obj.constructor === def\r\n\t},\r\n\r\n\tcheckAssertions = (obj, model, path, errors = model.errors) => {\r\n\t\tfor (let assertion of model.assertions) {\r\n\t\t\tlet result\r\n\t\t\ttry {\r\n\t\t\t\tresult = assertion.call(model, obj)\r\n\t\t\t} catch (err) {\r\n\t\t\t\tresult = err\r\n\t\t\t}\r\n\t\t\tif (result !== true) {\r\n\t\t\t\tconst onFail = isFunction(assertion.description) ? assertion.description : (assertionResult, value) =>\r\n\t\t\t\t\t`assertion \"${assertion.description}\" returned ${format(assertionResult)} `\r\n\t\t\t\t\t+ `for ${path ? path + \" =\" : \"value\"} ${format(value)}`\r\n\t\t\t\tstackError(errors, assertion, obj, path, onFail.call(model, result, obj, path))\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tformat = (obj, stack = []) => {\r\n\t\tif (stack.length > 15 || stack.includes(obj)) return \"...\"\r\n\t\tif (obj === null || obj === undefined) return String(obj)\r\n\t\tif (isString(obj)) return `\"${obj}\"`\r\n\t\tif (is(Model, obj)) return obj.toString(stack)\r\n\r\n\t\tstack.unshift(obj)\r\n\r\n\t\tif (isFunction(obj)) return obj.name || obj.toString()\r\n\t\tif (is(Map, obj) || is(Set, obj)) return format([...obj])\r\n\t\tif (Array.isArray(obj)) return `[${obj.map(item => format(item, stack)).join(\", \")}]`\r\n\t\tif (obj.toString && obj.toString !== ObjectProto.toString) return obj.toString()\r\n\t\tif (isObject(obj)) {\r\n\t\t\tconst props = Object.keys(obj),\r\n\t\t\t\tindent = \"\\t\".repeat(stack.length)\r\n\t\t\treturn `{${props.map(\r\n\t\t\t\tkey => `\\n${indent + key}: ${format(obj[key], [...stack])}`\r\n\t\t\t).join(\", \")} ${props.length ? `\\n${indent.slice(1)}` : \"\"}}`\r\n\t\t}\r\n\r\n\t\treturn String(obj)\r\n\t},\r\n\r\n\tformatPath = (path, key) => path ? path + \".\" + key : key,\r\n\r\n\tcontrolMutation = (model, def, path, o, key, privateAccess, applyMutation) => {\r\n\t\tconst newPath = formatPath(path, key),\r\n\t\t\tisPrivate = model.conventionForPrivate(key),\r\n\t\t\tisConstant = model.conventionForConstant(key),\r\n\t\t\tisOwnProperty = has(o, key),\r\n\t\t\tinitialPropDescriptor = isOwnProperty && Object.getOwnPropertyDescriptor(o, key)\r\n\r\n\t\tif (key in def && ((isPrivate && !privateAccess) || (isConstant && o[key] !== undefined)))\r\n\t\t\tcannot(`modify ${isPrivate ? \"private\" : \"constant\"} property ${key}`, model)\r\n\r\n\t\tapplyMutation()\r\n\t\tif (has(def, key)) checkDefinition(o[key], def[key], newPath, model.errors, [])\r\n\t\tcheckAssertions(o, model, newPath)\r\n\r\n\t\tconst nbErrors = model.errors.length\r\n\t\tif (nbErrors) {\r\n\t\t\tif (isOwnProperty) Object.defineProperty(o, key, initialPropDescriptor)\r\n\t\t\telse delete o[key] // back to the initial property defined in prototype chain\r\n\r\n\t\t\tunstackErrors(model)\r\n\t\t}\r\n\r\n\t\treturn !nbErrors\r\n\t},\r\n\r\n\tcannot = (msg, model) => {\r\n\t\tmodel.errors.push({ message: \"cannot \" + msg })\r\n\t},\r\n\r\n\tcast = (obj, defNode = []) => {\r\n\t\tif (!obj || isPlainObject(defNode) || is(BasicModel, defNode) || isModelInstance(obj))\r\n\t\t\treturn obj // no value or not leaf or already a model instance\r\n\r\n\t\tconst def = parseDefinition(defNode),\r\n\t\t\tsuitableModels = []\r\n\r\n\t\tfor (let part of def) {\r\n\t\t\tif (is(Model, part) && !is(BasicModel, part) && part.test(obj))\r\n\t\t\t\tsuitableModels.push(part)\r\n\t\t}\r\n\r\n\t\tif (suitableModels.length === 1) {\r\n\t\t\t// automatically cast to suitable model when explicit (autocasting)\r\n\t\t\treturn new suitableModels[0](obj, _checked)\r\n\t\t}\r\n\r\n\t\tif (suitableModels.length > 1)\r\n\t\t\tconsole.warn(`Ambiguous model for value ${format(obj)}, could be ${suitableModels.join(\" or \")}`)\r\n\r\n\t\treturn obj\r\n\t},\r\n\r\n\r\n\tgetProp = (val, model, def, path, privateAccess) => {\r\n\t\tif (!isPlainObject(def)) return cast(val, def)\r\n\t\treturn proxify(val, getTraps(model, def, path, privateAccess))\r\n\t},\r\n\r\n\tgetTraps = (model, def, path, privateAccess) => {\r\n\t\tconst grantPrivateAccess = f => proxify(f, {\r\n\t\t\tapply(fn, ctx, args) {\r\n\t\t\t\tprivateAccess = true\r\n\t\t\t\tconst result = Reflect.apply(fn, ctx, args)\r\n\t\t\t\tprivateAccess = false\r\n\t\t\t\treturn result\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn {\r\n\t\t\tget(o, key) {\r\n\t\t\t\tif (key === _original) return o\r\n\r\n\t\t\t\tif (!isString(key)) return Reflect.get(o, key)\r\n\r\n\t\t\t\tconst newPath = formatPath(path, key)\r\n\t\t\t\tconst inDef = has(def, key)\r\n\t\t\t\tconst defPart = def[key]\r\n\r\n\t\t\t\tif (!privateAccess && inDef && model.conventionForPrivate(key)) {\r\n\t\t\t\t\tcannot(`access to private property ${newPath}`, model)\r\n\t\t\t\t\tunstackErrors(model)\r\n\t\t\t\t\treturn\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet value = o[key]\r\n\r\n\t\t\t\tif (inDef && value && has(o, key) && !isPlainObject(defPart) && !isModelInstance(value)) {\r\n\t\t\t\t\tReflect.set(o, key, value = cast(value, defPart)) // cast nested models\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isFunction(value) && key !== \"constructor\" && !privateAccess) {\r\n\t\t\t\t\treturn grantPrivateAccess(value)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (isPlainObject(defPart) && !value) {\r\n\t\t\t\t\to[key] = value = {} // null-safe traversal\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn getProp(value, model, defPart, newPath, privateAccess)\r\n\t\t\t},\r\n\r\n\t\t\tset(o, key, val) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.set(o, key, cast(val, def[key])))\r\n\t\t\t},\r\n\r\n\t\t\tdeleteProperty(o, key) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.deleteProperty(o, key))\r\n\t\t\t},\r\n\r\n\t\t\tdefineProperty(o, key, args) {\r\n\t\t\t\treturn controlMutation(model, def, path, o, key, privateAccess, () => Reflect.defineProperty(o, key, args))\r\n\t\t\t},\r\n\r\n\t\t\thas(o, key) {\r\n\t\t\t\treturn Reflect.has(o, key) && Reflect.has(def, key) && !model.conventionForPrivate(key)\r\n\t\t\t},\r\n\r\n\t\t\townKeys(o) {\r\n\t\t\t\treturn Reflect.ownKeys(o).filter(key => Reflect.has(def, key) && !model.conventionForPrivate(key))\r\n\t\t\t},\r\n\r\n\t\t\tgetOwnPropertyDescriptor(o, key) {\r\n\t\t\t\tlet descriptor\r\n\t\t\t\tif (!model.conventionForPrivate(key)) {\r\n\t\t\t\t\tdescriptor = Object.getOwnPropertyDescriptor(def, key)\r\n\t\t\t\t\tif (descriptor !== undefined) descriptor.value = o[key]\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn descriptor\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\nexport function Model(def, params) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def, params) : new BasicModel(def)\r\n}\r\n\r\nObject.assign(Model.prototype, {\r\n\tname: \"Model\",\r\n\tassertions: [],\r\n\r\n\tconventionForConstant: key => key.toUpperCase() === key,\r\n\tconventionForPrivate: key => key[0] === \"_\",\r\n\r\n\ttoString(stack) {\r\n\t\treturn has(this, \"name\") ? this.name : formatDefinition(this.definition, stack) + formatAssertions(this.assertions)\r\n\t},\r\n\r\n\tas(name) {\r\n\t\tdefine(this, \"name\", name)\r\n\t\treturn this\r\n\t},\r\n\r\n\tdefaultTo(val) {\r\n\t\tthis.default = val\r\n\t\treturn this\r\n\t},\r\n\r\n\t[_check](obj, path, errors, stack) {\r\n\t\tcheckDefinition(obj, this.definition, path, errors, stack)\r\n\t\tcheckAssertions(obj, this, path, errors)\r\n\t},\r\n\r\n\ttest(obj, errorCollector) {\r\n\t\tlet model = this\r\n\t\twhile (!has(model, \"errorCollector\")) {\r\n\t\t\tmodel = getProto(model)\r\n\t\t}\r\n\r\n\t\tconst initialErrorCollector = model.errorCollector\r\n\t\tlet failed\r\n\r\n\t\tmodel.errorCollector = errors => {\r\n\t\t\tfailed = true\r\n\t\t\tif (errorCollector) errorCollector.call(this, errors)\r\n\t\t}\r\n\r\n\t\tnew this(obj) // may trigger errorCollector\r\n\r\n\t\tmodel.errorCollector = initialErrorCollector\r\n\t\treturn !failed\r\n\t},\r\n\r\n\terrorCollector(errors) {\r\n\t\tconst e = new TypeError(errors.map(e => e.message).join(\"\\n\"))\r\n\t\te.stack = e.stack.replace(/\\n.*object-model(.|\\n)*object-model.*/, \"\") // blackbox objectmodel in stacktrace\r\n\t\tthrow e\r\n\t},\r\n\r\n\tassert(assertion, description = format(assertion)) {\r\n\t\tdefine(assertion, \"description\", description)\r\n\t\tthis.assertions = this.assertions.concat(assertion)\r\n\t\treturn this\r\n\t}\r\n})\r\n\r\nModel.CHECK_ONCE = CHECK_ONCE\r\n\r\nexport function BasicModel(def) {\r\n\treturn initModel(def, BasicModel)\r\n}\r\n\r\nextend(BasicModel, Model, {\r\n\textend(...newParts) {\r\n\t\tconst child = extendModel(new BasicModel(extendDefinition(this.definition, newParts)), this)\r\n\t\tfor (let part of newParts) {\r\n\t\t\tif (is(BasicModel, part)) child.assertions.push(...part.assertions)\r\n\t\t}\r\n\r\n\t\treturn child\r\n\t}\r\n})\r\n\r\nexport function ObjectModel(def) {\r\n\treturn initModel(def, ObjectModel, Object, initObjectModel, model => getTraps(model, def), true)\r\n}\r\n\r\nextend(ObjectModel, Model, {\r\n\tdefaultTo(obj) {\r\n\t\tconst def = this.definition\r\n\t\tfor (let key in obj) {\r\n\t\t\tif (has(def, key)) {\r\n\t\t\t\tobj[key] = checkDefinition(obj[key], def[key], key, this.errors, [], true)\r\n\t\t\t}\r\n\t\t}\r\n\t\tunstackErrors(this)\r\n\t\tthis.default = obj;\r\n\t\treturn this\r\n\t},\r\n\r\n\ttoString(stack) {\r\n\t\treturn format(this.definition, stack)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\tconst definition = { ...this.definition }\r\n\t\tconst proto = { ...this.prototype }\r\n\t\tconst defaults = { ...this.default }\r\n\t\tconst newAssertions = []\r\n\r\n\t\tfor (let part of newParts) {\r\n\t\t\tif (is(Model, part)) {\r\n\t\t\t\tmerge(definition, part.definition)\r\n\t\t\t\tmerge(defaults, part.default)\r\n\t\t\t\tnewAssertions.push(...part.assertions)\r\n\t\t\t}\r\n\t\t\tif (isFunction(part)) merge(proto, part.prototype)\r\n\t\t\tif (isObject(part)) merge(definition, part)\r\n\t\t}\r\n\r\n\t\tconst submodel = extendModel(new ObjectModel(definition), this, proto).defaultTo(defaults)\r\n\t\tsubmodel.assertions = [...this.assertions, ...newAssertions]\r\n\r\n\t\tif (getProto(this) !== ObjectModel.prototype) { // extended class\r\n\t\t\tsubmodel.parentClass = this\r\n\t\t}\r\n\r\n\t\treturn submodel\r\n\t},\r\n\r\n\t[_check](obj, path, errors, stack, shouldCast) {\r\n\t\tif (isObject(obj)) {\r\n\t\t\tcheckDefinition(obj[_original] || obj, this.definition, path, errors, stack, shouldCast)\r\n\t\t}\r\n\t\telse stackError(errors, this, obj, path)\r\n\r\n\t\tcheckAssertions(obj, this, path, errors)\r\n\t}\r\n})\r\n\r\nexport const Any = proxify(BasicModel(), {\r\n\tapply(target, ctx, [def]) {\r\n\t\tconst anyOf = Object.create(Any)\r\n\t\tanyOf.definition = def;\r\n\t\treturn anyOf\r\n\t}\r\n})\r\nAny.definition = Any\r\nAny.toString = () => \"Any\"\r\n\r\nAny.remaining = function (def) { this.definition = def }\r\nextend(Any.remaining, Any, {\r\n\ttoString() { return \"...\" + formatDefinition(this.definition) }\r\n})\r\nAny[Symbol.iterator] = function* () { yield new Any.remaining(this.definition) }","\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\nimport { has, isFunction, proxify } from \"./helpers.js\"\n\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\n\n\treturn initModel(def, constructor, base, init, model => Object.assign({\n\t\tgetPrototypeOf: () => model.prototype,\n\t\tget(l, key) {\n\t\t\tif (key === _original) return l\n\n\t\t\tconst val = l[key]\n\t\t\treturn isFunction(val) ? proxify(val, {\n\t\t\t\tapply(fn, ctx, args) {\n\t\t\t\t\tif (has(mutators, key)) {\n\t\t\t\t\t\t// indexes of arguments to check def + cast\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\n\t\t\t\t\t\t\targs[i] = checkDefinition(\n\t\t\t\t\t\t\t\targs[i],\n\t\t\t\t\t\t\t\targDef,\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\n\t\t\t\t\t\t\t\tmodel.errors,\n\t\t\t\t\t\t\t\t[],\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (model.assertions.length > 0) {\n\t\t\t\t\t\t\tconst testingClone = clone(l)\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tunstackErrors(model)\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fn.apply(l, args)\n\t\t\t\t}\n\t\t\t}) : val\n\t\t}\n\t}, otherTraps))\n}","import {\n\t_original, _check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend } from \"./helpers.js\"\n\nexport default function ArrayModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tArray,\n\t\tArrayModel,\n\t\tinitialDefinition,\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\n\t\ta => [...a],\n\t\t{\n\t\t\t\"copyWithin\": [],\n\t\t\t\"fill\": [0, 0],\n\t\t\t\"pop\": [],\n\t\t\t\"push\": [0],\n\t\t\t\"reverse\": [],\n\t\t\t\"shift\": [],\n\t\t\t\"sort\": [],\n\t\t\t\"splice\": [2],\n\t\t\t\"unshift\": [0]\n\t\t},\n\t\t{\n\t\t\tset(arr, key, val) {\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\n\t\t\t},\n\n\t\t\tdeleteProperty(arr, key) {\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\n\t\t\t}\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(ArrayModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](arr, path, errors, stack) {\n\t\tif (Array.isArray(arr))\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\n\t\telse stackError(errors, this, arr, path)\n\n\t\tcheckAssertions(arr, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})\n\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\n\tconst path = `Array[${key}]`\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\n\n\tconst testArray = [...array]\n\tapplyMutation(testArray)\n\tcheckAssertions(testArray, model, path)\n\tconst isSuccess = !unstackErrors(model)\n\tif (isSuccess) applyMutation(array, value)\n\treturn isSuccess\n}","import {\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\n\tformatDefinition, initModel, Model, stackError, unstackErrors\n} from \"./object-model.js\"\nimport { extend, is, isFunction } from \"./helpers.js\"\n\nexport default function FunctionModel(...argsDef) {\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\n\t\tgetPrototypeOf: () => model.prototype,\n\n\t\tget(fn, key) {\n\t\t\treturn key === _original ? fn : fn[key]\n\t\t},\n\n\t\tapply(fn, ctx, args) {\n\t\t\tconst def = model.definition\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\n\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\n\t\t\t}\n\n\t\t\tcheckAssertions(args, model, \"arguments\")\n\n\t\t\tlet result\n\t\t\tif (!model.errors.length) {\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\n\t\t\t\tif (\"return\" in def)\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\n\t\t\t}\n\t\t\tunstackErrors(model)\n\t\t\treturn result\n\t\t}\n\t}))\n}\n\nextend(FunctionModel, Model, {\n\ttoString(stack = []) {\n\t\tlet out = `Function(${this.definition.arguments.map(\n\t\t\targDef => formatDefinition(argDef, [...stack])\n\t\t).join(\", \")})`\n\n\t\tif (\"return\" in this.definition) {\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\n\t\t}\n\t\treturn out\n\t},\n\n\treturn(def) {\n\t\tthis.definition.return = def\n\t\treturn this\n\t},\n\n\textend(newArgs, newReturns) {\n\t\tconst args = this.definition.arguments,\n\t\t\t mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])),\n\t\t\t mixedReturns = extendDefinition(this.definition.return, newReturns)\n\t\treturn extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this)\n\t},\n\n\t[_check](f, path, errors) {\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\n\tconst model = initListModel(\n\t\tMap,\n\t\tMapModel,\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\n\t\tmap => new Map(map),\n\t\t{\n\t\t\t\"set\": [0, 1, getDef],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(MapModel, Model, {\n\ttoString(stack) {\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\n\t},\n\n\t[_check](map, path, errors, stack) {\n\t\tif (is(Map, map)) {\n\t\t\tpath = path || \"Map\"\n\t\t\tfor (let [key, value] of map) {\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, map, path)\n\n\t\tcheckAssertions(map, this, path, errors)\n\t},\n\n\textend(keyParts, valueParts) {\n\t\treturn extendModel(new MapModel(\n\t\t\textendDefinition(this.definition.key, keyParts),\n\t\t\textendDefinition(this.definition.value, valueParts)\n\t\t), this)\n\t}\n})","import {\n\t_check, cast, checkAssertions, checkDefinition,\n\textendDefinition, extendModel, formatDefinition, Model, stackError\n} from \"./object-model.js\"\nimport { initListModel } from \"./list-model.js\"\nimport { extend, is, isIterable } from \"./helpers.js\"\n\nexport default function SetModel(initialDefinition) {\n\tconst model = initListModel(\n\t\tSet,\n\t\tSetModel,\n\t\tinitialDefinition,\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\n\t\tset => new Set(set),\n\t\t{\n\t\t\t\"add\": [0, 0],\n\t\t\t\"delete\": [],\n\t\t\t\"clear\": []\n\t\t}\n\t)\n\n\treturn model\n}\n\nextend(SetModel, Model, {\n\ttoString(stack) {\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\n\t},\n\n\t[_check](set, path, errors, stack) {\n\t\tif (is(Set, set)) {\n\t\t\tfor (let item of set.values()) {\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\n\t\t\t}\n\t\t} else stackError(errors, this, set, path)\n\t\tcheckAssertions(set, this, path, errors)\n\t},\n\n\textend(...newParts) {\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\n\t}\n})"],"names":["ObjectProto","Object","prototype","getProto","getPrototypeOf","setProto","setPrototypeOf","has","o","prop","hasOwnProperty","call","is","Constructor","obj","isFunction","f","isObject","isString","s","isPlainObject","isIterable","x","Symbol","iterator","proxify","val","traps","Proxy","merge","target","src","key","define","value","enumerable","defineProperty","writable","configurable","extend","child","parent","props","assign","create","constructor","_check","_checked","_original","CHECK_ONCE","initModel","def","init","getTraps","useNew","model","default","mode","this","check","definition","assertions","name","initObjectModel","_this","undefined","stackError","errors","parentClass","extendModel","newProps","push","expected","received","path","message","unstackErrors","collector","errorCollector","nbErrors","length","map","err","formatDefinition","toString","match","format","isModelInstance","i","Model","parseDefinition","Array","isArray","stack","parts","d","join","extendDefinition","newParts","concat","filter","index","self","indexOf","checkDefinition","shouldCast","indexFound","cast","formatPath","some","part","checkDefinitionPart","Any","RegExp","test","Number","Date","isNaN","checkAssertions","assertion","result","onFail","description","assertionResult","includes","String","unshift","Map","Set","item","keys","indent","repeat","slice","controlMutation","privateAccess","applyMutation","newPath","isPrivate","conventionForPrivate","isConstant","conventionForConstant","isOwnProperty","initialPropDescriptor","getOwnPropertyDescriptor","cannot","msg","defNode","BasicModel","suitableModels","console","warn","[object Object]","Reflect","get","inDef","defPart","set","fn","ctx","args","apply","getProp","deleteProperty","ownKeys","descriptor","params","ObjectModel","toUpperCase","fns","initialErrorCollector","failed","e","TypeError","replace","proto","defaults","newAssertions","submodel","defaultTo","anyOf","remaining","initListModel","base","clone","mutators","otherTraps","l","begin","end","getArgDef","argDef","testingClone","ArrayModel","initialDefinition","a","arg","copyWithin","fill","pop","reverse","shift","sort","splice","arr","v","forEach","array","canBeExtended","testArray","isSuccess","FunctionModel","argsDef","arguments","Function","remainingArgDef","find","nbArgsToCheck","Math","max","return","MapModel","initialKeyDefinition","initialValueDefinition","getDef","it","pair","delete","clear","SetModel","add","out","newArgs","newReturns","mixedArgs","mixedReturns","keyParts","valueParts","values"],"mappings":"AAAO,MACNA,EAAcC,OAAOC,UAErBC,EAAWF,OAAOG,eAClBC,EAAWJ,OAAOK,eAElBC,EAAM,CAACC,EAAGC,IAAST,EAAYU,eAAeC,KAAKH,EAAGC,GACtDG,EAAK,CAACC,EAAaC,IAAQA,aAAeD,EAC1CE,EAAaC,GAAkB,mBAANA,EACzBC,EAAWT,GAAKA,GAAkB,iBAANA,EAC5BU,EAAWC,GAAkB,iBAANA,EACvBC,EAAgBZ,GAAKS,EAAST,IAAML,EAASK,KAAOR,EACpDqB,EAAaC,GAAKA,GAAKP,EAAWO,EAAEC,OAAOC,WAE3CC,EAAU,CAACC,EAAKC,IAAU,IAAIC,MAAMF,EAAKC,GAEzCE,EAAQ,CAACC,EAAQC,EAAM,MACtB,IAAK,IAAIC,KAAOD,EACf,GAAIX,EAAcW,EAAIC,IAAO,CAC5B,MAAMxB,EAAI,GACVqB,EAAMrB,EAAGsB,EAAOE,IAChBH,EAAMrB,EAAGuB,EAAIC,IACbF,EAAOE,GAAOxB,OAEdsB,EAAOE,GAAOD,EAAIC,GAGpB,OAAOF,GAGRG,EAAS,CAACnB,EAAKkB,EAAKE,EAAOC,GAAa,KACvClC,OAAOmC,eAAetB,EAAKkB,EAAK,CAAEE,MAAAA,EAAOC,WAAAA,EAAYE,UAAU,EAAMC,cAAc,KAGpFC,EAAS,CAACC,EAAOC,EAAQC,KACxBF,EAAMtC,UAAYD,OAAO0C,OAAO1C,OAAO2C,OAAOH,EAAOvC,UAAW,CAC/D2C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GAAQ,cAAeP,EAAQ0B,QAEpE3B,EAAWC,EAAQT,KAAMmG,EAAKnF,GACrC4C,EAAgBuC,EAAKnG,KAAMgB,EAAMP,IAGlCqF,UAAUtD,GACT,OAAO7B,EAAY,IAAIgK,EAASpI,EAAiBvC,KAAKE,WAAYsC,IAAYxC"} \ No newline at end of file diff --git a/index.html b/index.html index 5dd6c89..bb339c2 100644 --- a/index.html +++ b/index.html @@ -148,7 +148,7 @@

What's inside the box ?

  • Constants and private properties based on name conventions
  • Explicit error messages
  • Customizable error handlers
  • -
  • all in 3.99 KB minified and gzipped, +
  • all in 4.02 KB minified and gzipped, even less when using tree-shaking
  • @@ -156,7 +156,7 @@

    What's inside the box ?

    Download

    -

    Current version: v4.2.3

    +

    Current version: v4.3.0

    diff --git a/package-lock.json b/package-lock.json index e5ff353..240c938 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,22 +1,22 @@ { "name": "objectmodel", - "version": "4.2.2", + "version": "4.2.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "objectmodel", - "version": "4.2.2", + "version": "4.2.3", "license": "MIT", "devDependencies": { "cjyes": "^0.3.1", - "eslint": "^7.18.0", + "eslint": "^7.28.0", "esm": "^3.2.25", - "filesize": "^6.1.0", + "filesize": "^6.3.0", "gzip-size": "^6.0.0", "npm-run-all": "^4.1.5", - "qunit": "^2.14.0", - "rollup": "^2.36.2", + "qunit": "^2.16.0", + "rollup": "^2.51.2", "rollup-plugin-terser": "^7.0.2" } }, @@ -47,19 +47,18 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", - "lodash": "^4.17.20", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" }, @@ -205,7 +204,10 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "dev": true, + "engines": { + "node": ">=6" + } }, "node_modules/chalk": { "version": "2.4.1", @@ -244,12 +246,12 @@ "dev": true }, "node_modules/commander": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", - "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", + "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 10" } }, "node_modules/concat-map": { @@ -272,12 +274,20 @@ } }, "node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/deep-is": { @@ -375,29 +385,31 @@ "dev": true }, "node_modules/eslint": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", - "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.3.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.1", - "esquery": "^1.2.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^6.0.0", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -405,7 +417,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -414,7 +426,7 @@ "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -517,6 +529,18 @@ "which": "^2.0.1" } }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -604,21 +628,31 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } }, "node_modules/esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "dependencies": { "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/esquery/node_modules/estraverse": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", - "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true, "engines": { "node": ">=4.0" @@ -679,9 +713,9 @@ "dev": true }, "node_modules/file-entry-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", - "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { "flat-cache": "^3.0.4" @@ -691,10 +725,13 @@ } }, "node_modules/filesize": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", - "integrity": "sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg==", - "dev": true + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.3.0.tgz", + "integrity": "sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } }, "node_modules/flat-cache": { "version": "3.0.4", @@ -710,9 +747,9 @@ } }, "node_modules/flatted": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", - "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, "node_modules/foreach": { @@ -728,10 +765,11 @@ "dev": true }, "node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -753,9 +791,9 @@ "dev": true }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -773,21 +811,30 @@ } }, "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" } }, "node_modules/globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "dependencies": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalyzer": { @@ -848,16 +895,25 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true + "dev": true, + "engines": { + "node": ">= 4" + } }, "node_modules/import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/imurmurhash": { @@ -904,7 +960,10 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", @@ -922,6 +981,9 @@ "dev": true, "dependencies": { "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/is-regex": { @@ -980,12 +1042,6 @@ "node": ">=8" } }, - "node_modules/js-reporters": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-1.2.3.tgz", - "integrity": "sha512-2YzWkHbbRu6LueEs5ZP3P1LqbECvAeUJYrjw3H4y1ofW06hqCS0AbzBtLwbr+Hke51bt9CUepJ/Fj1hlCRIF6A==", - "dev": true - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -993,13 +1049,16 @@ "dev": true }, "node_modules/js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, "node_modules/json-parse-better-errors": { @@ -1048,10 +1107,22 @@ "strip-bom": "^3.0.0" } }, - "node_modules/lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, "node_modules/magic-string": { @@ -1185,6 +1256,9 @@ "dev": true, "dependencies": { "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, "node_modules/parse-json": { @@ -1261,13 +1335,12 @@ } }, "node_modules/qunit": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.14.0.tgz", - "integrity": "sha512-CYfenbgdpmhl2Ql2rDrrj0felY4h8k6lYhtWwGBCLL4qQC33YOj0psV8MWo85L1i0SIOmEDRXkFopWnGCLmf7g==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.16.0.tgz", + "integrity": "sha512-88x9t+rRMbB6IrCIUZvYU4pJy7NiBEv7SX8jD4LZAsIj+dV+kwGnFStOmPNvqa6HM96VZMD8CIIFKH2+3qvluA==", "dev": true, "dependencies": { - "commander": "6.2.0", - "js-reporters": "1.2.3", + "commander": "7.1.0", "node-watch": "0.7.1", "tiny-glob": "0.2.8" }, @@ -1317,7 +1390,10 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "dev": true, + "engines": { + "node": ">=4" + } }, "node_modules/rimraf": { "version": "3.0.2", @@ -1335,13 +1411,10 @@ } }, "node_modules/rollup": { - "version": "2.36.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.2.tgz", - "integrity": "sha512-qjjiuJKb+/8n0EZyQYVW+gFU4bNRBcZaXVzUgSVrGw0HlQBlK2aWyaOMMs1Ufic1jV69b9kW3u3i9B+hISDm3A==", + "version": "2.51.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.51.2.tgz", + "integrity": "sha512-ReV2eGEadA7hmXSzjxdDKs10neqH2QURf2RxJ6ayAlq93ugy6qIvXMmbc5cWMGCDh1h5T4thuWO1e2VNbMq8FA==", "dev": true, - "dependencies": { - "fsevents": "~2.1.2" - }, "bin": { "rollup": "dist/bin/rollup" }, @@ -1349,7 +1422,7 @@ "node": ">=10.0.0" }, "optionalDependencies": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" } }, "node_modules/rollup-plugin-terser": { @@ -1546,9 +1619,9 @@ "dev": true }, "node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", @@ -1610,24 +1683,26 @@ } }, "node_modules/table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", "dev": true, "dependencies": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10.0.0" } }, "node_modules/table/node_modules/ajv": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", - "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", @@ -1695,10 +1770,16 @@ } }, "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/uri-js": { "version": "4.4.1", @@ -1775,19 +1856,18 @@ } }, "@eslint/eslintrc": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", - "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", - "lodash": "^4.17.20", "minimatch": "^3.0.4", "strip-json-comments": "^3.1.1" } @@ -1948,9 +2028,9 @@ "dev": true }, "commander": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", - "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", + "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==", "dev": true }, "concat-map": { @@ -1973,12 +2053,12 @@ } }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "deep-is": { @@ -2073,29 +2153,31 @@ "dev": true }, "eslint": { - "version": "7.18.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", - "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.28.0.tgz", + "integrity": "sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.3.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.1", - "esquery": "^1.2.0", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^6.0.0", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -2103,7 +2185,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -2112,7 +2194,7 @@ "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, @@ -2157,6 +2239,12 @@ "which": "^2.0.1" } }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2275,18 +2363,18 @@ "dev": true }, "esquery": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", - "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true } } @@ -2339,18 +2427,18 @@ "dev": true }, "file-entry-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", - "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { "flat-cache": "^3.0.4" } }, "filesize": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz", - "integrity": "sha512-LpCHtPQ3sFx67z+uh2HnSyWSLLu5Jxo21795uRDuar/EOuYWXib5EmPaGIBuSnRqH2IODiKA2k5re/K9OnN/Yg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.3.0.tgz", + "integrity": "sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==", "dev": true }, "flat-cache": { @@ -2364,9 +2452,9 @@ } }, "flatted": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.0.tgz", - "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, "foreach": { @@ -2382,9 +2470,9 @@ "dev": true }, "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", "dev": true, "optional": true }, @@ -2401,9 +2489,9 @@ "dev": true }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2415,21 +2503,21 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" } }, "globalyzer": { @@ -2487,9 +2575,9 @@ "dev": true }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -2606,12 +2694,6 @@ } } }, - "js-reporters": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/js-reporters/-/js-reporters-1.2.3.tgz", - "integrity": "sha512-2YzWkHbbRu6LueEs5ZP3P1LqbECvAeUJYrjw3H4y1ofW06hqCS0AbzBtLwbr+Hke51bt9CUepJ/Fj1hlCRIF6A==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2619,9 +2701,9 @@ "dev": true }, "js-yaml": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -2674,10 +2756,22 @@ "strip-bom": "^3.0.0" } }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, "magic-string": { @@ -2880,13 +2974,12 @@ "dev": true }, "qunit": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.14.0.tgz", - "integrity": "sha512-CYfenbgdpmhl2Ql2rDrrj0felY4h8k6lYhtWwGBCLL4qQC33YOj0psV8MWo85L1i0SIOmEDRXkFopWnGCLmf7g==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/qunit/-/qunit-2.16.0.tgz", + "integrity": "sha512-88x9t+rRMbB6IrCIUZvYU4pJy7NiBEv7SX8jD4LZAsIj+dV+kwGnFStOmPNvqa6HM96VZMD8CIIFKH2+3qvluA==", "dev": true, "requires": { - "commander": "6.2.0", - "js-reporters": "1.2.3", + "commander": "7.1.0", "node-watch": "0.7.1", "tiny-glob": "0.2.8" } @@ -2939,12 +3032,12 @@ } }, "rollup": { - "version": "2.36.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.36.2.tgz", - "integrity": "sha512-qjjiuJKb+/8n0EZyQYVW+gFU4bNRBcZaXVzUgSVrGw0HlQBlK2aWyaOMMs1Ufic1jV69b9kW3u3i9B+hISDm3A==", + "version": "2.51.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.51.2.tgz", + "integrity": "sha512-ReV2eGEadA7hmXSzjxdDKs10neqH2QURf2RxJ6ayAlq93ugy6qIvXMmbc5cWMGCDh1h5T4thuWO1e2VNbMq8FA==", "dev": true, "requires": { - "fsevents": "~2.1.2" + "fsevents": "~2.3.1" } }, "rollup-plugin-terser": { @@ -3107,9 +3200,9 @@ "dev": true }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -3159,21 +3252,23 @@ } }, "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", "dev": true, "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "dependencies": { "ajv": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", - "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -3235,9 +3330,9 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "uri-js": { diff --git a/package.json b/package.json index 4841d4d..eb74673 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "objectmodel", - "version": "4.2.3", + "version": "4.3.0", "description": "Strong Dynamically Typed Object Modeling for JavaScript", "author": "Sylvain Pollet-Villard", "license": "MIT", @@ -25,13 +25,13 @@ }, "devDependencies": { "cjyes": "^0.3.1", - "eslint": "^7.18.0", + "eslint": "^7.28.0", "esm": "^3.2.25", - "filesize": "^6.1.0", + "filesize": "^6.3.0", "gzip-size": "^6.0.0", "npm-run-all": "^4.1.5", - "qunit": "^2.14.0", - "rollup": "^2.36.2", + "qunit": "^2.16.0", + "rollup": "^2.51.2", "rollup-plugin-terser": "^7.0.2" }, "type": "module",