@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":"ParseError.cjs","names":["hasTag","u","tag","_tag","DeclarationError","ast","actual","error","constructor","tsplus_module_1","equalsSymbol","that","context","comparator","exports","declarationError","TypeError","typeError","expected","TypeLiteralError","errors","output","typeLiteralError","TupleError","tupleError","IndexError","index","indexError","KeyError","keyAST","key","keyError","MissingError","missingError","UnexpectedError","unexpectedError","UnionError","unionError","UnionMemberError","unionMemberError","RefinementError","kind","refinementError","TransformationError","transformationError","IterableError","iterableError"],"sources":["../../_src/ParseError/ParseError.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmCA,SAASA,MAAMA,CAAmCC,CAAU,EAAEC,GAAM;EAClE,OAAO,OAAOD,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAI,MAAM,IAAIA,CAAC,IAAKA,CAAoB,CAACE,IAAI,KAAKD,GAAG;AACjG;AAEA;;;AAGM,MAAOE,gBAAgB;EAGhBC,GAAA;EACAC,MAAA;EACAC,KAAA;EAJFJ,IAAI;EACbK,YACWH,GAAgB,EAChBC,MAAe,EACfC,KAAiB;IAFjB,KAAAF,GAAG,GAAHA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B,IAAI;EACbK,YACWH,GAAQ,EACRC,MAAe,EACfc,MAAqC;IAFrC,KAAAf,GAAG,GAAHA,GAAG;IACH,KAAAC,MAAM,GAANA,MAAM;IACN,KAAAc,MAAM,GAANA,MAAM;EACd;EAEH,CAAAX,eAAA,CAAAC,YAAA,EAAgBC,IAAa,EAAEC,OAAsB;IACnD,OACEZ,MAAM,CAACW,IAAI,kCAAyB,IACpCC,OAAO,CAACC,UAAU,CAAC,IAAI,CAACR,GAAG,EAAEM,IAAI,CAACN,GAAG,CAAC,IACtCO,OAAO,CAACC,UAAU,CAAC,IAAI,CAACP,MAAM,EAAEK,IAAI,CAACL,MAAM,CAAC,IAC5CM,OAAO,CAACC,UAAU,CAAC,IAAI,CAACO,MAAM,EAAET,IAAI,CAACS,MAAM,CAAC;EAEhD;;AAGF;;;;AAAAN,OAAA,CAAA+B,aAAA,GAAAA,aAAA;AAIM,SAAUC,aAAaA,CAACzC,GAAQ,EAAEC,MAAe,EAAEc,MAAqC;EAC5F,OAAO,IAAIyB,aAAa,CAACxC,GAAG,EAAEC,MAAM,EAAEc,MAAM,CAAC;AAC/C","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ParseError.cjs","names":["tsplus_module_1"],"sources":["../../esm/ParseError/ParseError.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/data/Equatable/definition\";\nfunction hasTag(u, tag) {\n return typeof u === \"object\" && u !== null && \"_tag\" in u && u._tag === tag;\n}\n/**\n * @tsplus companion fncts.schema.ParseError.DeclarationError\n */\nexport class DeclarationError {\n ast;\n actual;\n error;\n _tag = 0 /* ParseErrorTag.Declaration */;\n constructor(ast, actual, error) {\n this.ast = ast;\n this.actual = actual;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 0 /* ParseErrorTag.Declaration */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.DeclarationError __call\n * @tsplus static fncts.schema.ParseErrorOps DeclarationError\n */\nexport function declarationError(ast, actual, error) {\n return new DeclarationError(ast, actual, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TypeError\n */\nexport class TypeError {\n ast;\n actual;\n _tag = 1 /* ParseErrorTag.Type */;\n constructor(ast, actual) {\n this.ast = ast;\n this.actual = actual;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 1 /* ParseErrorTag.Type */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TypeError __call\n * @tsplus static fncts.schema.ParseErrorOps TypeError\n */\nexport function typeError(expected, actual) {\n return new TypeError(expected, actual);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TypeLiteralError\n */\nexport class TypeLiteralError {\n ast;\n actual;\n errors;\n output;\n _tag = 9 /* ParseErrorTag.TypeLiteral */;\n constructor(ast, actual, errors, output = {}) {\n this.ast = ast;\n this.actual = actual;\n this.errors = errors;\n this.output = output;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 9 /* ParseErrorTag.TypeLiteral */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.errors, that.errors) &&\n context.comparator(this.output, that.output));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TypeLiteralError __call\n * @tsplus static fncts.schema.ParseErrorOps TypeLiteralError\n */\nexport function typeLiteralError(ast, actual, errors, output = {}) {\n return new TypeLiteralError(ast, actual, errors, output);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TupleError\n */\nexport class TupleError {\n ast;\n actual;\n errors;\n output;\n _tag = 10 /* ParseErrorTag.Tuple */;\n constructor(ast, actual, errors, output = []) {\n this.ast = ast;\n this.actual = actual;\n this.errors = errors;\n this.output = output;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 10 /* ParseErrorTag.Tuple */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.errors, that.errors) &&\n context.comparator(this.output, that.output));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TupleError __call\n * @tsplus static fncts.schema.ParseErrorOps TupleError\n */\nexport function tupleError(ast, actual, errors, output = []) {\n return new TupleError(ast, actual, errors, output);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.IndexError\n */\nexport class IndexError {\n index;\n error;\n _tag = 2 /* ParseErrorTag.Index */;\n constructor(index, error) {\n this.index = index;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 2 /* ParseErrorTag.Index */) &&\n context.comparator(this.index, that.index) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.IndexError __call\n * @tsplus static fncts.schema.ParseErrorOps IndexError\n */\nexport function indexError(index, error) {\n return new IndexError(index, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.KeyError\n */\nexport class KeyError {\n keyAST;\n key;\n error;\n _tag = 3 /* ParseErrorTag.Key */;\n constructor(keyAST, key, error) {\n this.keyAST = keyAST;\n this.key = key;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 3 /* ParseErrorTag.Key */) &&\n context.comparator(this.keyAST, that.keyAST) &&\n context.comparator(this.key, that.key) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.KeyError __call\n * @tsplus static fncts.schema.ParseErrorOps KeyError\n */\nexport function keyError(keyAST, key, error) {\n return new KeyError(keyAST, key, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.MissingError\n */\nexport class MissingError {\n _tag = 4 /* ParseErrorTag.Missing */;\n [tsplus_module_1.equalsSymbol](that) {\n return hasTag(that, 4 /* ParseErrorTag.Missing */);\n }\n}\n/**\n * @tsplus static fncts.schema.ParseErrorOps MissingError\n */\nexport const missingError = new MissingError();\n/**\n * @tsplus companion fncts.schema.ParseError.UnexpectedError\n */\nexport class UnexpectedError {\n actual;\n _tag = 5 /* ParseErrorTag.Unexpected */;\n constructor(actual) {\n this.actual = actual;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return hasTag(that, 5 /* ParseErrorTag.Unexpected */) && context.comparator(this.actual, that.actual);\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnexpectedError __call\n * @tsplus static fncts.schema.ParseErrorOps UnexpectedError\n */\nexport function unexpectedError(actual) {\n return new UnexpectedError(actual);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.UnionError\n */\nexport class UnionError {\n ast;\n actual;\n errors;\n _tag = 11 /* ParseErrorTag.Union */;\n constructor(ast, actual, errors) {\n this.ast = ast;\n this.actual = actual;\n this.errors = errors;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 11 /* ParseErrorTag.Union */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.errors, that.errors));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnionError __call\n * @tsplus static fncts.schema.ParseErrorOps UnionError\n */\nexport function unionError(ast, actual, errors) {\n return new UnionError(ast, actual, errors);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.UnionMemberError\n */\nexport class UnionMemberError {\n ast;\n error;\n _tag = 6 /* ParseErrorTag.UnionMember */;\n constructor(ast, error) {\n this.ast = ast;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 6 /* ParseErrorTag.UnionMember */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.UnionMemberError __call\n * @tsplus static fncts.schema.ParseErrorOps UnionMemberError\n */\nexport function unionMemberError(ast, error) {\n return new UnionMemberError(ast, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.RefinementError\n */\nexport class RefinementError {\n ast;\n actual;\n kind;\n error;\n _tag = 7 /* ParseErrorTag.Refinement */;\n constructor(ast, actual, kind, error) {\n this.ast = ast;\n this.actual = actual;\n this.kind = kind;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 7 /* ParseErrorTag.Refinement */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.kind, that.kind) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.RefinementError __call\n * @tsplus static fncts.schema.ParseErrorOps RefinementError\n */\nexport function refinementError(ast, actual, kind, error) {\n return new RefinementError(ast, actual, kind, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.TransformationError\n */\nexport class TransformationError {\n ast;\n actual;\n kind;\n error;\n _tag = 8 /* ParseErrorTag.Transformation */;\n constructor(ast, actual, kind, error) {\n this.ast = ast;\n this.actual = actual;\n this.kind = kind;\n this.error = error;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 8 /* ParseErrorTag.Transformation */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.kind, that.kind) &&\n context.comparator(this.error, that.error));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.TransformationError __call\n * @tsplus static fncts.schema.ParseErrorOps TransformationError\n */\nexport function transformationError(ast, actual, kind, error) {\n return new TransformationError(ast, actual, kind, error);\n}\n/**\n * @tsplus companion fncts.schema.ParseError.IterableError\n */\nexport class IterableError {\n ast;\n actual;\n errors;\n _tag = 12 /* ParseErrorTag.Iterable */;\n constructor(ast, actual, errors) {\n this.ast = ast;\n this.actual = actual;\n this.errors = errors;\n }\n [tsplus_module_1.equalsSymbol](that, context) {\n return (hasTag(that, 12 /* ParseErrorTag.Iterable */) &&\n context.comparator(this.ast, that.ast) &&\n context.comparator(this.actual, that.actual) &&\n context.comparator(this.errors, that.errors));\n }\n}\n/**\n * @tsplus static fncts.schema.ParseError.IterableError __call\n * @tsplus static fncts.schema.ParseErrorOps IterableError\n */\nexport function iterableError(ast, actual, errors) {\n return new IterableError(ast, actual, errors);\n}\n//# sourceMappingURL=ParseError.js.map"],"mappings":";;;;;AACA,SAAS,OAAO,GAAG,KAAK;AACpB,QAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,UAAU,KAAK,EAAE,SAAS;;;;;AAK5E,IAAa,mBAAb,MAA8B;CAC1B;CACA;CACA;CACA,OAAO;CACP,YAAY,KAAK,QAAQ,OAAO;AAC5B,OAAK,MAAM;AACX,OAAK,SAAS;AACd,OAAK,QAAQ;;CAEjB,CAACA,sCAAgB,cAAc,MAAM,SAAS;AAC1C,SAAQ,OAAO,MAAM,EAAkC,IACnD,QAAQ,WAAW,KAAK,KAAK,KAAK,IAAI,IACtC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO,IAC5C,QAAQ,WAAW,KAAK,OAAO,KAAK,MAAM;;;;;;;AAOtD,SAAgB,iBAAiB,KAAK,QAAQ,OAAO;AACjD,QAAO,IAAI,iBAAiB,KAAK,QAAQ,MAAM;;;;;AAKnD,IAAa,YAAb,MAAuB;CACnB;CACA;CACA,OAAO;CACP,YAAY,KAAK,QAAQ;AACrB,OAAK,MAAM;AACX,OAAK,SAAS;;CAElB,CAACA,sCAAgB,cAAc,MAAM,SAAS;AAC1C,SAAQ,OAAO,MAAM,EAA2B,IAC5C,QAAQ,WAAW,KAAK,KAAK,KAAK,IAAI,IACtC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO;;;;;;;AAOxD,SAAgB,UAAU,UAAU,QAAQ;AACxC,QAAO,IAAI,UAAU,UAAU,OAAO;;;;;AAK1C,IAAa,mBAAb,MAA8B;CAC1B;CACA;CACA;CACA;CACA,OAAO;CACP,YAAY,KAAK,QAAQ,QAAQ,SAAS,EAAE,EAAE;AAC1C,OAAK,MAAM;AACX,OAAK,SAAS;AACd,OAAK,SAAS;AACd,OAAK,SAAS;;CAElB,CAACA,sCAAgB,cAAc,MAA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KAAK,KAAK,KAAK,IAAI,IACtC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO,IAC5C,QAAQ,WAAW,KAAK,MAAM,KAAK,KAAK,IACxC,QAAQ,WAAW,KAAK,OAAO,KAAK,MAAM;;;;;;;AAOtD,SAAgB,oBAAoB,KAAK,QAAQ,MAAM,OAAO;AAC1D,QAAO,IAAI,oBAAoB,KAAK,QAAQ,MAAM,MAAM;;;;;AAK5D,IAAa,gBAAb,MAA2B;CACvB;CACA;CACA;CACA,OAAO;CACP,YAAY,KAAK,QAAQ,QAAQ;AAC7B,OAAK,MAAM;AACX,OAAK,SAAS;AACd,OAAK,SAAS;;CAElB,CAACA,sCAAgB,cAAc,MAAM,SAAS;AAC1C,SAAQ,OAAO,MAAM,GAAgC,IACjD,QAAQ,WAAW,KAAK,KAAK,KAAK,IAAI,IACtC,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO,IAC5C,QAAQ,WAAW,KAAK,QAAQ,KAAK,OAAO;;;;;;;AAOxD,SAAgB,cAAc,KAAK,QAAQ,QAAQ;AAC/C,QAAO,IAAI,cAAc,KAAK,QAAQ,OAAO"}
|
|
@@ -1,93 +1,61 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _TreeFormatter = /*#__PURE__*/require("./TreeFormatter.cjs");
|
|
10
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk.cjs");
|
|
3
|
+
const require_ParseError_TreeFormatter = require("./TreeFormatter.cjs");
|
|
4
|
+
let _fncts_base_data_Maybe_destructors = require("@fncts/base/data/Maybe/destructors");
|
|
5
|
+
_fncts_base_data_Maybe_destructors = require_chunk.__toESM(_fncts_base_data_Maybe_destructors, 1);
|
|
6
|
+
let _fncts_base_collection_Iterable_api = require("@fncts/base/collection/Iterable/api");
|
|
7
|
+
_fncts_base_collection_Iterable_api = require_chunk.__toESM(_fncts_base_collection_Iterable_api, 1);
|
|
8
|
+
//#region build/esm/ParseError/PathFormatter.js
|
|
11
9
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
* @tsplus getter fncts.schema.ParseError flatten
|
|
11
|
+
*/
|
|
14
12
|
function flatten(error) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}];
|
|
51
|
-
}
|
|
52
|
-
case 1 /* ParseErrorTag.Type */:
|
|
53
|
-
{
|
|
54
|
-
return [{
|
|
55
|
-
type: error._tag,
|
|
56
|
-
path: path,
|
|
57
|
-
message: (0, _TreeFormatter.formatTypeError)(error)
|
|
58
|
-
}];
|
|
59
|
-
}
|
|
60
|
-
case 0 /* ParseErrorTag.Declaration */:
|
|
61
|
-
case 8 /* ParseErrorTag.Transformation */:
|
|
62
|
-
case 7 /* ParseErrorTag.Refinement */:
|
|
63
|
-
{
|
|
64
|
-
return getFlattenedParseError(error, path, () => go(error.error, path));
|
|
65
|
-
}
|
|
66
|
-
case 12 /* ParseErrorTag.Iterable */:
|
|
67
|
-
{
|
|
68
|
-
return getFlattenedParseError(error, path, () => tsplus_module_1.toArray(tsplus_module_1.flatMap(error => {
|
|
69
|
-
switch (error._tag) {
|
|
70
|
-
case 3 /* ParseErrorTag.Key */:
|
|
71
|
-
{
|
|
72
|
-
return go(error.error, path.concat(error.key));
|
|
73
|
-
}
|
|
74
|
-
case 2 /* ParseErrorTag.Index */:
|
|
75
|
-
{
|
|
76
|
-
return go(error.error, path.concat(error.index));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
})(error.errors)));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
13
|
+
return go(error, []);
|
|
14
|
+
function go(error, path) {
|
|
15
|
+
switch (error._tag) {
|
|
16
|
+
case 10: return getFlattenedParseError(error, path, () => _fncts_base_collection_Iterable_api.toArray(_fncts_base_collection_Iterable_api.flatMap((error) => go(error.error, path.concat(error.index)))(error.errors)));
|
|
17
|
+
case 11: return getFlattenedParseError(error, path, () => _fncts_base_collection_Iterable_api.toArray(_fncts_base_collection_Iterable_api.flatMap((error) => {
|
|
18
|
+
if (error._tag === 6) return go(error.error, path);
|
|
19
|
+
else return go(error, path);
|
|
20
|
+
})(error.errors)));
|
|
21
|
+
case 9: return getFlattenedParseError(error, path, () => _fncts_base_collection_Iterable_api.toArray(_fncts_base_collection_Iterable_api.flatMap((key) => go(key.error, path.concat(key.key)))(error.errors)));
|
|
22
|
+
case 4: return [{
|
|
23
|
+
type: error._tag,
|
|
24
|
+
path,
|
|
25
|
+
message: "is missing"
|
|
26
|
+
}];
|
|
27
|
+
case 5: return [{
|
|
28
|
+
type: error._tag,
|
|
29
|
+
path,
|
|
30
|
+
message: "is unexpected"
|
|
31
|
+
}];
|
|
32
|
+
case 1: return [{
|
|
33
|
+
type: error._tag,
|
|
34
|
+
path,
|
|
35
|
+
message: require_ParseError_TreeFormatter.formatTypeError(error)
|
|
36
|
+
}];
|
|
37
|
+
case 0:
|
|
38
|
+
case 8:
|
|
39
|
+
case 7: return getFlattenedParseError(error, path, () => go(error.error, path));
|
|
40
|
+
case 12: return getFlattenedParseError(error, path, () => _fncts_base_collection_Iterable_api.toArray(_fncts_base_collection_Iterable_api.flatMap((error) => {
|
|
41
|
+
switch (error._tag) {
|
|
42
|
+
case 3: return go(error.error, path.concat(error.key));
|
|
43
|
+
case 2: return go(error.error, path.concat(error.index));
|
|
44
|
+
}
|
|
45
|
+
})(error.errors)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
83
48
|
}
|
|
84
49
|
function getFlattenedParseError(error, path, orElse) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
50
|
+
return _fncts_base_data_Maybe_destructors.match(() => orElse(), (message) => {
|
|
51
|
+
return [{
|
|
52
|
+
type: error._tag,
|
|
53
|
+
path,
|
|
54
|
+
message
|
|
55
|
+
}];
|
|
56
|
+
})(require_ParseError_TreeFormatter.getMessage(error));
|
|
92
57
|
}
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.flatten = flatten;
|
|
60
|
+
|
|
93
61
|
//# sourceMappingURL=PathFormatter.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathFormatter.cjs","names":["
|
|
1
|
+
{"version":3,"file":"PathFormatter.cjs","names":["tsplus_module_1","formatTypeError","tsplus_module_2","getMessage"],"sources":["../../esm/ParseError/PathFormatter.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/collection/Iterable/api\";\nimport * as tsplus_module_2 from \"@fncts/base/data/Maybe/destructors\";\nimport { formatTypeError, getMessage } from \"./TreeFormatter.js\";\n/**\n * @tsplus getter fncts.schema.ParseError flatten\n */\nexport function flatten(error) {\n return go(error, []);\n function go(error, path) {\n switch (error._tag) {\n case 10 /* ParseErrorTag.Tuple */: {\n return getFlattenedParseError(error, path, () => tsplus_module_1.toArray(tsplus_module_1.flatMap((error) => go(error.error, path.concat(error.index)))(error.errors)));\n }\n case 11 /* ParseErrorTag.Union */: {\n return getFlattenedParseError(error, path, () => tsplus_module_1.toArray(tsplus_module_1.flatMap((error) => {\n if (error._tag === 6 /* ParseErrorTag.UnionMember */) {\n return go(error.error, path);\n }\n else {\n return go(error, path);\n }\n })(error.errors)));\n }\n case 9 /* ParseErrorTag.TypeLiteral */: {\n return getFlattenedParseError(error, path, () => tsplus_module_1.toArray(tsplus_module_1.flatMap((key) => go(key.error, path.concat(key.key)))(error.errors)));\n }\n case 4 /* ParseErrorTag.Missing */: {\n return [\n {\n type: error._tag,\n path: path,\n message: \"is missing\",\n },\n ];\n }\n case 5 /* ParseErrorTag.Unexpected */: {\n return [\n {\n type: error._tag,\n path: path,\n message: \"is unexpected\",\n },\n ];\n }\n case 1 /* ParseErrorTag.Type */: {\n return [\n {\n type: error._tag,\n path: path,\n message: formatTypeError(error),\n },\n ];\n }\n case 0 /* ParseErrorTag.Declaration */:\n case 8 /* ParseErrorTag.Transformation */:\n case 7 /* ParseErrorTag.Refinement */: {\n return getFlattenedParseError(error, path, () => go(error.error, path));\n }\n case 12 /* ParseErrorTag.Iterable */: {\n return getFlattenedParseError(error, path, () => tsplus_module_1.toArray(tsplus_module_1.flatMap((error) => {\n switch (error._tag) {\n case 3 /* ParseErrorTag.Key */: {\n return go(error.error, path.concat(error.key));\n }\n case 2 /* ParseErrorTag.Index */: {\n return go(error.error, path.concat(error.index));\n }\n }\n })(error.errors)));\n }\n }\n }\n}\nfunction getFlattenedParseError(error, path, orElse) {\n return tsplus_module_2.match(() => orElse(), (message) => {\n return [\n {\n type: error._tag,\n path,\n message,\n },\n ];\n })(getMessage(error));\n}\n//# sourceMappingURL=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,MAAM,OAAO,KAAK,OAAO,MAAM,MAAM,CAAC;;KAG1D,CAAC,MAAM,OAAO,CAAC,CAAC;;;;AAKlC,SAAS,uBAAuB,OAAO,MAAM,QAAQ;AACjD,QAAOE,mCAAgB,YAAY,QAAQ,GAAG,YAAY;AACtD,SAAO,CACH;GACI,MAAM,MAAM;GACZ;GACA;GACH,CACJ;GACH,CAACC,iCAAAA,WAAW,MAAM,CAAC"}
|
|
@@ -1,122 +1,90 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk.cjs");
|
|
3
|
+
let _fncts_base_collection_immutable_Vector_api = require("@fncts/base/collection/immutable/Vector/api");
|
|
4
|
+
_fncts_base_collection_immutable_Vector_api = require_chunk.__toESM(_fncts_base_collection_immutable_Vector_api, 1);
|
|
5
|
+
let _fncts_base_data_Showable = require("@fncts/base/data/Showable");
|
|
6
|
+
let _fncts_base_data_Maybe_api = require("@fncts/base/data/Maybe/api");
|
|
7
|
+
_fncts_base_data_Maybe_api = require_chunk.__toESM(_fncts_base_data_Maybe_api, 1);
|
|
8
|
+
let _fncts_base_data_Maybe_destructors = require("@fncts/base/data/Maybe/destructors");
|
|
9
|
+
_fncts_base_data_Maybe_destructors = require_chunk.__toESM(_fncts_base_data_Maybe_destructors, 1);
|
|
10
|
+
let _fncts_schema_ASTAnnotation = require("@fncts/schema/ASTAnnotation");
|
|
11
|
+
_fncts_schema_ASTAnnotation = require_chunk.__toESM(_fncts_schema_ASTAnnotation, 1);
|
|
12
|
+
let _fncts_base_collection_immutable_RoseTree_api = require("@fncts/base/collection/immutable/RoseTree/api");
|
|
13
|
+
_fncts_base_collection_immutable_RoseTree_api = require_chunk.__toESM(_fncts_base_collection_immutable_RoseTree_api, 1);
|
|
14
|
+
//#region build/esm/ParseError/TreeFormatter.js
|
|
16
15
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
* @tsplus static fncts.schema.ParseErrorOps drawTree
|
|
17
|
+
* @tsplus getter fncts.schema.ParseError drawTree
|
|
18
|
+
*/
|
|
20
19
|
function format(error) {
|
|
21
|
-
|
|
20
|
+
return _fncts_base_collection_immutable_RoseTree_api.draw(go(error));
|
|
22
21
|
}
|
|
23
22
|
function formatActual(actual) {
|
|
24
|
-
|
|
25
|
-
colors: false
|
|
26
|
-
});
|
|
23
|
+
return (0, _fncts_base_data_Showable.showWithOptions)(actual, { colors: false });
|
|
27
24
|
}
|
|
28
25
|
function formatRefinementKind(error) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
case "Predicate":
|
|
35
|
-
{
|
|
36
|
-
return "Predicate refinement failure";
|
|
37
|
-
}
|
|
38
|
-
}
|
|
26
|
+
switch (error.kind) {
|
|
27
|
+
case "From": return "From side refinement failure";
|
|
28
|
+
case "Predicate": return "Predicate refinement failure";
|
|
29
|
+
}
|
|
39
30
|
}
|
|
40
31
|
function formatTransformationKind(error) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
case "Transformation":
|
|
47
|
-
{
|
|
48
|
-
return "Transformation process failure";
|
|
49
|
-
}
|
|
50
|
-
case "Type":
|
|
51
|
-
{
|
|
52
|
-
return "Type side transformation failure";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
32
|
+
switch (error.kind) {
|
|
33
|
+
case "Encoded": return "Encoded side transformation failure";
|
|
34
|
+
case "Transformation": return "Transformation process failure";
|
|
35
|
+
case "Type": return "Type side transformation failure";
|
|
36
|
+
}
|
|
55
37
|
}
|
|
56
38
|
function getMessage(error) {
|
|
57
|
-
|
|
39
|
+
return _fncts_base_data_Maybe_api.map((f) => f(error))(error.ast.annotations.get(_fncts_schema_ASTAnnotation.Message));
|
|
58
40
|
}
|
|
59
41
|
function formatTypeError(error) {
|
|
60
|
-
|
|
42
|
+
return _fncts_base_data_Maybe_api.getOrElse(() => `Expected ${error.ast.toString(true)}, actual ${formatActual(error.actual)}`)(getMessage(error));
|
|
61
43
|
}
|
|
62
44
|
function formatKeyErrors(errors) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return tsplus_module_1.make(`[${error.index}]`, tsplus_module_4.vector(go(error.error)));
|
|
68
|
-
}
|
|
69
|
-
})(errors);
|
|
45
|
+
return _fncts_base_collection_immutable_Vector_api.map((error) => {
|
|
46
|
+
if (error._tag === 3) return _fncts_base_collection_immutable_RoseTree_api.make(`[${String(error.keyAST)}]`, _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
47
|
+
else return _fncts_base_collection_immutable_RoseTree_api.make(`[${error.index}]`, _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
48
|
+
})(errors);
|
|
70
49
|
}
|
|
71
50
|
function getRoseTree(error, orElse) {
|
|
72
|
-
|
|
51
|
+
return _fncts_base_data_Maybe_destructors.match(() => orElse(), (message) => _fncts_base_collection_immutable_RoseTree_api.make(message))(getMessage(error));
|
|
73
52
|
}
|
|
74
53
|
function go(error) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return go(error);
|
|
106
|
-
}
|
|
107
|
-
})(error.errors));
|
|
108
|
-
case 7 /* ParseErrorTag.Refinement */:
|
|
109
|
-
return getRoseTree(error, () => {
|
|
110
|
-
return tsplus_module_1.make(formatRefinementKind(error), tsplus_module_4.vector(go(error.error)));
|
|
111
|
-
});
|
|
112
|
-
case 8 /* ParseErrorTag.Transformation */:
|
|
113
|
-
return getRoseTree(error, () => {
|
|
114
|
-
return tsplus_module_1.make(formatTransformationKind(error), tsplus_module_4.vector(go(error.error)));
|
|
115
|
-
});
|
|
116
|
-
case 12 /* ParseErrorTag.Iterable */:
|
|
117
|
-
return getRoseTree(error, () => {
|
|
118
|
-
return tsplus_module_1.make(error.ast.toString(true), formatKeyErrors(error.errors));
|
|
119
|
-
});
|
|
120
|
-
}
|
|
54
|
+
switch (error._tag) {
|
|
55
|
+
case 1: return _fncts_base_collection_immutable_RoseTree_api.make(formatTypeError(error));
|
|
56
|
+
case 0: return getRoseTree(error, () => {
|
|
57
|
+
if (error.error._tag === 1 && error.error.ast === error.ast) return go(error.error);
|
|
58
|
+
else return _fncts_base_collection_immutable_RoseTree_api.make(error.ast.toString(true), _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
59
|
+
});
|
|
60
|
+
case 5: return _fncts_base_collection_immutable_RoseTree_api.make("is unexpected");
|
|
61
|
+
case 4: return _fncts_base_collection_immutable_RoseTree_api.make("is missing");
|
|
62
|
+
case 9: return getRoseTree(error, () => {
|
|
63
|
+
return _fncts_base_collection_immutable_RoseTree_api.make(error.ast.toString(true), formatKeyErrors(error.errors));
|
|
64
|
+
});
|
|
65
|
+
case 10: return getRoseTree(error, () => {
|
|
66
|
+
return _fncts_base_collection_immutable_RoseTree_api.make(error.ast.toString(true), formatKeyErrors(error.errors));
|
|
67
|
+
});
|
|
68
|
+
case 11: return _fncts_base_collection_immutable_RoseTree_api.make(error.ast.toString(true), _fncts_base_collection_immutable_Vector_api.map((error) => {
|
|
69
|
+
switch (error._tag) {
|
|
70
|
+
case 6: return _fncts_base_collection_immutable_RoseTree_api.make("Union member", _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
71
|
+
default: return go(error);
|
|
72
|
+
}
|
|
73
|
+
})(error.errors));
|
|
74
|
+
case 7: return getRoseTree(error, () => {
|
|
75
|
+
return _fncts_base_collection_immutable_RoseTree_api.make(formatRefinementKind(error), _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
76
|
+
});
|
|
77
|
+
case 8: return getRoseTree(error, () => {
|
|
78
|
+
return _fncts_base_collection_immutable_RoseTree_api.make(formatTransformationKind(error), _fncts_base_collection_immutable_Vector_api.vector(go(error.error)));
|
|
79
|
+
});
|
|
80
|
+
case 12: return getRoseTree(error, () => {
|
|
81
|
+
return _fncts_base_collection_immutable_RoseTree_api.make(error.ast.toString(true), formatKeyErrors(error.errors));
|
|
82
|
+
});
|
|
83
|
+
}
|
|
121
84
|
}
|
|
85
|
+
//#endregion
|
|
86
|
+
exports.format = format;
|
|
87
|
+
exports.formatTypeError = formatTypeError;
|
|
88
|
+
exports.getMessage = getMessage;
|
|
89
|
+
|
|
122
90
|
//# sourceMappingURL=TreeFormatter.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeFormatter.cjs","names":["
|
|
1
|
+
{"version":3,"file":"TreeFormatter.cjs","names":["tsplus_module_1","tsplus_module_3","tsplus_module_2","tsplus_module_4","tsplus_module_5"],"sources":["../../esm/ParseError/TreeFormatter.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/collection/immutable/RoseTree/api\";\nimport * as tsplus_module_2 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_3 from \"@fncts/base/data/Maybe/api\";\nimport * as tsplus_module_4 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_5 from \"@fncts/base/data/Maybe/destructors\";\nimport { showWithOptions } from \"@fncts/base/data/Showable\";\n/**\n * @tsplus static fncts.schema.ParseErrorOps drawTree\n * @tsplus getter fncts.schema.ParseError drawTree\n */\nexport function format(error) {\n return tsplus_module_1.draw(go(error));\n}\nfunction formatActual(actual) {\n return showWithOptions(actual, { colors: false });\n}\nfunction formatRefinementKind(error) {\n switch (error.kind) {\n case \"From\": {\n return \"From side refinement failure\";\n }\n case \"Predicate\": {\n return \"Predicate refinement failure\";\n }\n }\n}\nfunction formatTransformationKind(error) {\n switch (error.kind) {\n case \"Encoded\": {\n return \"Encoded side transformation failure\";\n }\n case \"Transformation\": {\n return \"Transformation process failure\";\n }\n case \"Type\": {\n return \"Type side transformation failure\";\n }\n }\n}\nexport function getMessage(error) {\n return tsplus_module_3.map((f) => f(error))(error.ast.annotations.get(tsplus_module_2.Message));\n}\nexport function formatTypeError(error) {\n return tsplus_module_3.getOrElse(() => `Expected ${error.ast.toString(true)}, actual ${formatActual(error.actual)}`)(getMessage(error));\n}\nfunction formatKeyErrors(errors) {\n return tsplus_module_4.map((error) => {\n if (error._tag === 3 /* ParseErrorTag.Key */) {\n return tsplus_module_1.make(`[${String(error.keyAST)}]`, tsplus_module_4.vector(go(error.error)));\n }\n else {\n return tsplus_module_1.make(`[${error.index}]`, tsplus_module_4.vector(go(error.error)));\n }\n })(errors);\n}\nfunction getRoseTree(error, orElse) {\n return tsplus_module_5.match(() => orElse(), (message) => tsplus_module_1.make(message))(getMessage(error));\n}\nfunction go(error) {\n switch (error._tag) {\n case 1 /* ParseErrorTag.Type */:\n return tsplus_module_1.make(formatTypeError(error));\n case 0 /* ParseErrorTag.Declaration */:\n return getRoseTree(error, () => {\n const shouldSkipDefaultMessage = error.error._tag === 1 /* ParseErrorTag.Type */ && error.error.ast === error.ast;\n if (shouldSkipDefaultMessage) {\n return go(error.error);\n }\n else {\n return tsplus_module_1.make(error.ast.toString(true), tsplus_module_4.vector(go(error.error)));\n }\n });\n case 5 /* ParseErrorTag.Unexpected */:\n return tsplus_module_1.make(\"is unexpected\");\n case 4 /* ParseErrorTag.Missing */:\n return tsplus_module_1.make(\"is missing\");\n case 9 /* ParseErrorTag.TypeLiteral */:\n return getRoseTree(error, () => {\n return tsplus_module_1.make(error.ast.toString(true), formatKeyErrors(error.errors));\n });\n case 10 /* ParseErrorTag.Tuple */:\n return getRoseTree(error, () => {\n return tsplus_module_1.make(error.ast.toString(true), formatKeyErrors(error.errors));\n });\n case 11 /* ParseErrorTag.Union */:\n return tsplus_module_1.make(error.ast.toString(true), tsplus_module_4.map((error) => {\n switch (error._tag) {\n case 6 /* ParseErrorTag.UnionMember */:\n return tsplus_module_1.make(\"Union member\", tsplus_module_4.vector(go(error.error)));\n default:\n return go(error);\n }\n })(error.errors));\n case 7 /* ParseErrorTag.Refinement */:\n return getRoseTree(error, () => {\n return tsplus_module_1.make(formatRefinementKind(error), tsplus_module_4.vector(go(error.error)));\n });\n case 8 /* ParseErrorTag.Transformation */:\n return getRoseTree(error, () => {\n return tsplus_module_1.make(formatTransformationKind(error), tsplus_module_4.vector(go(error.error)));\n });\n case 12 /* ParseErrorTag.Iterable */:\n return getRoseTree(error, () => {\n return tsplus_module_1.make(error.ast.toString(true), formatKeyErrors(error.errors));\n });\n }\n}\n//# sourceMappingURL=TreeFormatter.js.map"],"mappings":";;;;;;;;;;;;;;;;;;AAUA,SAAgB,OAAO,OAAO;AAC1B,QAAOA,8CAAgB,KAAK,GAAG,MAAM,CAAC;;AAE1C,SAAS,aAAa,QAAQ;AAC1B,SAAA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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _TreeFormatter = /*#__PURE__*/require("./ParseError/TreeFormatter.cjs");
|
|
40
|
-
Object.keys(_TreeFormatter).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _TreeFormatter[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _TreeFormatter[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=ParseError.cjs.map
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_ParseError_ParseError = require("./ParseError/ParseError.cjs");
|
|
3
|
+
require("./ParseError/ParseErrorFormatter.cjs");
|
|
4
|
+
const require_ParseError_TreeFormatter = require("./ParseError/TreeFormatter.cjs");
|
|
5
|
+
const require_ParseError_PathFormatter = require("./ParseError/PathFormatter.cjs");
|
|
6
|
+
exports.DeclarationError = require_ParseError_ParseError.DeclarationError;
|
|
7
|
+
exports.IndexError = require_ParseError_ParseError.IndexError;
|
|
8
|
+
exports.IterableError = require_ParseError_ParseError.IterableError;
|
|
9
|
+
exports.KeyError = require_ParseError_ParseError.KeyError;
|
|
10
|
+
exports.MissingError = require_ParseError_ParseError.MissingError;
|
|
11
|
+
exports.RefinementError = require_ParseError_ParseError.RefinementError;
|
|
12
|
+
exports.TransformationError = require_ParseError_ParseError.TransformationError;
|
|
13
|
+
exports.TupleError = require_ParseError_ParseError.TupleError;
|
|
14
|
+
exports.TypeError = require_ParseError_ParseError.TypeError;
|
|
15
|
+
exports.TypeLiteralError = require_ParseError_ParseError.TypeLiteralError;
|
|
16
|
+
exports.UnexpectedError = require_ParseError_ParseError.UnexpectedError;
|
|
17
|
+
exports.UnionError = require_ParseError_ParseError.UnionError;
|
|
18
|
+
exports.UnionMemberError = require_ParseError_ParseError.UnionMemberError;
|
|
19
|
+
exports.declarationError = require_ParseError_ParseError.declarationError;
|
|
20
|
+
exports.flatten = require_ParseError_PathFormatter.flatten;
|
|
21
|
+
exports.format = require_ParseError_TreeFormatter.format;
|
|
22
|
+
exports.formatTypeError = require_ParseError_TreeFormatter.formatTypeError;
|
|
23
|
+
exports.getMessage = require_ParseError_TreeFormatter.getMessage;
|
|
24
|
+
exports.indexError = require_ParseError_ParseError.indexError;
|
|
25
|
+
exports.iterableError = require_ParseError_ParseError.iterableError;
|
|
26
|
+
exports.keyError = require_ParseError_ParseError.keyError;
|
|
27
|
+
exports.missingError = require_ParseError_ParseError.missingError;
|
|
28
|
+
exports.refinementError = require_ParseError_ParseError.refinementError;
|
|
29
|
+
exports.transformationError = require_ParseError_ParseError.transformationError;
|
|
30
|
+
exports.tupleError = require_ParseError_ParseError.tupleError;
|
|
31
|
+
exports.typeError = require_ParseError_ParseError.typeError;
|
|
32
|
+
exports.typeLiteralError = require_ParseError_ParseError.typeLiteralError;
|
|
33
|
+
exports.unexpectedError = require_ParseError_ParseError.unexpectedError;
|
|
34
|
+
exports.unionError = require_ParseError_ParseError.unionError;
|
|
35
|
+
exports.unionMemberError = require_ParseError_ParseError.unionMemberError;
|