@fncts/schema 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -0
- package/_cjs/AST.cjs +1093 -1226
- package/_cjs/AST.cjs.map +1 -1
- package/_cjs/ASTAnnotation.cjs +114 -85
- package/_cjs/ASTAnnotation.cjs.map +1 -1
- package/_cjs/ASTAnnotationMap.cjs +43 -41
- package/_cjs/ASTAnnotationMap.cjs.map +1 -1
- package/_cjs/Eq.cjs +113 -145
- package/_cjs/Eq.cjs.map +1 -1
- package/_cjs/Gen.cjs +131 -167
- package/_cjs/Gen.cjs.map +1 -1
- package/_cjs/Guard.cjs +167 -267
- package/_cjs/Guard.cjs.map +1 -1
- package/_cjs/InvalidInterpretationError.cjs +9 -10
- package/_cjs/InvalidInterpretationError.cjs.map +1 -1
- package/_cjs/ParseError/ParseError.cjs +283 -284
- package/_cjs/ParseError/ParseError.cjs.map +1 -1
- package/_cjs/ParseError/ParseErrorFormatter.cjs +0 -2
- package/_cjs/ParseError/PathFormatter.cjs +55 -87
- package/_cjs/ParseError/PathFormatter.cjs.map +1 -1
- package/_cjs/ParseError/TreeFormatter.cjs +70 -102
- package/_cjs/ParseError/TreeFormatter.cjs.map +1 -1
- package/_cjs/ParseError.cjs +35 -50
- package/_cjs/ParseResult.cjs +15 -15
- package/_cjs/ParseResult.cjs.map +1 -1
- package/_cjs/Parser/api.cjs +54 -50
- package/_cjs/Parser/api.cjs.map +1 -1
- package/_cjs/Parser/definition.cjs +17 -16
- package/_cjs/Parser/definition.cjs.map +1 -1
- package/_cjs/Parser/interpreter.cjs +276 -358
- package/_cjs/Parser/interpreter.cjs.map +1 -1
- package/_cjs/Parser.cjs +12 -39
- package/_cjs/Schema/api/conc.cjs +64 -59
- package/_cjs/Schema/api/conc.cjs.map +1 -1
- package/_cjs/Schema/api/either.cjs +73 -72
- package/_cjs/Schema/api/either.cjs.map +1 -1
- package/_cjs/Schema/api/hashMap.cjs +85 -85
- package/_cjs/Schema/api/hashMap.cjs.map +1 -1
- package/_cjs/Schema/api/hashSet.cjs +75 -69
- package/_cjs/Schema/api/hashSet.cjs.map +1 -1
- package/_cjs/Schema/api/list.cjs +74 -66
- package/_cjs/Schema/api/list.cjs.map +1 -1
- package/_cjs/Schema/api/map.cjs +81 -83
- package/_cjs/Schema/api/map.cjs.map +1 -1
- package/_cjs/Schema/api/maybe.cjs +56 -49
- package/_cjs/Schema/api/maybe.cjs.map +1 -1
- package/_cjs/Schema/api/set.cjs +68 -61
- package/_cjs/Schema/api/set.cjs.map +1 -1
- package/_cjs/Schema/api.cjs +332 -350
- package/_cjs/Schema/api.cjs.map +1 -1
- package/_cjs/Schema/definition.cjs +28 -26
- package/_cjs/Schema/definition.cjs.map +1 -1
- package/_cjs/Schema/derivations.cjs +85 -100
- package/_cjs/Schema/derivations.cjs.map +1 -1
- package/_cjs/Schema.cjs +95 -127
- package/_cjs/Show.cjs +91 -151
- package/_cjs/Show.cjs.map +1 -1
- package/_cjs/chunk.cjs +28 -0
- package/_cjs/global.cjs +0 -2
- package/_cjs/index.cjs +0 -2
- package/_cjs/utils.cjs +41 -46
- package/_cjs/utils.cjs.map +1 -1
- package/_mjs/AST.mjs +996 -1161
- package/_mjs/AST.mjs.map +1 -1
- package/_mjs/ASTAnnotation.mjs +77 -73
- package/_mjs/ASTAnnotation.mjs.map +1 -1
- package/_mjs/ASTAnnotationMap.mjs +31 -29
- package/_mjs/ASTAnnotationMap.mjs.map +1 -1
- package/_mjs/Eq.mjs +101 -134
- package/_mjs/Eq.mjs.map +1 -1
- package/_mjs/Gen.mjs +117 -157
- package/_mjs/Gen.mjs.map +1 -1
- package/_mjs/Guard.mjs +154 -257
- package/_mjs/Guard.mjs.map +1 -1
- package/_mjs/InvalidInterpretationError.mjs +8 -4
- package/_mjs/InvalidInterpretationError.mjs.map +1 -1
- package/_mjs/ParseError/ParseError.mjs +266 -262
- package/_mjs/ParseError/ParseError.mjs.map +1 -1
- package/_mjs/ParseError/ParseErrorFormatter.mjs +0 -2
- package/_mjs/ParseError/PathFormatter.mjs +51 -80
- package/_mjs/ParseError/PathFormatter.mjs.map +1 -1
- package/_mjs/ParseError/TreeFormatter.mjs +62 -94
- package/_mjs/ParseError/TreeFormatter.mjs.map +1 -1
- package/_mjs/ParseError.mjs +5 -6
- package/_mjs/ParseResult.mjs +13 -9
- package/_mjs/ParseResult.mjs.map +1 -1
- package/_mjs/Parser/api.mjs +43 -39
- package/_mjs/Parser/api.mjs.map +1 -1
- package/_mjs/Parser/definition.mjs +12 -8
- package/_mjs/Parser/definition.mjs.map +1 -1
- package/_mjs/Parser/interpreter.mjs +262 -348
- package/_mjs/Parser/interpreter.mjs.map +1 -1
- package/_mjs/Parser.mjs +4 -5
- package/_mjs/Schema/api/conc.mjs +41 -45
- package/_mjs/Schema/api/conc.mjs.map +1 -1
- package/_mjs/Schema/api/either.mjs +55 -61
- package/_mjs/Schema/api/either.mjs.map +1 -1
- package/_mjs/Schema/api/hashMap.mjs +61 -71
- package/_mjs/Schema/api/hashMap.mjs.map +1 -1
- package/_mjs/Schema/api/hashSet.mjs +53 -56
- package/_mjs/Schema/api/hashSet.mjs.map +1 -1
- package/_mjs/Schema/api/list.mjs +50 -53
- package/_mjs/Schema/api/list.mjs.map +1 -1
- package/_mjs/Schema/api/map.mjs +59 -69
- package/_mjs/Schema/api/map.mjs.map +1 -1
- package/_mjs/Schema/api/maybe.mjs +34 -36
- package/_mjs/Schema/api/maybe.mjs.map +1 -1
- package/_mjs/Schema/api/set.mjs +47 -48
- package/_mjs/Schema/api/set.mjs.map +1 -1
- package/_mjs/Schema/api.mjs +304 -346
- package/_mjs/Schema/api.mjs.map +1 -1
- package/_mjs/Schema/definition.mjs +21 -17
- package/_mjs/Schema/definition.mjs.map +1 -1
- package/_mjs/Schema/derivations.mjs +71 -90
- package/_mjs/Schema/derivations.mjs.map +1 -1
- package/_mjs/Schema.mjs +12 -15
- package/_mjs/Show.mjs +79 -139
- package/_mjs/Show.mjs.map +1 -1
- package/_mjs/global.mjs +0 -2
- package/_mjs/index.mjs +0 -2
- package/_mjs/utils.mjs +35 -37
- package/_mjs/utils.mjs.map +1 -1
- package/package.json +7 -3
- package/_cjs/ParseError/ParseErrorFormatter.cjs.map +0 -1
- package/_cjs/ParseError.cjs.map +0 -1
- package/_cjs/Parser.cjs.map +0 -1
- package/_cjs/Schema.cjs.map +0 -1
- package/_cjs/global.cjs.map +0 -1
- package/_cjs/index.cjs.map +0 -1
- package/_mjs/ParseError/ParseErrorFormatter.mjs.map +0 -1
- package/_mjs/ParseError.mjs.map +0 -1
- package/_mjs/Parser.mjs.map +0 -1
- package/_mjs/Schema.mjs.map +0 -1
- package/_mjs/global.mjs.map +0 -1
- package/_mjs/index.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter.mjs","names":["globalValue","isBigInt","isBoolean","isNumber","isObject","isRecord","isString","isSymbol","isUndefined","concrete","getSearchTree","DeclarationError","RefinementError","TransformationError","getKeysForIndexSignature","getTemplateLiteralRegex","memoize","ownKeys","decodeMemoMap","Symbol","for","WeakMap","encodeMemoMap","goMemo","ast","isDecoding","memoMap","memo","get","parser","go","set","_tag","parse","decode","typeParameters","encode","tsplus_module_2","make","input","options","tsplus_module_1","mapLeft","error","fromRefinement","u","literal","symbol","_","tsplus_module_3","succeed","tsplus_module_4","some","value","enums","regex","test","elements","map","e","type","rest","tsplus_module_5","Array","isArray","fail","tsplus_module_7","typeError","tsplus_module_6","unknownArray","output","errors","emptyPushable","allErrors","i","length","unsafeGet","isOptional","indexError","missingError","tsplus_module_8","push","tupleError","vector","t","isLeft","left","right","tsplus_module_9","isJust","head","unsafeHead","tail","j","isUnexpectedAllowed","unexpectedError","isNonEmpty","propertySignatures","indexSignatures","propertySignatureTypes","f","is","parameter","unknownRecord","expectedKeys","ps","name","Object","prototype","hasOwnProperty","call","keyError","createKey","typeLiteralError","keys","key","searchTree","types","Reflect","len","Map","forEach","candidates","buckets","String","concat","literals","createUnion","from","createTypeLiteral","createPropertySignature","otherwise","candidate","pr","isRight","unionMemberError","unionError","neverKeyword","getAST","a","flatMap","failure","refinementError","to","getTo","transformation","transformationError","missedBrands","validation","validate","createValidation","annotations","parserFor"],"sources":["../../_src/Parser/interpreter.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAIA,SAASA,WAAW,QAAQ,yBAAyB;AACrD,SACEC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,WAAW,QACN,6BAA6B;AAEpC,SAAiBC,QAAQ,EAAEC,aAAa,QAAQ,YAAW;AAC3D,SAASC,gBAAgB,EAAiBC,eAAe,EAAEC,mBAAmB,QAAQ,8BAA6B;AACnH,SAASC,wBAAwB,EAAEC,uBAAuB,EAAEC,OAAO,EAAEC,OAAO,QAAQ,cAAa;AAEjG,MAAMC,aAAa,gBAAGlB,WAAW,cAC/BmB,MAAM,CAACC,GAAG,CAAC,mCAAmC,CAAC,EAC/C,MAAM,IAAIC,OAAO,EAAoB,CACtC;AAED,MAAMC,aAAa,gBAAGtB,WAAW,cAC/BmB,MAAM,CAACC,GAAG,CAAC,mCAAmC,CAAC,EAC/C,MAAM,IAAIC,OAAO,EAAoB,CACtC;AAED,SAASE,MAAMA,CAACC,GAAQ,EAAEC,UAAmB;EAC3C,MAAMC,OAAO,GAAGD,UAAU,GAAGP,aAAa,GAAGI,aAAa;EAC1D,MAAMK,IAAI,GAAMD,OAAO,CAACE,GAAG,CAACJ,GAAG,CAAC;EAChC,IAAIG,IAAI,EAAE;IACR,OAAOA,IAAI;EACb;EACA,MAAME,MAAM,GAAGC,EAAE,CAACN,GAAG,EAAEC,UAAU,CAAC;EAClCC,OAAO,CAACK,GAAG,CAACP,GAAG,EAAEK,MAAM,CAAC;EACxB,OAAOA,MAAM;AACf;AAEA,SAASC,EAAEA,CAACN,GAAQ,EAAEC,UAAmB;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AAY,CAACxE,MAAM,GAAG,CAAC,GAC1B1B,eAAA,CAAAgB,IAAA,CAAiBC,eAAA,CAAAC,SAAA,CAAqBC,eAAA,CAAAkF,gBAAA,CAAqB9H,GAAG,CAACwG,IAAI,EAAEmB,YAAY,EAAE3H,GAAG,CAAC+H,WAAW,CAAC,EAAE1G,CAAC,CAAC,CAAC,GACxGI,eAAA,CAAAC,OAAA,CAAoBL,CAAC,CAAC;QAC5B,CAAC,CAAC;MACJ;EACF;AACF;AAEA,OAAM,SAAU2G,SAASA,CAAChI,GAAQ,EAAEC,UAAmB;EACrD,OAAOF,MAAM,CAACC,GAAG,EAAEC,UAAU,CAAC;AAChC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"interpreter.mjs","names":[],"sources":["../../esm/Parser/interpreter.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/data/Either/api\";\nimport * as tsplus_module_2 from \"@fncts/schema/Parser/definition\";\nimport * as tsplus_module_3 from \"@fncts/schema/ParseResult\";\nimport * as tsplus_module_4 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/api\";\nimport * as tsplus_module_6 from \"@fncts/schema/AST\";\nimport * as tsplus_module_7 from \"@fncts/schema/ParseError/ParseError\";\nimport * as tsplus_module_8 from \"@fncts/base/collection/immutable/Vector/internal\";\nimport * as tsplus_module_9 from \"@fncts/base/data/Maybe/definition\";\nimport { globalValue } from \"@fncts/base/data/Global\";\nimport { isBigInt, isBoolean, isNumber, isObject, isRecord, isString, isSymbol, isUndefined, } from \"@fncts/base/util/predicates\";\nimport { concrete, getSearchTree } from \"../AST.js\";\nimport { DeclarationError, RefinementError, TransformationError } from \"../ParseError/ParseError.js\";\nimport { getKeysForIndexSignature, getTemplateLiteralRegex, memoize, ownKeys } from \"../utils.js\";\nconst decodeMemoMap = globalValue(Symbol.for(\"fncts.schema.Parser.decodeMemoMap\"), () => new WeakMap());\nconst encodeMemoMap = globalValue(Symbol.for(\"fncts.schema.Parser.encodeMemoMap\"), () => new WeakMap());\nfunction goMemo(ast, isDecoding) {\n const memoMap = isDecoding ? decodeMemoMap : encodeMemoMap;\n const memo = memoMap.get(ast);\n if (memo) {\n return memo;\n }\n const parser = go(ast, isDecoding);\n memoMap.set(ast, parser);\n return parser;\n}\nfunction go(ast, isDecoding) {\n void 0;\n switch (ast._tag) {\n case 0 /* ASTTag.Declaration */: {\n const parse = isDecoding ? ast.decode(...ast.typeParameters) : ast.encode(...ast.typeParameters);\n return tsplus_module_2.make((input, options) => tsplus_module_1.mapLeft((error) => new DeclarationError(ast, input, error))(parse(input, options)));\n }\n case 1 /* ASTTag.Literal */:\n return tsplus_module_2.fromRefinement(ast, (u) => u === ast.literal);\n case 2 /* ASTTag.UniqueSymbol */:\n return tsplus_module_2.fromRefinement(ast, (u) => u === ast.symbol);\n case 3 /* ASTTag.UndefinedKeyword */:\n case 4 /* ASTTag.VoidKeyword */:\n return tsplus_module_2.fromRefinement(ast, isUndefined);\n case 5 /* ASTTag.NeverKeyword */:\n return tsplus_module_2.fromRefinement(ast, (_) => false);\n case 6 /* ASTTag.UnknownKeyword */:\n case 7 /* ASTTag.AnyKeyword */:\n return tsplus_module_2.make(tsplus_module_3.succeed);\n case 8 /* ASTTag.StringKeyword */:\n return tsplus_module_2.fromRefinement(ast, isString);\n case 9 /* ASTTag.NumberKeyword */:\n return tsplus_module_2.fromRefinement(ast, isNumber);\n case 10 /* ASTTag.BooleanKeyword */:\n return tsplus_module_2.fromRefinement(ast, isBoolean);\n case 11 /* ASTTag.BigIntKeyword */:\n return tsplus_module_2.fromRefinement(ast, isBigInt);\n case 12 /* ASTTag.SymbolKeyword */:\n return tsplus_module_2.fromRefinement(ast, isSymbol);\n case 13 /* ASTTag.ObjectKeyword */:\n return tsplus_module_2.fromRefinement(ast, isObject);\n case 14 /* ASTTag.Enum */:\n return tsplus_module_2.fromRefinement(ast, (u) => tsplus_module_4.some(([_, value]) => value === u)(ast.enums));\n case 15 /* ASTTag.TemplateLiteral */: {\n const regex = getTemplateLiteralRegex(ast);\n return tsplus_module_2.fromRefinement(ast, (u) => isString(u) && regex.test(u));\n }\n case 16 /* ASTTag.Tuple */: {\n const elements = tsplus_module_4.map((e) => goMemo(e.type, isDecoding))(ast.elements);\n const rest = tsplus_module_5.map((rest) => tsplus_module_4.map((ast) => goMemo(ast, isDecoding))(rest))(ast.rest);\n return tsplus_module_2.make((input, options) => {\n if (!Array.isArray(input)) {\n return tsplus_module_3.fail(tsplus_module_7.typeError(tsplus_module_6.unknownArray, input));\n }\n const output = [];\n const errors = tsplus_module_4.emptyPushable();\n const allErrors = options?.allErrors;\n let i = 0;\n for (; i < elements.length; i++) {\n if (input.length < i + 1) {\n if (!tsplus_module_4.unsafeGet(i)(ast.elements).isOptional) {\n const e = tsplus_module_7.indexError(i, tsplus_module_7.missingError);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n }\n else {\n const parser = tsplus_module_4.unsafeGet(i)(elements);\n const t = parser(input[i], options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.indexError(i, t.left);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n output.push(t.right);\n }\n }\n if (tsplus_module_9.isJust(rest)) {\n const head = tsplus_module_4.unsafeHead(rest.value);\n const tail = tsplus_module_4.tail(rest.value);\n for (; i < input.length - tail.length; i++) {\n const t = head(input[i], options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.indexError(i, t.left);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n output.push(t.right);\n }\n for (let j = 0; j < tail.length; j++) {\n i += j;\n if (input.length < i + 1) {\n const e = tsplus_module_7.indexError(i, tsplus_module_7.missingError);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n else {\n const t = tsplus_module_4.unsafeGet(j)(tail)(input[i], options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.indexError(i, t.left);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n output.push(t.right);\n }\n }\n }\n else {\n const isUnexpectedAllowed = options?.isUnexpectedAllowed;\n for (; i < input.length; i++) {\n const e = tsplus_module_7.indexError(i, tsplus_module_7.unexpectedError(input[i]));\n if (!isUnexpectedAllowed) {\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n }\n }\n return tsplus_module_4.isNonEmpty(errors)\n ? tsplus_module_3.fail(tsplus_module_7.tupleError(ast, input, errors, output))\n : tsplus_module_3.succeed(output);\n });\n }\n case 17 /* ASTTag.TypeLiteral */: {\n if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) {\n return tsplus_module_2.fromRefinement(ast, (u) => u !== null);\n }\n const propertySignatureTypes = tsplus_module_4.map((f) => goMemo(f.type, isDecoding))(ast.propertySignatures);\n const indexSignatures = tsplus_module_4.map((is) => [goMemo(is.parameter, isDecoding), goMemo(is.type, isDecoding)])(ast.indexSignatures);\n return tsplus_module_2.make((input, options) => {\n if (!isRecord(input)) {\n return tsplus_module_3.fail(tsplus_module_7.typeError(tsplus_module_6.unknownRecord, input));\n }\n const output = {};\n const expectedKeys = {};\n const errors = tsplus_module_4.emptyPushable();\n const allErrors = options?.allErrors;\n for (let i = 0; i < propertySignatureTypes.length; i++) {\n const ps = tsplus_module_4.unsafeGet(i)(ast.propertySignatures);\n const parser = tsplus_module_4.unsafeGet(i)(propertySignatureTypes);\n const name = ps.name;\n expectedKeys[name] = null;\n if (!Object.prototype.hasOwnProperty.call(input, name)) {\n if (!ps.isOptional) {\n const e = tsplus_module_7.keyError(tsplus_module_6.createKey(name), name, tsplus_module_7.missingError);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n }\n else {\n const t = parser(input[name], options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.keyError(tsplus_module_6.createKey(name), name, t.left);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n output[name] = t.right;\n }\n }\n if (indexSignatures.length > 0) {\n for (let i = 0; i < indexSignatures.length; i++) {\n const [parameter, type] = tsplus_module_4.unsafeGet(i)(indexSignatures);\n const keys = getKeysForIndexSignature(input, tsplus_module_4.unsafeGet(i)(ast.indexSignatures).parameter);\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(expectedKeys, key)) {\n continue;\n }\n let t = parameter(key, options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.keyError(tsplus_module_6.createKey(key), key, t.left);\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n t = type(input[key], options);\n void 0;\n if (tsplus_module_1.isLeft(t)) {\n const e = tsplus_module_7.keyError(tsplus_module_6.createKey(key), key, t.left);\n tsplus_module_8.push(e)(errors);\n if (allErrors) {\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n output[key] = t.right;\n }\n }\n }\n else {\n const isUnexpectedAllowed = options?.isUnexpectedAllowed;\n for (const key of ownKeys(input)) {\n if (!Object.prototype.hasOwnProperty.call(expectedKeys, key)) {\n if (!isUnexpectedAllowed) {\n const e = tsplus_module_7.keyError(tsplus_module_6.createKey(key), key, tsplus_module_7.unexpectedError(input[key]));\n if (allErrors) {\n tsplus_module_8.push(e)(errors);\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, tsplus_module_4.vector(e), output));\n }\n }\n }\n }\n }\n return tsplus_module_4.isNonEmpty(errors)\n ? tsplus_module_3.fail(tsplus_module_7.typeLiteralError(ast, input, errors, output))\n : tsplus_module_3.succeed(output);\n });\n }\n case 18 /* ASTTag.Union */: {\n const searchTree = getSearchTree(ast.types, isDecoding);\n const ownKeys = Reflect.ownKeys(searchTree.keys);\n const len = ownKeys.length;\n const map = new Map();\n tsplus_module_4.forEach((ast) => {\n map.set(ast, goMemo(ast, isDecoding));\n })(ast.types);\n return tsplus_module_2.make((input, options) => {\n const errors = tsplus_module_4.emptyPushable();\n let candidates = [];\n if (len > 0) {\n if (isRecord(input)) {\n for (let i = 0; i < len; i++) {\n const name = ownKeys[i];\n const buckets = searchTree.keys[name].buckets;\n if (Object.prototype.hasOwnProperty.call(input, name)) {\n const literal = String(input[name]);\n if (Object.prototype.hasOwnProperty.call(buckets, literal)) {\n candidates = candidates.concat(buckets[literal]);\n }\n else {\n const literals = tsplus_module_6.createUnion(tsplus_module_4.from(searchTree.keys[name].literals));\n tsplus_module_8.push(tsplus_module_7.typeLiteralError(tsplus_module_6.createTypeLiteral(tsplus_module_4.vector(tsplus_module_6.createPropertySignature(name, literals, false, true)), tsplus_module_4.vector()), input, tsplus_module_4.vector(tsplus_module_7.keyError(tsplus_module_6.createKey(name), name, tsplus_module_7.typeError(searchTree.keys[name].ast, input[name])))))(errors);\n }\n }\n else {\n const literals = tsplus_module_6.createUnion(tsplus_module_4.from(searchTree.keys[name].literals));\n tsplus_module_8.push(tsplus_module_7.typeLiteralError(tsplus_module_6.createTypeLiteral(tsplus_module_4.vector(tsplus_module_6.createPropertySignature(name, literals, false, true)), tsplus_module_4.vector()), input, tsplus_module_4.vector(tsplus_module_7.keyError(tsplus_module_6.createKey(name), name, tsplus_module_7.missingError))))(errors);\n }\n }\n }\n else {\n tsplus_module_8.push(tsplus_module_7.typeError(tsplus_module_6.unknownRecord, input))(errors);\n }\n }\n if (searchTree.otherwise.length > 0) {\n candidates = candidates.concat(searchTree.otherwise);\n }\n for (let i = 0; i < candidates.length; i++) {\n const candidate = candidates[i];\n const pr = map.get(candidate)(input, options);\n void 0;\n if (tsplus_module_1.isRight(pr)) {\n return pr;\n }\n else {\n tsplus_module_8.push(tsplus_module_7.unionMemberError(candidate, pr.left))(errors);\n }\n }\n return tsplus_module_4.isNonEmpty(errors)\n ? errors.length === 1 && tsplus_module_4.unsafeGet(0)(errors)._tag === 1 /* ParseErrorTag.Type */\n ? tsplus_module_3.fail(tsplus_module_4.unsafeGet(0)(errors))\n : tsplus_module_3.fail(tsplus_module_7.unionError(ast, input, tsplus_module_4.from(errors)))\n : tsplus_module_3.fail(tsplus_module_7.typeError(tsplus_module_6.neverKeyword, input));\n });\n }\n case 19 /* ASTTag.Lazy */: {\n const f = () => goMemo(ast.getAST(), isDecoding);\n const get = memoize(f);\n return tsplus_module_2.make((a, options) => get()(a, options));\n }\n case 20 /* ASTTag.Refinement */: {\n if (isDecoding) {\n const from = goMemo(ast.from, isDecoding);\n return tsplus_module_2.make((input, options) => tsplus_module_1.flatMap((a) => tsplus_module_1.mapLeft((failure) => tsplus_module_7.refinementError(ast, input, \"Predicate\", failure))(ast.decode(a, options)))(tsplus_module_1.mapLeft((failure) => tsplus_module_7.refinementError(ast, input, \"From\", failure))(from(input, options))));\n }\n else {\n const from = goMemo(ast.from, true);\n const to = goMemo(tsplus_module_6.getTo(ast.from), false);\n return tsplus_module_2.make((input, options) => tsplus_module_1.flatMap((a) => from(a, options))(tsplus_module_1.flatMap((a) => ast.decode(a, options))(to(input, options))));\n }\n }\n case 21 /* ASTTag.Transform */: {\n const transformation = isDecoding ? ast.decode : ast.encode;\n const from = isDecoding ? goMemo(ast.from, true) : goMemo(ast.to, false);\n const to = isDecoding ? goMemo(ast.to, true) : goMemo(ast.from, false);\n return tsplus_module_2.make((input, options) => tsplus_module_1.flatMap((a) => tsplus_module_1.mapLeft((failure) => tsplus_module_7.transformationError(ast, input, isDecoding ? \"Type\" : \"Encoded\", failure))(to(a, options)))(tsplus_module_1.flatMap((a) => tsplus_module_1.mapLeft((failure) => tsplus_module_7.transformationError(ast, input, \"Transformation\", failure))(transformation(a, options)))(tsplus_module_1.mapLeft((failure) => tsplus_module_7.transformationError(ast, input, isDecoding ? \"Encoded\" : \"Type\", failure))(from(input, options)))));\n }\n case 22 /* ASTTag.Validation */: {\n return tsplus_module_2.make((u, options) => {\n const missedBrands = tsplus_module_4.emptyPushable();\n const allErrors = options?.allErrors;\n for (const validation of ast.validation) {\n if (!validation.validate(u)) {\n tsplus_module_8.push(validation)(missedBrands);\n if (allErrors) {\n continue;\n }\n else {\n return tsplus_module_3.fail(tsplus_module_7.typeError(tsplus_module_6.createValidation(ast.from, missedBrands, ast.annotations), u));\n }\n }\n }\n return missedBrands.length > 0\n ? tsplus_module_3.fail(tsplus_module_7.typeError(tsplus_module_6.createValidation(ast.from, missedBrands, ast.annotations), u))\n : tsplus_module_3.succeed(u);\n });\n }\n }\n}\nexport function parserFor(ast, isDecoding) {\n return goMemo(ast, isDecoding);\n}\n//# sourceMappingURL=interpreter.js.map"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,gBAAgB,YAAY,OAAO,IAAI,oCAAoC,wBAAQ,IAAI,SAAS,CAAC;AACvG,MAAM,gBAAgB,YAAY,OAAO,IAAI,oCAAoC,wBAAQ,IAAI,SAAS,CAAC;AACvG,SAAS,OAAO,KAAK,YA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IAAI,MAAM,cAAc,IAAI,YAAY,EAAE,EAAE,CAAC;;AAIhJ,UAAO,aAAa,SAAS,IACvB,gBAAgB,KAAK,gBAAgB,UAAU,gBAAgB,iBAAiB,IAAI,MAAM,cAAc,IAAI,YAAY,EAAE,EAAE,CAAC,GAC7H,gBAAgB,QAAQ,EAAE;IAClC;;;AAId,SAAgB,UAAU,KAAK,YAAY;AACvC,QAAO,OAAO,KAAK,WAAW"}
|
package/_mjs/Parser.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
//# sourceMappingURL=Parser.mjs.map
|
|
1
|
+
import { parserFor } from "./Parser/interpreter.mjs";
|
|
2
|
+
import { asserts, decode, decodeMaybe, encode, encodeMaybe } from "./Parser/api.mjs";
|
|
3
|
+
import { fromRefinement, make } from "./Parser/definition.mjs";
|
|
4
|
+
export { asserts, decode, decodeMaybe, encode, encodeMaybe, fromRefinement, make, parserFor };
|
package/_mjs/Schema/api/conc.mjs
CHANGED
|
@@ -1,63 +1,59 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/schema/ASTAnnotation";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
3
1
|
import * as tsplus_module_3 from "@fncts/base/collection/immutable/Vector/api";
|
|
4
|
-
import * as
|
|
5
|
-
import * as tsplus_module_5 from "@fncts/base/collection/immutable/Conc/definition";
|
|
6
|
-
import * as tsplus_module_6 from "@fncts/base/data/function/api";
|
|
7
|
-
import * as tsplus_module_7 from "@fncts/schema/ParseError/ParseError";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/schema/ASTAnnotation";
|
|
8
3
|
import * as tsplus_module_8 from "@fncts/schema/ParseResult";
|
|
9
4
|
import * as tsplus_module_9 from "@fncts/schema/Parser/api";
|
|
10
|
-
import * as
|
|
5
|
+
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
6
|
+
import * as tsplus_module_7 from "@fncts/schema/ParseError/ParseError";
|
|
11
7
|
import * as tsplus_module_11 from "@fncts/base/collection/immutable/Vector/internal";
|
|
12
8
|
import * as tsplus_module_12 from "@fncts/base/collection/immutable/Conc/constructors";
|
|
9
|
+
import * as tsplus_module_4 from "@fncts/schema/Schema/api";
|
|
10
|
+
import "@fncts/base/data/function/api";
|
|
11
|
+
import * as tsplus_module_5 from "@fncts/base/collection/immutable/Conc/definition";
|
|
12
|
+
import * as tsplus_module_10 from "@fncts/base/data/Either/api";
|
|
13
13
|
import * as tsplus_module_13 from "@fncts/schema/Parser/definition";
|
|
14
14
|
import * as tsplus_module_14 from "@fncts/test/control/Gen/api";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
//#region build/esm/Schema/api/conc.js
|
|
16
|
+
const concFromArray = concFromArray_1;
|
|
17
|
+
function conc(value) {
|
|
18
|
+
return tsplus_module_4.annotate(tsplus_module_1.GenHook, gen)(tsplus_module_4.annotate(tsplus_module_1.Identifier, `Conc<${tsplus_module_2.show()(value)}>`)(tsplus_module_4.declaration(tsplus_module_3.vector(value), concParser(true), concParser(false))));
|
|
18
19
|
}
|
|
19
20
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
* @tsplus static fncts.schema.SchemaOps concFromArray
|
|
22
|
+
*/
|
|
22
23
|
function concFromArray_1(value) {
|
|
23
|
-
|
|
24
|
+
return tsplus_module_4.transform(conc(value), (input) => tsplus_module_5.fromArray(input), (input) => tsplus_module_5.toArray(input))(tsplus_module_4.array(value));
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* @tsplus derive fncts.schema.Schema[fncts.Conc]<_> 10
|
|
28
|
+
*/
|
|
29
|
+
function deriveConc(...[value]) {
|
|
30
|
+
return concFromArray_1(value);
|
|
30
31
|
}
|
|
31
32
|
function concParser(isDecoding) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
out.push(t.right);
|
|
53
|
-
}
|
|
54
|
-
i++;
|
|
55
|
-
}
|
|
56
|
-
return tsplus_module_3.isNonEmpty(errors) ? tsplus_module_8.fail(tsplus_module_7.iterableError(schema.ast, u, errors)) : tsplus_module_8.succeed(tsplus_module_12.from(out));
|
|
57
|
-
});
|
|
58
|
-
};
|
|
33
|
+
return (value) => {
|
|
34
|
+
const schema = conc(value);
|
|
35
|
+
return tsplus_module_13.make((u, options) => {
|
|
36
|
+
if (!tsplus_module_5.isConc(u)) return tsplus_module_8.fail(tsplus_module_7.typeError(schema.ast, u));
|
|
37
|
+
const allErrors = options?.allErrors;
|
|
38
|
+
const errors = tsplus_module_3.emptyPushable();
|
|
39
|
+
const out = [];
|
|
40
|
+
let i = 0;
|
|
41
|
+
for (const v of u) {
|
|
42
|
+
const t = (isDecoding ? tsplus_module_9.decode(value) : tsplus_module_9.encode(value))(v, options);
|
|
43
|
+
if (tsplus_module_10.isLeft(t)) {
|
|
44
|
+
tsplus_module_11.push(tsplus_module_7.indexError(i, t.left))(errors);
|
|
45
|
+
if (!allErrors) return tsplus_module_8.fail(tsplus_module_7.iterableError(schema.ast, u, errors));
|
|
46
|
+
} else out.push(t.right);
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
return tsplus_module_3.isNonEmpty(errors) ? tsplus_module_8.fail(tsplus_module_7.iterableError(schema.ast, u, errors)) : tsplus_module_8.succeed(tsplus_module_12.from(out));
|
|
50
|
+
});
|
|
51
|
+
};
|
|
59
52
|
}
|
|
60
53
|
function gen(value) {
|
|
61
|
-
|
|
54
|
+
return tsplus_module_14.conc(value);
|
|
62
55
|
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { conc, concFromArray, deriveConc };
|
|
58
|
+
|
|
63
59
|
//# sourceMappingURL=conc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conc.mjs","names":[
|
|
1
|
+
{"version":3,"file":"conc.mjs","names":[],"sources":["../../../esm/Schema/api/conc.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_2 from \"@fncts/schema/Show\";\nimport * as tsplus_module_3 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_4 from \"@fncts/schema/Schema/api\";\nimport * as tsplus_module_5 from \"@fncts/base/collection/immutable/Conc/definition\";\nimport * as tsplus_module_6 from \"@fncts/base/data/function/api\";\nimport * as tsplus_module_7 from \"@fncts/schema/ParseError/ParseError\";\nimport * as tsplus_module_8 from \"@fncts/schema/ParseResult\";\nimport * as tsplus_module_9 from \"@fncts/schema/Parser/api\";\nimport * as tsplus_module_10 from \"@fncts/base/data/Either/api\";\nimport * as tsplus_module_11 from \"@fncts/base/collection/immutable/Vector/internal\";\nimport * as tsplus_module_12 from \"@fncts/base/collection/immutable/Conc/constructors\";\nimport * as tsplus_module_13 from \"@fncts/schema/Parser/definition\";\nimport * as tsplus_module_14 from \"@fncts/test/control/Gen/api\";\nexport const concFromArray = concFromArray_1;\nexport function conc(value) {\n return tsplus_module_4.annotate(tsplus_module_1.GenHook, gen)(tsplus_module_4.annotate(tsplus_module_1.Identifier, `Conc<${tsplus_module_2.show()(value)}>`)(tsplus_module_4.declaration(tsplus_module_3.vector(value), concParser(true), concParser(false))));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps concFromArray\n */\nfunction concFromArray_1(value) {\n return tsplus_module_4.transform(conc(value), (input) => tsplus_module_5.fromArray(input), (input) => tsplus_module_5.toArray(input))(tsplus_module_4.array(value));\n}\n/**\n * @tsplus derive fncts.schema.Schema[fncts.Conc]<_> 10\n */\nexport function deriveConc(...[value]) {\n return concFromArray_1(value);\n}\nfunction concParser(isDecoding) {\n return (value) => {\n const schema = conc(value);\n return tsplus_module_13.make((u, options) => {\n if (!tsplus_module_5.isConc(u)) {\n return tsplus_module_8.fail(tsplus_module_7.typeError(schema.ast, u));\n }\n const allErrors = options?.allErrors;\n const errors = tsplus_module_3.emptyPushable();\n const out = [];\n let i = 0;\n for (const v of u) {\n const parser = isDecoding ? tsplus_module_9.decode(value) : tsplus_module_9.encode(value);\n const t = parser(v, options);\n void 0;\n if (tsplus_module_10.isLeft(t)) {\n tsplus_module_11.push(tsplus_module_7.indexError(i, t.left))(errors);\n if (!allErrors) {\n return tsplus_module_8.fail(tsplus_module_7.iterableError(schema.ast, u, errors));\n }\n }\n else {\n out.push(t.right);\n }\n i++;\n }\n return tsplus_module_3.isNonEmpty(errors)\n ? tsplus_module_8.fail(tsplus_module_7.iterableError(schema.ast, u, errors))\n : tsplus_module_8.succeed(tsplus_module_12.from(out));\n });\n };\n}\nfunction gen(value) {\n return tsplus_module_14.conc(value);\n}\n//# sourceMappingURL=conc.js.map"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAa,gBAAgB;AAC7B,SAAgB,KAAK,OAAO;AACxB,QAAO,gBAAgB,SAAS,gBAAgB,SAAS,IAAI,CAAC,gBAAgB,SAAS,gBAAgB,YAAY,QAAQ,gBAAgB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,YAAY,gBAAgB,OAAO,MAAM,EAAE,WAAW,KAAK,EAAE,WAAW,MAAM,CAAC,CAAC,CAAC;;;;;AAKlQ,SAAS,gBAAgB,OAAO;AAC5B,QAAO,gBAAgB,UAAU,KAAK,MAAM,GAAG,UAAU,gBAAgB,UAAU,MAAM,GAAG,UAAU,gBAAgB,QAAQ,MAAM,CAAC,CAAC,gBAAgB,MAAM,MAAM,CAAC;;;;;AAKvK,SAAgB,WAAW,GAAG,CAAC,QAAQ;AACnC,QAAO,gBAAgB,MAAM;;AAEjC,SAAS,WAAW,YAAY;AAC5B,SAAQ,UAAU;EACd,MAAM,SAAS,KAAK,MAAM;AAC1B,SAAO,iBAAiB,MAAM,GAAG,YAAY;AACzC,OAAI,CAAC,gBAAgB,OAAO,EAAE,CAC1B,QAAO,gBAAgB,KAAK,gBAAgB,UAAU,OAAO,KAAK,EAAE,CAAC;GAEzE,MAAM,YAAY,SAAS;GAC3B,MAAM,SAAS,gBAAgB,eAAe;GAC9C,MAAM,MAAM,EAAE;GACd,IAAI,IAAI;AACR,QAAK,MAAM,KAAK,GAAG;IAEf,MAAM,KADS,aAAa,gBAAgB,OAAO,MAAM,GAAG,gBAAgB,OAAO,MAAM,EACxE,GAAG,QAAQ;AAE5B,QAAI,iBAAiB,OAAO,EAAE,EAAE;AAC5B,sBAAiB,KAAK,gBAAgB,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC,OAAO;AACpE,SAAI,CAAC,UACD,QAAO,gBAAgB,KAAK,gBAAgB,cAAc,OAAO,KAAK,GAAG,OAAO,CAAC;UAIrF,KAAI,KAAK,EAAE,MAAM;AAErB;;AAEJ,UAAO,gBAAgB,WAAW,OAAO,GACnC,gBAAgB,KAAK,gBAAgB,cAAc,OAAO,KAAK,GAAG,OAAO,CAAC,GAC1E,gBAAgB,QAAQ,iBAAiB,KAAK,IAAI,CAAC;IAC3D;;;AAGV,SAAS,IAAI,OAAO;AAChB,QAAO,iBAAiB,KAAK,MAAM"}
|
|
@@ -1,79 +1,73 @@
|
|
|
1
|
-
|
|
1
|
+
import * as tsplus_module_3 from "@fncts/base/collection/immutable/Vector/api";
|
|
2
2
|
import * as tsplus_module_1 from "@fncts/schema/ASTAnnotation";
|
|
3
|
+
import * as tsplus_module_9 from "@fncts/schema/ParseResult";
|
|
4
|
+
import * as tsplus_module_10 from "@fncts/schema/Parser/api";
|
|
3
5
|
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
4
|
-
import * as
|
|
6
|
+
import * as tsplus_module_8 from "@fncts/schema/ParseError/ParseError";
|
|
5
7
|
import * as tsplus_module_4 from "@fncts/schema/Schema/api";
|
|
6
|
-
import
|
|
8
|
+
import "@fncts/base/data/function/api";
|
|
7
9
|
import * as tsplus_module_6 from "@fncts/base/data/Either/api";
|
|
8
|
-
import * as tsplus_module_7 from "@fncts/base/data/function/api";
|
|
9
|
-
import * as tsplus_module_8 from "@fncts/schema/ParseError/ParseError";
|
|
10
|
-
import * as tsplus_module_9 from "@fncts/schema/ParseResult";
|
|
11
|
-
import * as tsplus_module_10 from "@fncts/schema/Parser/api";
|
|
12
10
|
import * as tsplus_module_11 from "@fncts/schema/Parser/definition";
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
import * as tsplus_module_5 from "@fncts/base/data/Either/constructors";
|
|
12
|
+
//#region build/esm/Schema/api/either.js
|
|
13
|
+
const fileName_1 = "(@fncts/schema) src/Schema/api/either.ts";
|
|
14
|
+
const either = either_1;
|
|
15
|
+
const eitherFromJson = eitherFromJson_1;
|
|
15
16
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
* @tsplus static fncts.schema.SchemaOps either
|
|
18
|
+
*/
|
|
18
19
|
function either_1(left, right) {
|
|
19
|
-
|
|
20
|
+
return tsplus_module_4.annotate(tsplus_module_1.Identifier, `Either<${tsplus_module_2.show()(left)}, ${tsplus_module_2.show()(right)}>`)(tsplus_module_4.declaration(tsplus_module_3.vector(left, right), eitherParser(true), eitherParser(false)));
|
|
20
21
|
}
|
|
21
22
|
function eitherJson(left, right) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
return tsplus_module_4.union(tsplus_module_4.struct({
|
|
24
|
+
_tag: tsplus_module_4.literal("Left"),
|
|
25
|
+
left
|
|
26
|
+
}), tsplus_module_4.struct({
|
|
27
|
+
_tag: tsplus_module_4.literal("Right"),
|
|
28
|
+
right
|
|
29
|
+
}));
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
* @tsplus static fncts.schema.SchemaOps eitherFromJson
|
|
33
|
+
*/
|
|
33
34
|
function eitherFromJson_1(left, right) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} else {
|
|
48
|
-
return {
|
|
49
|
-
_tag: "Right",
|
|
50
|
-
right: input.right
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
})(eitherJson(left, right));
|
|
35
|
+
return tsplus_module_4.transform(either_1(left, right), (input) => {
|
|
36
|
+
if (input._tag === "Left") return tsplus_module_5.left(input.left, fileName_1 + ":34:27");
|
|
37
|
+
else return tsplus_module_5.right(input.right, fileName_1 + ":36:28");
|
|
38
|
+
}, (input) => {
|
|
39
|
+
if (tsplus_module_6.isLeft(input)) return {
|
|
40
|
+
_tag: "Left",
|
|
41
|
+
left: input.left
|
|
42
|
+
};
|
|
43
|
+
else return {
|
|
44
|
+
_tag: "Right",
|
|
45
|
+
right: input.right
|
|
46
|
+
};
|
|
47
|
+
})(eitherJson(left, right));
|
|
54
48
|
}
|
|
55
49
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
* @tsplus derive fncts.schema.Schema[fncts.Either]<_> 10
|
|
51
|
+
*/
|
|
52
|
+
function deriveEither(...[left, right]) {
|
|
53
|
+
return eitherFromJson_1(left, right);
|
|
60
54
|
}
|
|
61
55
|
function eitherParser(isDecoding) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
56
|
+
return (left, right) => {
|
|
57
|
+
const schema = either_1(left, right);
|
|
58
|
+
return tsplus_module_11.make((u, options) => {
|
|
59
|
+
if (!tsplus_module_6.isEither(u)) return tsplus_module_9.fail(tsplus_module_8.typeError(schema.ast, u));
|
|
60
|
+
if (tsplus_module_6.isLeft(u)) {
|
|
61
|
+
const parse = isDecoding ? tsplus_module_10.decode(left) : tsplus_module_10.encode(left);
|
|
62
|
+
return tsplus_module_6.map(tsplus_module_5.left)(parse(u.left, options));
|
|
63
|
+
} else {
|
|
64
|
+
const parse = isDecoding ? tsplus_module_10.decode(right) : tsplus_module_10.encode(right);
|
|
65
|
+
return tsplus_module_6.map(tsplus_module_5.right)(parse(u.right, options));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
78
69
|
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { deriveEither, either, eitherFromJson };
|
|
72
|
+
|
|
79
73
|
//# sourceMappingURL=either.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"either.mjs","names":["either","
|
|
1
|
+
{"version":3,"file":"either.mjs","names":[],"sources":["../../../esm/Schema/api/either.js"],"sourcesContent":["const fileName_1 = \"(@fncts/schema) src/Schema/api/either.ts\";\nimport * as tsplus_module_1 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_2 from \"@fncts/schema/Show\";\nimport * as tsplus_module_3 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_4 from \"@fncts/schema/Schema/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Either/constructors\";\nimport * as tsplus_module_6 from \"@fncts/base/data/Either/api\";\nimport * as tsplus_module_7 from \"@fncts/base/data/function/api\";\nimport * as tsplus_module_8 from \"@fncts/schema/ParseError/ParseError\";\nimport * as tsplus_module_9 from \"@fncts/schema/ParseResult\";\nimport * as tsplus_module_10 from \"@fncts/schema/Parser/api\";\nimport * as tsplus_module_11 from \"@fncts/schema/Parser/definition\";\nexport const either = either_1;\nexport const eitherFromJson = eitherFromJson_1;\n/**\n * @tsplus static fncts.schema.SchemaOps either\n */\nfunction either_1(left, right) {\n return tsplus_module_4.annotate(tsplus_module_1.Identifier, `Either<${tsplus_module_2.show()(left)}, ${tsplus_module_2.show()(right)}>`)(tsplus_module_4.declaration(tsplus_module_3.vector(left, right), eitherParser(true), eitherParser(false)));\n}\nfunction eitherJson(left, right) {\n return tsplus_module_4.union(tsplus_module_4.struct({\n _tag: tsplus_module_4.literal(\"Left\"),\n left,\n }), tsplus_module_4.struct({\n _tag: tsplus_module_4.literal(\"Right\"),\n right,\n }));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps eitherFromJson\n */\nfunction eitherFromJson_1(left, right) {\n return tsplus_module_4.transform(either_1(left, right), (input) => {\n if (input._tag === \"Left\") {\n return tsplus_module_5.left(input.left, fileName_1 + \":34:27\");\n }\n else {\n return tsplus_module_5.right(input.right, fileName_1 + \":36:28\");\n }\n }, (input) => {\n void 0;\n if (tsplus_module_6.isLeft(input)) {\n return {\n _tag: \"Left\",\n left: input.left,\n };\n }\n else {\n return {\n _tag: \"Right\",\n right: input.right,\n };\n }\n })(eitherJson(left, right));\n}\n/**\n * @tsplus derive fncts.schema.Schema[fncts.Either]<_> 10\n */\nexport function deriveEither(...[left, right]) {\n return eitherFromJson_1(left, right);\n}\nfunction eitherParser(isDecoding) {\n return (left, right) => {\n const schema = either_1(left, right);\n return tsplus_module_11.make((u, options) => {\n if (!tsplus_module_6.isEither(u)) {\n return tsplus_module_9.fail(tsplus_module_8.typeError(schema.ast, u));\n }\n void 0;\n if (tsplus_module_6.isLeft(u)) {\n const parse = isDecoding ? tsplus_module_10.decode(left) : tsplus_module_10.encode(left);\n return tsplus_module_6.map(tsplus_module_5.left)(parse(u.left, options));\n }\n else {\n const parse = isDecoding ? tsplus_module_10.decode(right) : tsplus_module_10.encode(right);\n return tsplus_module_6.map(tsplus_module_5.right)(parse(u.right, options));\n }\n });\n };\n}\n//# sourceMappingURL=either.js.map"],"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EAAE,CAAC;AAGzE,OAAI,gBAAgB,OAAO,EAAE,EAAE;IAC3B,MAAM,QAAQ,aAAa,iBAAiB,OAAO,KAAK,GAAG,iBAAiB,OAAO,KAAK;AACxF,WAAO,gBAAgB,IAAI,gBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,QAAQ,CAAC;UAEvE;IACD,MAAM,QAAQ,aAAa,iBAAiB,OAAO,MAAM,GAAG,iBAAiB,OAAO,MAAM;AAC1F,WAAO,gBAAgB,IAAI,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,QAAQ,CAAC;;IAEhF"}
|
|
@@ -1,90 +1,80 @@
|
|
|
1
|
-
import * as tsplus_module_1 from "@fncts/schema/ASTAnnotation";
|
|
2
|
-
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
3
1
|
import * as tsplus_module_3 from "@fncts/base/collection/immutable/Vector/api";
|
|
4
|
-
import * as
|
|
5
|
-
import * as tsplus_module_5 from "@fncts/base/collection/immutable/HashMap/api";
|
|
6
|
-
import * as tsplus_module_6 from "@fncts/base/data/function/api";
|
|
7
|
-
import * as tsplus_module_7 from "@fncts/base/collection/immutable/HashMap/definition";
|
|
8
|
-
import * as tsplus_module_8 from "@fncts/schema/ParseError/ParseError";
|
|
2
|
+
import * as tsplus_module_1 from "@fncts/schema/ASTAnnotation";
|
|
9
3
|
import * as tsplus_module_9 from "@fncts/schema/ParseResult";
|
|
10
4
|
import * as tsplus_module_10 from "@fncts/schema/Parser/api";
|
|
11
|
-
import * as
|
|
5
|
+
import * as tsplus_module_2 from "@fncts/schema/Show";
|
|
6
|
+
import * as tsplus_module_8 from "@fncts/schema/ParseError/ParseError";
|
|
12
7
|
import * as tsplus_module_12 from "@fncts/base/collection/immutable/Vector/internal";
|
|
8
|
+
import * as tsplus_module_5 from "@fncts/base/collection/immutable/HashMap/api";
|
|
9
|
+
import * as tsplus_module_4 from "@fncts/schema/Schema/api";
|
|
10
|
+
import "@fncts/base/data/function/api";
|
|
11
|
+
import * as tsplus_module_11 from "@fncts/base/data/Either/api";
|
|
13
12
|
import * as tsplus_module_13 from "@fncts/schema/Parser/definition";
|
|
14
13
|
import * as tsplus_module_14 from "@fncts/test/control/Gen/api";
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import * as tsplus_module_7 from "@fncts/base/collection/immutable/HashMap/definition";
|
|
15
|
+
//#region build/esm/Schema/api/hashMap.js
|
|
16
|
+
const hashMap = hashMap_1;
|
|
17
|
+
const hashMapFromRecord = hashMapFromRecord_1;
|
|
17
18
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
* @tsplus static fncts.schema.SchemaOps hashMap
|
|
20
|
+
*/
|
|
20
21
|
function hashMap_1(key, value) {
|
|
21
|
-
|
|
22
|
+
return tsplus_module_4.annotate(tsplus_module_1.GenHook, gen)(tsplus_module_4.annotate(tsplus_module_1.Identifier, `HashMap<${tsplus_module_2.show()(key)}, ${tsplus_module_2.show()(value)}>`)(tsplus_module_4.declaration(tsplus_module_3.vector(key, value), hashMapParser(true), hashMapParser(false))));
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
* @tsplus static fncts.schema.SchemaOps hashMapFromRecord
|
|
26
|
+
*/
|
|
26
27
|
function hashMapFromRecord_1(key, value) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return out;
|
|
39
|
-
})(tsplus_module_4.record(key, value));
|
|
28
|
+
return tsplus_module_4.transform(hashMap_1(key, value), (input) => {
|
|
29
|
+
const out = tsplus_module_5.beginMutation(tsplus_module_5.empty());
|
|
30
|
+
for (const [k, v] of Object.entries(input)) tsplus_module_5.set(k, v)(out);
|
|
31
|
+
return tsplus_module_5.endMutation(out);
|
|
32
|
+
}, (input) => {
|
|
33
|
+
const out = {};
|
|
34
|
+
tsplus_module_5.forEachWithIndex((k, v) => {
|
|
35
|
+
out[k] = v;
|
|
36
|
+
})(input);
|
|
37
|
+
return out;
|
|
38
|
+
})(tsplus_module_4.record(key, value));
|
|
40
39
|
}
|
|
41
40
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...[key, value]) {
|
|
47
|
-
return hashMapFromRecord_1(key, value);
|
|
41
|
+
* @tsplus derive fncts.schema.Schema[fncts.HashMap]<_> 10
|
|
42
|
+
*/
|
|
43
|
+
function deriveHashMap(...[key, value]) {
|
|
44
|
+
return hashMapFromRecord_1(key, value);
|
|
48
45
|
}
|
|
49
46
|
function hashMapParser(isDecoding) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (tsplus_module_11.isLeft(tk) || tsplus_module_11.isLeft(tv)) {
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
tsplus_module_5.set(tk.right, tv.right)(out);
|
|
82
|
-
}
|
|
83
|
-
return tsplus_module_3.isNonEmpty(errors) ? tsplus_module_9.fail(tsplus_module_8.iterableError(schema.ast, u, errors)) : tsplus_module_9.succeed(tsplus_module_5.endMutation(out));
|
|
84
|
-
});
|
|
85
|
-
};
|
|
47
|
+
return (key, value) => {
|
|
48
|
+
const schema = hashMap_1(key, value);
|
|
49
|
+
return tsplus_module_13.make((u, options) => {
|
|
50
|
+
if (!tsplus_module_7.isHashMap(u)) return tsplus_module_9.fail(tsplus_module_8.typeError(schema.ast, u));
|
|
51
|
+
const allErrors = options?.allErrors;
|
|
52
|
+
const errors = tsplus_module_3.emptyPushable();
|
|
53
|
+
const out = tsplus_module_5.beginMutation(tsplus_module_5.empty());
|
|
54
|
+
const keyParser = isDecoding ? tsplus_module_10.decode(key) : tsplus_module_10.encode(key);
|
|
55
|
+
const valueParser = isDecoding ? tsplus_module_10.decode(value) : tsplus_module_10.encode(value);
|
|
56
|
+
for (const [k, v] of u) {
|
|
57
|
+
const tk = keyParser(k, options);
|
|
58
|
+
if (tsplus_module_11.isLeft(tk)) {
|
|
59
|
+
tsplus_module_12.push(tsplus_module_8.keyError(key.ast, k, tk.left))(errors);
|
|
60
|
+
if (!allErrors) return tsplus_module_9.fail(tsplus_module_8.iterableError(schema.ast, u, errors));
|
|
61
|
+
}
|
|
62
|
+
const tv = valueParser(v, options);
|
|
63
|
+
if (tsplus_module_11.isLeft(tv)) {
|
|
64
|
+
tsplus_module_12.push(tsplus_module_8.keyError(key.ast, k, tv.left))(errors);
|
|
65
|
+
if (!allErrors) return tsplus_module_9.fail(tsplus_module_8.iterableError(schema.ast, u, errors));
|
|
66
|
+
}
|
|
67
|
+
if (tsplus_module_11.isLeft(tk) || tsplus_module_11.isLeft(tv)) continue;
|
|
68
|
+
tsplus_module_5.set(tk.right, tv.right)(out);
|
|
69
|
+
}
|
|
70
|
+
return tsplus_module_3.isNonEmpty(errors) ? tsplus_module_9.fail(tsplus_module_8.iterableError(schema.ast, u, errors)) : tsplus_module_9.succeed(tsplus_module_5.endMutation(out));
|
|
71
|
+
});
|
|
72
|
+
};
|
|
86
73
|
}
|
|
87
74
|
function gen(key, value) {
|
|
88
|
-
|
|
75
|
+
return tsplus_module_14.map((pairs) => tsplus_module_5.from(pairs))(tsplus_module_14.array(tsplus_module_14.tuple(key, value)));
|
|
89
76
|
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { deriveHashMap, hashMap, hashMapFromRecord };
|
|
79
|
+
|
|
90
80
|
//# sourceMappingURL=hashMap.mjs.map
|