From b52aa61f0e7c87db78cfda7ccf89054f155df300 Mon Sep 17 00:00:00 2001 From: Sylvain Pollet-Villard Date: Mon, 31 Oct 2022 19:31:01 +0100 Subject: [PATCH] v4.4.0 --- dist/object-model.cjs | 9 +-------- dist/object-model.js | 9 +-------- dist/object-model.js.map | 2 +- dist/object-model.min.js | 4 ++-- dist/object-model.min.js.map | 2 +- index.html | 8 ++++---- package.json | 2 +- 7 files changed, 11 insertions(+), 25 deletions(-) diff --git a/dist/object-model.cjs b/dist/object-model.cjs index 0de0929..74c0ba3 100644 --- a/dist/object-model.cjs +++ b/dist/object-model.cjs @@ -1,4 +1,4 @@ -// ObjectModel v4.3.1 - http://objectmodel.js.org +// ObjectModel v4.4.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard const ObjectProto = Object.prototype, @@ -752,13 +752,6 @@ extend(FunctionModel, Model, { return this }, - extend(newArgs, newReturns) { - const args = this.definition.arguments, - mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])), - mixedReturns = extendDefinition(this.definition.return, newReturns); - return extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this) - }, - [_check](f, path, errors) { if (!isFunction(f)) stackError(errors, "Function", f, path); } diff --git a/dist/object-model.js b/dist/object-model.js index 6d97051..eb53baf 100644 --- a/dist/object-model.js +++ b/dist/object-model.js @@ -1,4 +1,4 @@ -// ObjectModel v4.3.1 - http://objectmodel.js.org +// ObjectModel v4.4.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard const ObjectProto = Object.prototype, @@ -752,13 +752,6 @@ extend(FunctionModel, Model, { return this }, - extend(newArgs, newReturns) { - const args = this.definition.arguments, - mixedArgs = newArgs.map((a, i) => extendDefinition(i in args ? args[i] : [], newArgs[i])), - mixedReturns = extendDefinition(this.definition.return, newReturns); - return extendModel(new FunctionModel(...mixedArgs).return(mixedReturns), this) - }, - [_check](f, path, errors) { if (!isFunction(f)) stackError(errors, "Function", f, path); } diff --git a/dist/object-model.js.map b/dist/object-model.js.map index 66e9543..d39d1f1 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 {\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\t// short circuit validation if not receiving an object as expected\r\n\t\t\treturn 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) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def) : 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,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C;AACjC;AACA,KAAK,IAAI,CAAC,UAAU,EAAE;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,WAAU;AAC/B,MAAM,MAAM,IAAI,SAAS,EAAE;AAC3B,MAAM,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,QAAO;AAClE,MAAM,MAAM,IAAI,UAAU,EAAE;AAC5B,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,EAAE,MAAM,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\r\n\tObjectProto = Object.prototype,\r\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\r\n\tgetProto = Object.getPrototypeOf,\r\n\tsetProto = Object.setPrototypeOf,\r\n\r\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\r\n\tis = (Constructor, obj) => obj instanceof Constructor,\r\n\tisFunction = f => typeof f === \"function\",\r\n\tisObject = o => o && typeof o === \"object\",\r\n\tisString = s => typeof s === \"string\",\r\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\r\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\r\n\r\n\tproxify = (val, traps) => new Proxy(val, traps),\r\n\r\n\tmerge = (target, src = {}) => {\r\n\t\tfor (let key in src) {\r\n\t\t\tif (isPlainObject(src[key])) {\r\n\t\t\t\tconst o = {}\r\n\t\t\t\tmerge(o, target[key])\r\n\t\t\t\tmerge(o, src[key])\r\n\t\t\t\ttarget[key] = o\r\n\t\t\t} else {\r\n\t\t\t\ttarget[key] = src[key]\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target\r\n\t},\r\n\r\n\tdefine = (obj, key, value, enumerable = false) => {\r\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\r\n\t},\r\n\r\n\textend = (child, parent, props) => {\r\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\r\n\t\t\tconstructor: {\r\n\t\t\t\tvalue: child,\r\n\t\t\t\twritable: true,\r\n\t\t\t\tconfigurable: true\r\n\t\t\t}\r\n\t\t}), props)\r\n\t\tsetProto(child, parent)\r\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\t// short circuit validation if not receiving an object as expected\r\n\t\t\treturn 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) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def) : 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) }","\r\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\r\nimport { has, isFunction, proxify } from \"./helpers.js\"\r\n\r\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\r\n\r\n\treturn initModel(def, constructor, base, init, model => Object.assign({\r\n\t\tgetPrototypeOf: () => model.prototype,\r\n\t\tget(l, key) {\r\n\t\t\tif (key === _original) return l\r\n\r\n\t\t\tconst val = l[key]\r\n\t\t\treturn isFunction(val) ? proxify(val, {\r\n\t\t\t\tapply(fn, ctx, args) {\r\n\t\t\t\t\tif (has(mutators, key)) {\r\n\t\t\t\t\t\t// indexes of arguments to check def + cast\r\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\r\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\r\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\r\n\t\t\t\t\t\t\targs[i] = checkDefinition(\r\n\t\t\t\t\t\t\t\targs[i],\r\n\t\t\t\t\t\t\t\targDef,\r\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\r\n\t\t\t\t\t\t\t\tmodel.errors,\r\n\t\t\t\t\t\t\t\t[],\r\n\t\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (model.assertions.length > 0) {\r\n\t\t\t\t\t\t\tconst testingClone = clone(l)\r\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\r\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tunstackErrors(model)\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn fn.apply(l, args)\r\n\t\t\t\t}\r\n\t\t\t}) : val\r\n\t\t}\r\n\t}, otherTraps))\r\n}","import {\r\n\t_original, _check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend } from \"./helpers.js\"\r\n\r\nexport default function ArrayModel(initialDefinition) {\r\n\tconst model = initListModel(\r\n\t\tArray,\r\n\t\tArrayModel,\r\n\t\tinitialDefinition,\r\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\r\n\t\ta => [...a],\r\n\t\t{\r\n\t\t\t\"copyWithin\": [],\r\n\t\t\t\"fill\": [0, 0],\r\n\t\t\t\"pop\": [],\r\n\t\t\t\"push\": [0],\r\n\t\t\t\"reverse\": [],\r\n\t\t\t\"shift\": [],\r\n\t\t\t\"sort\": [],\r\n\t\t\t\"splice\": [2],\r\n\t\t\t\"unshift\": [0]\r\n\t\t},\r\n\t\t{\r\n\t\t\tset(arr, key, val) {\r\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\r\n\t\t\t},\r\n\r\n\t\t\tdeleteProperty(arr, key) {\r\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\r\n\t\t\t}\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(ArrayModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\r\n\t},\r\n\r\n\t[_check](arr, path, errors, stack) {\r\n\t\tif (Array.isArray(arr))\r\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\r\n\t\telse stackError(errors, this, arr, path)\r\n\r\n\t\tcheckAssertions(arr, this, path, errors)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\r\n\t}\r\n})\r\n\r\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\r\n\tconst path = `Array[${key}]`\r\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\r\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\r\n\r\n\tconst testArray = [...array]\r\n\tapplyMutation(testArray)\r\n\tcheckAssertions(testArray, model, path)\r\n\tconst isSuccess = !unstackErrors(model)\r\n\tif (isSuccess) applyMutation(array, value)\r\n\treturn isSuccess\r\n}","import {\r\n\t_check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, formatDefinition, Model, stackError\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend, is, isIterable } from \"./helpers.js\"\r\n\r\nexport default function SetModel(initialDefinition) {\r\n\tconst model = initListModel(\r\n\t\tSet,\r\n\t\tSetModel,\r\n\t\tinitialDefinition,\r\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\r\n\t\tset => new Set(set),\r\n\t\t{\r\n\t\t\t\"add\": [0, 0],\r\n\t\t\t\"delete\": [],\r\n\t\t\t\"clear\": []\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(SetModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\r\n\t},\r\n\r\n\t[_check](set, path, errors, stack) {\r\n\t\tif (is(Set, set)) {\r\n\t\t\tfor (let item of set.values()) {\r\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\r\n\t\t\t}\r\n\t\t} else stackError(errors, this, set, path)\r\n\t\tcheckAssertions(set, this, path, errors)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\r\n\t}\r\n})","import {\r\n\t_check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend, is, isIterable } from \"./helpers.js\"\r\n\r\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\r\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\r\n\tconst model = initListModel(\r\n\t\tMap,\r\n\t\tMapModel,\r\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\r\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\r\n\t\tmap => new Map(map),\r\n\t\t{\r\n\t\t\t\"set\": [0, 1, getDef],\r\n\t\t\t\"delete\": [],\r\n\t\t\t\"clear\": []\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(MapModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\r\n\t},\r\n\r\n\t[_check](map, path, errors, stack) {\r\n\t\tif (is(Map, map)) {\r\n\t\t\tpath = path || \"Map\"\r\n\t\t\tfor (let [key, value] of map) {\r\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\r\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\r\n\t\t\t}\r\n\t\t} else stackError(errors, this, map, path)\r\n\r\n\t\tcheckAssertions(map, this, path, errors)\r\n\t},\r\n\r\n\textend(keyParts, valueParts) {\r\n\t\treturn extendModel(new MapModel(\r\n\t\t\textendDefinition(this.definition.key, keyParts),\r\n\t\t\textendDefinition(this.definition.value, valueParts)\r\n\t\t), this)\r\n\t}\r\n})","import {\r\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\r\n\tformatDefinition, initModel, Model, stackError, unstackErrors\r\n} from \"./object-model.js\"\r\nimport { extend, is, isFunction } from \"./helpers.js\"\r\n\r\nexport default function FunctionModel(...argsDef) {\r\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\r\n\t\tgetPrototypeOf: () => model.prototype,\r\n\r\n\t\tget(fn, key) {\r\n\t\t\treturn key === _original ? fn : fn[key]\r\n\t\t},\r\n\r\n\t\tapply(fn, ctx, args) {\r\n\t\t\tconst def = model.definition\r\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\r\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\r\n\r\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\r\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\r\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\r\n\t\t\t}\r\n\r\n\t\t\tcheckAssertions(args, model, \"arguments\")\r\n\r\n\t\t\tlet result\r\n\t\t\tif (!model.errors.length) {\r\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\r\n\t\t\t\tif (\"return\" in def)\r\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\r\n\t\t\t}\r\n\t\t\tunstackErrors(model)\r\n\t\t\treturn result\r\n\t\t}\r\n\t}))\r\n}\r\n\r\nextend(FunctionModel, Model, {\r\n\ttoString(stack = []) {\r\n\t\tlet out = `Function(${this.definition.arguments.map(\r\n\t\t\targDef => formatDefinition(argDef, [...stack])\r\n\t\t).join(\", \")})`\r\n\r\n\t\tif (\"return\" in this.definition) {\r\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\r\n\t\t}\r\n\t\treturn out\r\n\t},\r\n\r\n\treturn(def) {\r\n\t\tthis.definition.return = def\r\n\t\treturn this\r\n\t},\r\n\r\n\t[_check](f, path, errors) {\r\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\r\n\t}\r\n})","import { _original, Model, Any, BasicModel, ObjectModel } from \"./object-model.js\"\r\nimport ArrayModel from \"./array-model.js\"\r\nimport SetModel from \"./set-model.js\"\r\nimport MapModel from \"./map-model.js\"\r\nimport FunctionModel from \"./function-model.js\"\r\nimport { getProto, has, is, isFunction, isPlainObject } from \"./helpers.js\"\r\n\r\nconst styles = {\r\n\tlist: \"list-style-type: none; padding: 0; margin: 0;\",\r\n\tlistItem: \"padding: 0 0 0 1em;\",\r\n\tmodel: \"color: #3e999f;\",\r\n\tinstance: \"color: #718c00; font-style: italic\",\r\n\tfunction: \"color: #4271AE\",\r\n\tstring: \"color: #C41A16\",\r\n\tnumber: \"color: #1C00CF\",\r\n\tboolean: \"color: #AA0D91\",\r\n\tproperty: \"color: #8959a8\",\r\n\tprivate: \"color: #C19ED8\",\r\n\tconstant: \"color: #8959a8; font-weight: bold\",\r\n\tprivateConstant: \"color: #C19ED8; font-weight: bold\",\r\n\tnull: \"color: #8e908c\",\r\n\tundeclared: \"color: #C0C0C0;\",\r\n\tproto: \"color: #B871BD; font-style: italic\"\r\n};\r\n\r\nconst getModel = (instance) => {\r\n\tif (instance === undefined || instance === null)\r\n\t\treturn null\r\n\r\n\tconst proto = getProto(instance);\r\n\tif (!proto || !proto.constructor || !is(Model, proto.constructor))\r\n\t\treturn null\r\n\r\n\treturn proto.constructor\r\n}\r\n\r\nconst span = (style, ...children) => [\"span\", { style }, ...children]\r\n\r\nconst format = (x, config = {}) => {\r\n\tif (x === null || x === undefined)\r\n\t\treturn span(styles.null, \"\" + x);\r\n\r\n\tif (typeof x === \"boolean\")\r\n\t\treturn span(styles.boolean, x);\r\n\r\n\tif (typeof x === \"number\")\r\n\t\treturn span(styles.number, x);\r\n\r\n\tif (typeof x === \"string\")\r\n\t\treturn span(styles.string, `\"${x}\"`);\r\n\r\n\tif (Array.isArray(x) && config.isModelDefinition) {\r\n\t\treturn span(\"\", ...x.flatMap(part => [format(part, config), \" or \"]).slice(0, -1))\r\n\t}\r\n\r\n\tif (isPlainObject(x))\r\n\t\treturn formatObject(x, getModel(x), config)\r\n\r\n\tif (isFunction(x) && !is(Model, x) && config.isModelDefinition)\r\n\t\treturn span(styles.function, x.name || x.toString());\r\n\r\n\treturn [\"object\", { object: x, config }]\r\n}\r\n\r\nconst formatObject = (o, model, config) => span(\"\",\r\n\t\"{\",\r\n\t[\"ol\", { style: styles.list }, ...Object.keys(o).map(prop =>\r\n\t\t[\"li\", { style: styles.listItem }, span(styles.property, prop), \": \", format(o[prop], config)])\r\n\t],\r\n\t\"}\"\r\n)\r\n\r\nconst formatModel = model => {\r\n\tconst\r\n\t\tcfg = { isModelDefinition: true },\r\n\t\tdef = model.definition,\r\n\t\tformatList = (list, map) => list.flatMap(e => [map(e), \", \"]).slice(0, -1);\r\n\tlet parts = []\r\n\r\n\tif (is(BasicModel, model)) parts = [format(def, cfg)]\r\n\tif (is(ArrayModel, model)) parts = [\"Array of \", format(def, cfg)]\r\n\tif (is(SetModel, model)) parts = [\"Set of \", format(def, cfg)]\r\n\tif (is(MapModel, model)) parts = [\"Map of \", format(def.key, cfg), \" : \", format(def.value, cfg)]\r\n\tif (is(FunctionModel, model)) {\r\n\t\tparts = [\"Function(\", ...formatList(def.arguments, arg => format(arg, cfg)), \")\"]\r\n\t\tif (\"return\" in def) parts.push(\" => \", format(def.return, cfg))\r\n\t}\r\n\r\n\tif (model.assertions.length > 0) {\r\n\t\tparts.push(\"\\n(assertions: \", ...formatList(model.assertions, f => [\"object\", { object: f }]), \")\")\r\n\t}\r\n\r\n\treturn span(styles.model, ...parts)\r\n}\r\n\r\nconst ModelFormatter = {\r\n\theader(x, config = {}) {\r\n\t\tif (x === Any)\r\n\t\t\treturn span(styles.model, \"Any\")\r\n\r\n\t\tif (is(Any.remaining, x))\r\n\t\t\treturn span(styles.model, \"...\", format(x.definition, { isModelDefinition: true }))\r\n\r\n\t\tif (is(ObjectModel, x))\r\n\t\t\treturn span(styles.model, x.name)\r\n\r\n\t\tif (is(Model, x)) {\r\n\t\t\treturn formatModel(x)\r\n\t\t}\r\n\r\n\t\tif (config.isModelDefinition && isPlainObject(x))\r\n\t\t\treturn format(x, config)\r\n\r\n\t\treturn null;\r\n\t},\r\n\thasBody(x) {\r\n\t\treturn is(ObjectModel, x)\r\n\t},\r\n\tbody(model) {\r\n\t\treturn span(\"\",\r\n\t\t\t\"{\",\r\n\t\t\t[\"ol\", { style: styles.list }, ...Object.keys(model.definition).map(prop => {\r\n\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\r\n\t\t\t\tconst isConstant = model.conventionForConstant(prop)\r\n\t\t\t\tconst hasDefault = model.default && has(model.default, prop);\r\n\t\t\t\tlet style = styles.property;\r\n\r\n\t\t\t\tif (isPrivate) {\r\n\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\r\n\t\t\t\t} else if (isConstant) {\r\n\t\t\t\t\tstyle = styles.constant\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn [\"li\", { style: styles.listItem },\r\n\t\t\t\t\tspan(style, prop), \": \", format(model.definition[prop], { isModelDefinition: true }),\r\n\t\t\t\t\thasDefault ? span(styles.proto, \" = \", format(model.default[prop])) : \"\"\r\n\t\t\t\t]\r\n\t\t\t})],\r\n\t\t\t\"}\"\r\n\t\t)\r\n\t}\r\n}\r\n\r\nconst ModelInstanceFormatter = {\r\n\theader(x, config = {}) {\r\n\t\tif (config.isInstanceProperty && isPlainObject(x)) {\r\n\t\t\treturn format(x, config)\r\n\t\t}\r\n\r\n\t\tconst model = getModel(x);\r\n\t\tif (is(Model, model)) {\r\n\t\t\tconst parts = is(ObjectModel, model) ? [model.name] : [[\"object\", { object: x[_original] }], ` (${model.name})`];\r\n\t\t\treturn span(styles.instance, ...parts)\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\thasBody(x) {\r\n\t\treturn x && is(ObjectModel, getModel(x))\r\n\t},\r\n\tbody(x) {\r\n\t\tconst model = getModel(x)\r\n\t\tconst o = x[_original] || x;\r\n\t\treturn span(\"\",\r\n\t\t\t\"{\",\r\n\t\t\t[\r\n\t\t\t\t\"ol\",\r\n\t\t\t\t{ style: styles.list },\r\n\t\t\t\t...Object.keys(o).map(prop => {\r\n\t\t\t\t\tconst isPrivate = model.conventionForPrivate(prop)\r\n\t\t\t\t\tconst isConstant = model.conventionForConstant(prop)\r\n\t\t\t\t\tconst isDeclared = prop in model.definition;\r\n\t\t\t\t\tlet style = styles.property;\r\n\r\n\t\t\t\t\tif (!isDeclared) {\r\n\t\t\t\t\t\tstyle = styles.undeclared\r\n\t\t\t\t\t} else if (isPrivate) {\r\n\t\t\t\t\t\tstyle = isConstant ? styles.privateConstant : styles.private\r\n\t\t\t\t\t} else if (isConstant) {\r\n\t\t\t\t\t\tstyle = styles.constant\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn [\"li\", { style: styles.listItem },\r\n\t\t\t\t\t\tspan(style, prop), \": \", format(o[prop], { isInstanceProperty: true })\r\n\t\t\t\t\t]\r\n\t\t\t\t}),\r\n\t\t\t\t[\"li\", { style: styles.listItem },\r\n\t\t\t\t\tspan(styles.proto, \"__proto__\", \": \", [\"object\", { object: getProto(x) }])\r\n\t\t\t\t]\r\n\t\t\t],\r\n\t\t\t\"}\"\r\n\t\t)\r\n\t}\r\n}\r\n\r\nif (typeof window !== \"undefined\") {\r\n\twindow.devtoolsFormatters = (window.devtoolsFormatters || [])\r\n\t\t.concat(ModelFormatter, ModelInstanceFormatter);\r\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,GAA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AsB,CAAC,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/dist/object-model.min.js b/dist/object-model.min.js index e4cbb19..d67e0f5 100644 --- a/dist/object-model.min.js +++ b/dist/object-model.min.js @@ -1,4 +1,4 @@ -// ObjectModel v4.3.1 - http://objectmodel.js.org +// ObjectModel v4.4.0 - http://objectmodel.js.org // MIT License - Sylvain Pollet-Villard -const t=Object.prototype,e=Object.getPrototypeOf,n=Object.setPrototypeOf,r=(e,n)=>t.hasOwnProperty.call(e,n),i=(t,e)=>e instanceof t,o=t=>"function"==typeof t,s=t=>t&&"object"==typeof t,a=t=>"string"==typeof t,l=n=>s(n)&&e(n)===t,c=t=>t&&o(t[Symbol.iterator]),u=(t,e)=>new Proxy(t,e),f=(t,e={})=>{for(let n in e)if(l(e[n])){const r={};f(r,t[n]),f(r,e[n]),t[n]=r}else t[n]=e[n];return t},p=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{value:n,enumerable:r,writable:!0,configurable:!0})},h=(t,e,r)=>{t.prototype=Object.assign(Object.create(e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r),n(t,e)},d=Symbol(),g=Symbol(),y=Symbol(),m=Symbol(),v=(t,e,r,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 r&&h(l,r),n(l,e.prototype),l.constructor=e,l.definition=t,l.assertions=[...l.assertions],p(l,"errors",[]),delete l.name,l},b=(t,e,n)=>i(e,t)?t:s(t)||o(t)||void 0===t?(f(n,e.default),e.parentClass&&f(t,new e.parentClass(t)),f(n,t),n):t,$=(t,e,n)=>(h(t,e,n),t.assertions.push(...e.assertions),t),S=(t,e,n,r,i)=>{t.push({expected:e,received:n,path:r,message:i})},w=(e,n=e.errorCollector)=>{const r=e.errors.length;if(r>0){const r=e.errors.map((e=>{var n;return e.message||(e.message="expecting "+(e.path?e.path+" to be ":"")+P(e.expected)+", got "+(null!=e.received?(n=e.received,t.toString.call(n).match(/\s([a-zA-Z]+)/)[1]+" "):"")+k(e.received)),e}));e.errors.length=0,n.call(e,r)}return r},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 n=j(t).map((t=>k(t,e)));return n.length>1?n.join(" or "):n[0]},A=(t,e=[])=>(e.length>0&&(t=[].concat(t,...[].concat(e)).filter(((t,e,n)=>n.indexOf(t)===e))),t),x=(t,e)=>(t[d](e,null,t.errors,[],!0),!w(t)),C=(t,e,n,r,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,n,r,o.concat(e));else if(l(e))for(let i in e){const a=t?t[i]:void 0;C(a,e[i],M(n,i),r,o,s)}else{if(j(e).some((e=>R(t,e,n,o))))return s?N(t,e):t;S(r,e,t,n)}return t},R=(t,e,n,r,s)=>{if(e===H)return!0;if(null==t)return t===e;if(l(e)||i(K,e)){const i=[];return C(t,e,n,i,r,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,n,r=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 ${n?n+" =":"value"} ${k(e)}`;S(r,i,t,n,a.call(e,s,t,n))}}},k=(e,n=[])=>{if(n.length>15||n.includes(e))return"...";if(null==e)return String(e);if(a(e))return`"${e}"`;if(i(K,e))return e.toString(n);if(n.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,n))).join(", ")}]`;if(e.toString&&e.toString!==t.toString)return e.toString();if(s(e)){const t=Object.keys(e),r="\t".repeat(n.length);return`{${t.map((t=>`\n${r+t}: ${k(e[t],[...n])}`)).join(", ")} ${t.length?`\n${r.slice(1)}`:""}}`}return String(e)},M=(t,e)=>t?t+"."+e:e,E=(t,e,n,i,o,s,a)=>{const l=M(n,o),c=t.conventionForPrivate(o),u=t.conventionForConstant(o),f=r(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(),r(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 n=j(e),r=[];for(let e of n)i(K,e)&&!i(_,e)&&e.test(t)&&r.push(e);return 1===r.length?new r[0](t,g):(r.length>1&&console.warn(`Ambiguous model for value ${k(t)}, could be ${r.join(" or ")}`),t)},T=(t,e,n,i)=>({get(s,c){if(c===y)return s;if(!a(c))return Reflect.get(s,c);const f=M(n,c),p=r(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&&r(s,c)&&!l(h)&&!O(d)&&Reflect.set(s,c,d=N(d,h)),o(d)&&"constructor"!==c&&!i?u(d,{apply(t,e,n){i=!0;const r=Reflect.apply(t,e,n);return i=!1,r}}):(l(h)&&!d&&(s[c]=d={}),((t,e,n,r,i)=>l(n)?u(t,T(e,n,r,i)):N(t,n))(d,t,h,f,i))},set:(r,o,s)=>E(t,e,n,r,o,i,(()=>Reflect.set(r,o,N(s,e[o])))),deleteProperty:(r,o)=>E(t,e,n,r,o,i,(()=>Reflect.deleteProperty(r,o))),defineProperty:(r,o,s)=>E(t,e,n,r,o,i,(()=>Reflect.defineProperty(r,o,s))),has:(n,r)=>Reflect.has(n,r)&&Reflect.has(e,r)&&!t.conventionForPrivate(r),ownKeys:n=>Reflect.ownKeys(n).filter((n=>Reflect.has(e,n)&&!t.conventionForPrivate(n))),getOwnPropertyDescriptor(n,r){let i;return t.conventionForPrivate(r)||(i=Object.getOwnPropertyDescriptor(e,r),void 0!==i&&(i.value=n[r])),i}});function K(t){return l(t)?new z(t):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 r(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,n,r){C(t,this.definition,e,n,r),F(t,this,e,n)},test(t,n){let i=this;for(;!r(i,"errorCollector");)i=e(i);const o=i.errorCollector;let s;return i.errorCollector=t=>{s=!0,n&&n.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 n of t)i(_,n)&&e.assertions.push(...n.assertions);return e}}),h(z,K,{defaultTo(t){const e=this.definition;for(let n in t)r(e,n)&&(t[n]=C(t[n],e[n],n,this.errors,[],!0));return w(this),this.default=t,this},toString(t){return k(this.definition,t)},extend(...t){const n={...this.definition},r={...this.prototype},a={...this.default},l=[];for(let e of t)i(K,e)&&(f(n,e.definition),f(a,e.default),l.push(...e.assertions)),o(e)&&f(r,e.prototype),s(e)&&f(n,e);const c=$(new z(n),this,r).defaultTo(a);return c.assertions=[...this.assertions,...l],e(this)!==z.prototype&&(c.parentClass=this),c},[d](t,e,n,r,i){s(t)?C(t[y]||t,this.definition,e,n,r,i):S(n,this,t,e),F(t,this,e,n)}});const H=u(_(),{apply(t,e,[n]){const r=Object.create(H);return r.definition=n,r}});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,n,i,s,a,l)=>v(n,e,t,i,(e=>Object.assign({getPrototypeOf:()=>e.prototype,get(n,i){if(i===y)return n;const l=n[i];return o(l)?u(l,{apply(o,l,c){if(r(a,i)){const[r,l=c.length-1,u]=a[i];for(let n=r;n<=l;n++){const r=u?u(n):e.definition;c[n]=C(c[n],r,`${t.name}.${i} arguments[${n}]`,e.errors,[],!0)}if(e.assertions.length>0){const t=s(n);o.apply(t,c),F(t,e,`after ${i} mutation`)}w(e)}return o.apply(n,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,n,r)=>Z(e,t,n,r,((t,e)=>t[n]=e),!0),deleteProperty:(t,n)=>Z(e,t,n,void 0,(t=>delete t[n]))});return e}h(W,K,{toString(t){return"Array of "+P(this.definition,t)},[d](t,e,n,r){Array.isArray(t)?(t[y]||t).forEach(((t,i)=>C(t,this.definition,`${e||"Array"}[${i}]`,n,r))):S(n,this,t,e),F(t,this,e,n)},extend(...t){return $(new W(A(this.definition,t)),this)}});const Z=(t,e,n,r,i,o)=>{const s=`Array[${n}]`;+n>=0&&(o||n in e)&&(r=C(r,t.definition,s,t.errors,[],!0));const a=[...e];i(a),F(a,t,s);const l=!w(t);return l&&i(e,r),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,n,r){const o=t.definition,s=o.arguments.find((t=>i(H.remaining,t))),a=s?Math.max(r.length,o.arguments.length-1):o.arguments.length;for(let e=0;e=o.arguments.length-1?s.definition:o.arguments[e];r[e]=C(r[e],n,`arguments[${e}]`,t.errors,[],!0)}let l;return F(r,t,"arguments"),t.errors.length||(l=Reflect.apply(e,n,r),"return"in o&&(l=C(l,o.return,"return value",t.errors,[],!0))),w(t),l}})))}function B(t,e){const n=t=>0===t?r.definition.key:r.definition.value,r=U(Map,B,{key:t,value:e},(t=>c(t)?new Map([...t].map((t=>t.map(((t,e)=>N(t,n(e))))))):t),(t=>new Map(t)),{set:[0,1,n],delete:[],clear:[]});return r}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 n=this.definition.arguments,r=t.map(((e,r)=>A(r in n?n[r]:[],t[r]))),i=A(this.definition.return,e);return $(new q(...r).return(i),this)},[d](t,e,n){o(t)||S(n,"Function",t,e)}}),h(B,K,{toString(t){return`Map of ${P(this.definition.key,t)} : ${P(this.definition.value,t)}`},[d](t,e,n,r){if(i(Map,t)){e=e||"Map";for(let[i,o]of t)C(i,this.definition.key,`${e} key`,n,r),C(o,this.definition.value,`${e}[${k(i)}]`,n,r)}else S(n,this,t,e);F(t,this,e,n)},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,n,r){if(i(Set,t))for(let i of t.values())C(i,this.definition,`${e||"Set"} value`,n,r);else S(n,this,t,e);F(t,this,e,n)},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}; +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]),f=(t,e)=>new Proxy(t,e),u=(t,e={})=>{for(let r in e)if(l(e[r])){const n={};u(n,t[r]),u(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?f(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?(u(r,e.default),e.parentClass&&u(t,new e.parentClass(t)),u(r,t),r):t,$=(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),f=t.conventionForConstant(o),u=n(i,o),p=u&&Object.getOwnPropertyDescriptor(i,o);o in e&&(c&&!s||f&&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&&(u?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 u=M(r,c),p=n(e,c),h=e[c];if(!i&&p&&t.conventionForPrivate(c))return D(`access to private property ${u}`,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?f(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)?f(t,T(e,r,n,i)):N(t,r))(d,t,h,u,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){return l(t)?new z(t):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)&&(u(r,e.definition),u(a,e.default),l.push(...e.assertions)),o(e)&&u(n,e.prototype),s(e)&&u(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=f(_(),{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)?f(l,{apply(o,l,c){if(n(a,i)){const[n,l=c.length-1,f]=a[i];for(let r=n;r<=l;r++){const n=f?f(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},[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 225cabd..2c0f954 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 {\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\t// short circuit validation if not receiving an object as expected\r\n\t\t\treturn 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) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def) : 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","parentClass","extendModel","newProps","push","stackError","errors","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","get","Reflect","inDef","defPart","set","apply","fn","ctx","args","getProp","deleteProperty","ownKeys","descriptor","ObjectModel","toUpperCase","fns","as","defaultTo","initialErrorCollector","failed","e","TypeError","replace","assert","proto","defaults","newAssertions","submodel","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,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AiBzB,KAAKE,WAAW5B,IAAK6D,QAAYV,EAAiBzB,KAAKE,WAAW1B,MAAO2D,IAC3G,EAED/C,CAACA,GAAQmC,EAAKP,EAAMH,EAAQsB,GAC3B,GAAIjF,EAAGmH,IAAK9C,GAAM,CACjBP,EAAOA,GAAQ,MACf,IAAK,IAAK1C,EAAKE,KAAU+C,EACxBuB,EAAgBxE,EAAK0B,KAAKE,WAAW5B,IAAK,GAAG0C,QAAYH,EAAQsB,GACjEW,EAAgBtE,EAAOwB,KAAKE,WAAW1B,MAAO,GAAGwC,KAAQY,EAAOtD,MAASuC,EAAQsB,EAElF,MAAMvB,EAAWC,EAAQb,KAAMuB,EAAKP,GAErC4C,EAAgBrC,EAAKvB,KAAMgB,EAAMH,EACjC,EAEDhC,OAAOqM,EAAUC,GAChB,OAAO1K,EAAY,IAAI0J,EACtB5H,EAAiBvC,KAAKE,WAAW5B,IAAK4M,GACtC3I,EAAiBvC,KAAKE,WAAW1B,MAAO2M,IACtCnL,KACH,ICvBFnB,EAAO8L,EAAU5I,EAAO,CACvBL,SAASS,GACR,MAAO,UAAYV,EAAiBzB,KAAKE,WAAYiC,EACrD,EAED/C,CAACA,GAAQ8G,EAAKlF,EAAMH,EAAQsB,GAC3B,GAAIjF,EAAGoH,IAAK4B,GACX,IAAK,IAAI3B,KAAQ2B,EAAIkF,SACpBtI,EAAgByB,EAAMvE,KAAKE,WAAY,GAAGc,GAAQ,cAAeH,EAAQsB,QAEpEvB,EAAWC,EAAQb,KAAMkG,EAAKlF,GACrC4C,EAAgBsC,EAAKlG,KAAMgB,EAAMH,EACjC,EAEDhC,UAAU2D,GACT,OAAO/B,EAAY,IAAIkK,EAASpI,EAAiBvC,KAAKE,WAAYsC,IAAYxC,KAC9E"} \ 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\r\n\tObjectProto = Object.prototype,\r\n\tbettertypeof = x => ObjectProto.toString.call(x).match(/\\s([a-zA-Z]+)/)[1],\r\n\tgetProto = Object.getPrototypeOf,\r\n\tsetProto = Object.setPrototypeOf,\r\n\r\n\thas = (o, prop) => ObjectProto.hasOwnProperty.call(o, prop),\r\n\tis = (Constructor, obj) => obj instanceof Constructor,\r\n\tisFunction = f => typeof f === \"function\",\r\n\tisObject = o => o && typeof o === \"object\",\r\n\tisString = s => typeof s === \"string\",\r\n\tisPlainObject = o => isObject(o) && getProto(o) === ObjectProto,\r\n\tisIterable = x => x && isFunction(x[Symbol.iterator]),\r\n\r\n\tproxify = (val, traps) => new Proxy(val, traps),\r\n\r\n\tmerge = (target, src = {}) => {\r\n\t\tfor (let key in src) {\r\n\t\t\tif (isPlainObject(src[key])) {\r\n\t\t\t\tconst o = {}\r\n\t\t\t\tmerge(o, target[key])\r\n\t\t\t\tmerge(o, src[key])\r\n\t\t\t\ttarget[key] = o\r\n\t\t\t} else {\r\n\t\t\t\ttarget[key] = src[key]\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target\r\n\t},\r\n\r\n\tdefine = (obj, key, value, enumerable = false) => {\r\n\t\tObject.defineProperty(obj, key, { value, enumerable, writable: true, configurable: true })\r\n\t},\r\n\r\n\textend = (child, parent, props) => {\r\n\t\tchild.prototype = Object.assign(Object.create(parent.prototype, {\r\n\t\t\tconstructor: {\r\n\t\t\t\tvalue: child,\r\n\t\t\t\twritable: true,\r\n\t\t\t\tconfigurable: true\r\n\t\t\t}\r\n\t\t}), props)\r\n\t\tsetProto(child, parent)\r\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\t// short circuit validation if not receiving an object as expected\r\n\t\t\treturn 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) {\r\n\treturn isPlainObject(def) ? new ObjectModel(def) : 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) }","\r\nimport { _original, checkAssertions, checkDefinition, initModel, unstackErrors } from \"./object-model.js\"\r\nimport { has, isFunction, proxify } from \"./helpers.js\"\r\n\r\nexport const initListModel = (base, constructor, def, init, clone, mutators, otherTraps) => {\r\n\r\n\treturn initModel(def, constructor, base, init, model => Object.assign({\r\n\t\tgetPrototypeOf: () => model.prototype,\r\n\t\tget(l, key) {\r\n\t\t\tif (key === _original) return l\r\n\r\n\t\t\tconst val = l[key]\r\n\t\t\treturn isFunction(val) ? proxify(val, {\r\n\t\t\t\tapply(fn, ctx, args) {\r\n\t\t\t\t\tif (has(mutators, key)) {\r\n\t\t\t\t\t\t// indexes of arguments to check def + cast\r\n\t\t\t\t\t\tconst [begin, end = args.length - 1, getArgDef] = mutators[key]\r\n\t\t\t\t\t\tfor (let i = begin; i <= end; i++) {\r\n\t\t\t\t\t\t\tconst argDef = getArgDef ? getArgDef(i) : model.definition\r\n\t\t\t\t\t\t\targs[i] = checkDefinition(\r\n\t\t\t\t\t\t\t\targs[i],\r\n\t\t\t\t\t\t\t\targDef,\r\n\t\t\t\t\t\t\t\t`${base.name}.${key} arguments[${i}]`,\r\n\t\t\t\t\t\t\t\tmodel.errors,\r\n\t\t\t\t\t\t\t\t[],\r\n\t\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (model.assertions.length > 0) {\r\n\t\t\t\t\t\t\tconst testingClone = clone(l)\r\n\t\t\t\t\t\t\tfn.apply(testingClone, args)\r\n\t\t\t\t\t\t\tcheckAssertions(testingClone, model, `after ${key} mutation`)\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tunstackErrors(model)\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn fn.apply(l, args)\r\n\t\t\t\t}\r\n\t\t\t}) : val\r\n\t\t}\r\n\t}, otherTraps))\r\n}","import {\r\n\t_original, _check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, formatDefinition, Model, stackError, unstackErrors\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend } from \"./helpers.js\"\r\n\r\nexport default function ArrayModel(initialDefinition) {\r\n\tconst model = initListModel(\r\n\t\tArray,\r\n\t\tArrayModel,\r\n\t\tinitialDefinition,\r\n\t\ta => Array.isArray(a) ? a.map(arg => cast(arg, model.definition)) : a,\r\n\t\ta => [...a],\r\n\t\t{\r\n\t\t\t\"copyWithin\": [],\r\n\t\t\t\"fill\": [0, 0],\r\n\t\t\t\"pop\": [],\r\n\t\t\t\"push\": [0],\r\n\t\t\t\"reverse\": [],\r\n\t\t\t\"shift\": [],\r\n\t\t\t\"sort\": [],\r\n\t\t\t\"splice\": [2],\r\n\t\t\t\"unshift\": [0]\r\n\t\t},\r\n\t\t{\r\n\t\t\tset(arr, key, val) {\r\n\t\t\t\treturn controlMutation(model, arr, key, val, (a, v) => a[key] = v, true)\r\n\t\t\t},\r\n\r\n\t\t\tdeleteProperty(arr, key) {\r\n\t\t\t\treturn controlMutation(model, arr, key, undefined, a => delete a[key])\r\n\t\t\t}\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(ArrayModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn \"Array of \" + formatDefinition(this.definition, stack)\r\n\t},\r\n\r\n\t[_check](arr, path, errors, stack) {\r\n\t\tif (Array.isArray(arr))\r\n\t\t\t(arr[_original] || arr).forEach((a, i) => checkDefinition(a, this.definition, `${path || \"Array\"}[${i}]`, errors, stack))\r\n\t\telse stackError(errors, this, arr, path)\r\n\r\n\t\tcheckAssertions(arr, this, path, errors)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\treturn extendModel(new ArrayModel(extendDefinition(this.definition, newParts)), this)\r\n\t}\r\n})\r\n\r\nconst controlMutation = (model, array, key, value, applyMutation, canBeExtended) => {\r\n\tconst path = `Array[${key}]`\r\n\tconst isInDef = (+key >= 0 && (canBeExtended || key in array))\r\n\tif (isInDef) value = checkDefinition(value, model.definition, path, model.errors, [], true)\r\n\r\n\tconst testArray = [...array]\r\n\tapplyMutation(testArray)\r\n\tcheckAssertions(testArray, model, path)\r\n\tconst isSuccess = !unstackErrors(model)\r\n\tif (isSuccess) applyMutation(array, value)\r\n\treturn isSuccess\r\n}","import {\r\n\t_check, _original, Any, checkAssertions, checkDefinition, extendDefinition, extendModel,\r\n\tformatDefinition, initModel, Model, stackError, unstackErrors\r\n} from \"./object-model.js\"\r\nimport { extend, is, isFunction } from \"./helpers.js\"\r\n\r\nexport default function FunctionModel(...argsDef) {\r\n\treturn initModel({ arguments: argsDef }, FunctionModel, Function, null, model => ({\r\n\t\tgetPrototypeOf: () => model.prototype,\r\n\r\n\t\tget(fn, key) {\r\n\t\t\treturn key === _original ? fn : fn[key]\r\n\t\t},\r\n\r\n\t\tapply(fn, ctx, args) {\r\n\t\t\tconst def = model.definition\r\n\t\t\tconst remainingArgDef = def.arguments.find(argDef => is(Any.remaining, argDef))\r\n\t\t\tconst nbArgsToCheck = remainingArgDef ? Math.max(args.length, def.arguments.length - 1) : def.arguments.length\r\n\r\n\t\t\tfor (let i = 0; i < nbArgsToCheck; i++) {\r\n\t\t\t\tconst argDef = remainingArgDef && i >= def.arguments.length - 1 ? remainingArgDef.definition : def.arguments[i]\r\n\t\t\t\targs[i] = checkDefinition(args[i], argDef, `arguments[${i}]`, model.errors, [], true)\r\n\t\t\t}\r\n\r\n\t\t\tcheckAssertions(args, model, \"arguments\")\r\n\r\n\t\t\tlet result\r\n\t\t\tif (!model.errors.length) {\r\n\t\t\t\tresult = Reflect.apply(fn, ctx, args)\r\n\t\t\t\tif (\"return\" in def)\r\n\t\t\t\t\tresult = checkDefinition(result, def.return, \"return value\", model.errors, [], true)\r\n\t\t\t}\r\n\t\t\tunstackErrors(model)\r\n\t\t\treturn result\r\n\t\t}\r\n\t}))\r\n}\r\n\r\nextend(FunctionModel, Model, {\r\n\ttoString(stack = []) {\r\n\t\tlet out = `Function(${this.definition.arguments.map(\r\n\t\t\targDef => formatDefinition(argDef, [...stack])\r\n\t\t).join(\", \")})`\r\n\r\n\t\tif (\"return\" in this.definition) {\r\n\t\t\tout += \" => \" + formatDefinition(this.definition.return, stack)\r\n\t\t}\r\n\t\treturn out\r\n\t},\r\n\r\n\treturn(def) {\r\n\t\tthis.definition.return = def\r\n\t\treturn this\r\n\t},\r\n\r\n\t[_check](f, path, errors) {\r\n\t\tif (!isFunction(f)) stackError(errors, \"Function\", f, path)\r\n\t}\r\n})","import {\r\n\t_check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, format, formatDefinition, Model, stackError\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend, is, isIterable } from \"./helpers.js\"\r\n\r\nexport default function MapModel(initialKeyDefinition, initialValueDefinition) {\r\n\tconst getDef = i => i === 0 ? model.definition.key : model.definition.value;\r\n\tconst model = initListModel(\r\n\t\tMap,\r\n\t\tMapModel,\r\n\t\t{ key: initialKeyDefinition, value: initialValueDefinition },\r\n\t\tit => isIterable(it) ? new Map([...it].map(pair => pair.map((x, i) => cast(x, getDef(i))))) : it,\r\n\t\tmap => new Map(map),\r\n\t\t{\r\n\t\t\t\"set\": [0, 1, getDef],\r\n\t\t\t\"delete\": [],\r\n\t\t\t\"clear\": []\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(MapModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn `Map of ${formatDefinition(this.definition.key, stack)} : ${formatDefinition(this.definition.value, stack)}`\r\n\t},\r\n\r\n\t[_check](map, path, errors, stack) {\r\n\t\tif (is(Map, map)) {\r\n\t\t\tpath = path || \"Map\"\r\n\t\t\tfor (let [key, value] of map) {\r\n\t\t\t\tcheckDefinition(key, this.definition.key, `${path} key`, errors, stack)\r\n\t\t\t\tcheckDefinition(value, this.definition.value, `${path}[${format(key)}]`, errors, stack)\r\n\t\t\t}\r\n\t\t} else stackError(errors, this, map, path)\r\n\r\n\t\tcheckAssertions(map, this, path, errors)\r\n\t},\r\n\r\n\textend(keyParts, valueParts) {\r\n\t\treturn extendModel(new MapModel(\r\n\t\t\textendDefinition(this.definition.key, keyParts),\r\n\t\t\textendDefinition(this.definition.value, valueParts)\r\n\t\t), this)\r\n\t}\r\n})","import {\r\n\t_check, cast, checkAssertions, checkDefinition,\r\n\textendDefinition, extendModel, formatDefinition, Model, stackError\r\n} from \"./object-model.js\"\r\nimport { initListModel } from \"./list-model.js\"\r\nimport { extend, is, isIterable } from \"./helpers.js\"\r\n\r\nexport default function SetModel(initialDefinition) {\r\n\tconst model = initListModel(\r\n\t\tSet,\r\n\t\tSetModel,\r\n\t\tinitialDefinition,\r\n\t\tit => isIterable(it) ? new Set([...it].map(val => cast(val, model.definition))) : it,\r\n\t\tset => new Set(set),\r\n\t\t{\r\n\t\t\t\"add\": [0, 0],\r\n\t\t\t\"delete\": [],\r\n\t\t\t\"clear\": []\r\n\t\t}\r\n\t)\r\n\r\n\treturn model\r\n}\r\n\r\nextend(SetModel, Model, {\r\n\ttoString(stack) {\r\n\t\treturn \"Set of \" + formatDefinition(this.definition, stack)\r\n\t},\r\n\r\n\t[_check](set, path, errors, stack) {\r\n\t\tif (is(Set, set)) {\r\n\t\t\tfor (let item of set.values()) {\r\n\t\t\t\tcheckDefinition(item, this.definition, `${path || \"Set\"} value`, errors, stack)\r\n\t\t\t}\r\n\t\t} else stackError(errors, this, set, path)\r\n\t\tcheckAssertions(set, this, path, errors)\r\n\t},\r\n\r\n\textend(...newParts) {\r\n\t\treturn extendModel(new SetModel(extendDefinition(this.definition, newParts)), this)\r\n\t}\r\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","parentClass","extendModel","newProps","push","stackError","errors","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","get","Reflect","inDef","defPart","set","apply","fn","ctx","args","getProp","deleteProperty","ownKeys","descriptor","ObjectModel","toUpperCase","fns","as","defaultTo","initialErrorCollector","failed","e","TypeError","replace","assert","proto","defaults","newAssertions","submodel","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","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,CAAE,EACZqB,EAAMrB,EAAGsB,EAAOE,IAChBH,EAAMrB,EAAGuB,EAAIC,IACbF,EAAOE,GAAOxB,CAClB,MACIsB,EAAOE,GAAOD,EAAIC,GAGpB,OAAOF,GAGRG,EAAS,CAACnB,EAAKkB,EAAKE,EAAOC,GAAa,KACvClC,OAAOmC,eAAetB,EAAKkB,EAAK,CAAEE,QAAOC,aAAYE,UAAU,EAAMC,cAAc,GAAO,EAG3FC,EAAS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sB,QAEpEvB,EAAWC,EAAQb,KAAMkG,EAAKlF,GACrC4C,EAAgBsC,EAAKlG,KAAMgB,EAAMH,EACjC,EAEDhC,UAAU2D,GACT,OAAO/B,EAAY,IAAIkK,EAASpI,EAAiBvC,KAAKE,WAAYsC,IAAYxC,KAC9E"} \ No newline at end of file diff --git a/index.html b/index.html index fec7908..022adef 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 4.11 kB minified and gzipped, +
  • all in 4.05 kB minified and gzipped, even less when using tree-shaking
  • @@ -156,7 +156,7 @@

    What's inside the box ?

    Download

    -

    Current version: v4.3.1

    +

    Current version: v4.4.0

    diff --git a/package.json b/package.json index 398747f..1e07df3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "objectmodel", - "version": "4.3.1", + "version": "4.4.0", "description": "Strong Dynamically Typed Object Modeling for JavaScript", "author": "Sylvain Pollet-Villard", "license": "MIT",