@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.
Files changed (135) hide show
  1. package/LICENSE +26 -0
  2. package/_cjs/AST.cjs +1093 -1226
  3. package/_cjs/AST.cjs.map +1 -1
  4. package/_cjs/ASTAnnotation.cjs +114 -85
  5. package/_cjs/ASTAnnotation.cjs.map +1 -1
  6. package/_cjs/ASTAnnotationMap.cjs +43 -41
  7. package/_cjs/ASTAnnotationMap.cjs.map +1 -1
  8. package/_cjs/Eq.cjs +113 -145
  9. package/_cjs/Eq.cjs.map +1 -1
  10. package/_cjs/Gen.cjs +131 -167
  11. package/_cjs/Gen.cjs.map +1 -1
  12. package/_cjs/Guard.cjs +167 -267
  13. package/_cjs/Guard.cjs.map +1 -1
  14. package/_cjs/InvalidInterpretationError.cjs +9 -10
  15. package/_cjs/InvalidInterpretationError.cjs.map +1 -1
  16. package/_cjs/ParseError/ParseError.cjs +283 -284
  17. package/_cjs/ParseError/ParseError.cjs.map +1 -1
  18. package/_cjs/ParseError/ParseErrorFormatter.cjs +0 -2
  19. package/_cjs/ParseError/PathFormatter.cjs +55 -87
  20. package/_cjs/ParseError/PathFormatter.cjs.map +1 -1
  21. package/_cjs/ParseError/TreeFormatter.cjs +70 -102
  22. package/_cjs/ParseError/TreeFormatter.cjs.map +1 -1
  23. package/_cjs/ParseError.cjs +35 -50
  24. package/_cjs/ParseResult.cjs +15 -15
  25. package/_cjs/ParseResult.cjs.map +1 -1
  26. package/_cjs/Parser/api.cjs +54 -50
  27. package/_cjs/Parser/api.cjs.map +1 -1
  28. package/_cjs/Parser/definition.cjs +17 -16
  29. package/_cjs/Parser/definition.cjs.map +1 -1
  30. package/_cjs/Parser/interpreter.cjs +276 -358
  31. package/_cjs/Parser/interpreter.cjs.map +1 -1
  32. package/_cjs/Parser.cjs +12 -39
  33. package/_cjs/Schema/api/conc.cjs +64 -59
  34. package/_cjs/Schema/api/conc.cjs.map +1 -1
  35. package/_cjs/Schema/api/either.cjs +73 -72
  36. package/_cjs/Schema/api/either.cjs.map +1 -1
  37. package/_cjs/Schema/api/hashMap.cjs +85 -85
  38. package/_cjs/Schema/api/hashMap.cjs.map +1 -1
  39. package/_cjs/Schema/api/hashSet.cjs +75 -69
  40. package/_cjs/Schema/api/hashSet.cjs.map +1 -1
  41. package/_cjs/Schema/api/list.cjs +74 -66
  42. package/_cjs/Schema/api/list.cjs.map +1 -1
  43. package/_cjs/Schema/api/map.cjs +81 -83
  44. package/_cjs/Schema/api/map.cjs.map +1 -1
  45. package/_cjs/Schema/api/maybe.cjs +56 -49
  46. package/_cjs/Schema/api/maybe.cjs.map +1 -1
  47. package/_cjs/Schema/api/set.cjs +68 -61
  48. package/_cjs/Schema/api/set.cjs.map +1 -1
  49. package/_cjs/Schema/api.cjs +332 -350
  50. package/_cjs/Schema/api.cjs.map +1 -1
  51. package/_cjs/Schema/definition.cjs +28 -26
  52. package/_cjs/Schema/definition.cjs.map +1 -1
  53. package/_cjs/Schema/derivations.cjs +85 -100
  54. package/_cjs/Schema/derivations.cjs.map +1 -1
  55. package/_cjs/Schema.cjs +95 -127
  56. package/_cjs/Show.cjs +91 -151
  57. package/_cjs/Show.cjs.map +1 -1
  58. package/_cjs/chunk.cjs +28 -0
  59. package/_cjs/global.cjs +0 -2
  60. package/_cjs/index.cjs +0 -2
  61. package/_cjs/utils.cjs +41 -46
  62. package/_cjs/utils.cjs.map +1 -1
  63. package/_mjs/AST.mjs +996 -1161
  64. package/_mjs/AST.mjs.map +1 -1
  65. package/_mjs/ASTAnnotation.mjs +77 -73
  66. package/_mjs/ASTAnnotation.mjs.map +1 -1
  67. package/_mjs/ASTAnnotationMap.mjs +31 -29
  68. package/_mjs/ASTAnnotationMap.mjs.map +1 -1
  69. package/_mjs/Eq.mjs +101 -134
  70. package/_mjs/Eq.mjs.map +1 -1
  71. package/_mjs/Gen.mjs +117 -157
  72. package/_mjs/Gen.mjs.map +1 -1
  73. package/_mjs/Guard.mjs +154 -257
  74. package/_mjs/Guard.mjs.map +1 -1
  75. package/_mjs/InvalidInterpretationError.mjs +8 -4
  76. package/_mjs/InvalidInterpretationError.mjs.map +1 -1
  77. package/_mjs/ParseError/ParseError.mjs +266 -262
  78. package/_mjs/ParseError/ParseError.mjs.map +1 -1
  79. package/_mjs/ParseError/ParseErrorFormatter.mjs +0 -2
  80. package/_mjs/ParseError/PathFormatter.mjs +51 -80
  81. package/_mjs/ParseError/PathFormatter.mjs.map +1 -1
  82. package/_mjs/ParseError/TreeFormatter.mjs +62 -94
  83. package/_mjs/ParseError/TreeFormatter.mjs.map +1 -1
  84. package/_mjs/ParseError.mjs +5 -6
  85. package/_mjs/ParseResult.mjs +13 -9
  86. package/_mjs/ParseResult.mjs.map +1 -1
  87. package/_mjs/Parser/api.mjs +43 -39
  88. package/_mjs/Parser/api.mjs.map +1 -1
  89. package/_mjs/Parser/definition.mjs +12 -8
  90. package/_mjs/Parser/definition.mjs.map +1 -1
  91. package/_mjs/Parser/interpreter.mjs +262 -348
  92. package/_mjs/Parser/interpreter.mjs.map +1 -1
  93. package/_mjs/Parser.mjs +4 -5
  94. package/_mjs/Schema/api/conc.mjs +41 -45
  95. package/_mjs/Schema/api/conc.mjs.map +1 -1
  96. package/_mjs/Schema/api/either.mjs +55 -61
  97. package/_mjs/Schema/api/either.mjs.map +1 -1
  98. package/_mjs/Schema/api/hashMap.mjs +61 -71
  99. package/_mjs/Schema/api/hashMap.mjs.map +1 -1
  100. package/_mjs/Schema/api/hashSet.mjs +53 -56
  101. package/_mjs/Schema/api/hashSet.mjs.map +1 -1
  102. package/_mjs/Schema/api/list.mjs +50 -53
  103. package/_mjs/Schema/api/list.mjs.map +1 -1
  104. package/_mjs/Schema/api/map.mjs +59 -69
  105. package/_mjs/Schema/api/map.mjs.map +1 -1
  106. package/_mjs/Schema/api/maybe.mjs +34 -36
  107. package/_mjs/Schema/api/maybe.mjs.map +1 -1
  108. package/_mjs/Schema/api/set.mjs +47 -48
  109. package/_mjs/Schema/api/set.mjs.map +1 -1
  110. package/_mjs/Schema/api.mjs +304 -346
  111. package/_mjs/Schema/api.mjs.map +1 -1
  112. package/_mjs/Schema/definition.mjs +21 -17
  113. package/_mjs/Schema/definition.mjs.map +1 -1
  114. package/_mjs/Schema/derivations.mjs +71 -90
  115. package/_mjs/Schema/derivations.mjs.map +1 -1
  116. package/_mjs/Schema.mjs +12 -15
  117. package/_mjs/Show.mjs +79 -139
  118. package/_mjs/Show.mjs.map +1 -1
  119. package/_mjs/global.mjs +0 -2
  120. package/_mjs/index.mjs +0 -2
  121. package/_mjs/utils.mjs +35 -37
  122. package/_mjs/utils.mjs.map +1 -1
  123. package/package.json +7 -3
  124. package/_cjs/ParseError/ParseErrorFormatter.cjs.map +0 -1
  125. package/_cjs/ParseError.cjs.map +0 -1
  126. package/_cjs/Parser.cjs.map +0 -1
  127. package/_cjs/Schema.cjs.map +0 -1
  128. package/_cjs/global.cjs.map +0 -1
  129. package/_cjs/index.cjs.map +0 -1
  130. package/_mjs/ParseError/ParseErrorFormatter.mjs.map +0 -1
  131. package/_mjs/ParseError.mjs.map +0 -1
  132. package/_mjs/Parser.mjs.map +0 -1
  133. package/_mjs/Schema.mjs.map +0 -1
  134. package/_mjs/global.mjs.map +0 -1
  135. package/_mjs/index.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"api.mjs","names":["make","make_1","annotate","annotate_1","filter","filter_1","union","union_1","isOptional","isOptional_1","isParseOptional","isParseOptional_1","enum_","enum_1","instanceOf","instanceOf_1","transformOrFail","transformOrFail_1","transform","transform_1","show","getParameter","concrete","TemplateLiteralSpan","ownKeys","ast","tsplus_module_1","Schema","annotation","value","self","clone","annotations","declaration","typeParameters","decode","encode","tsplus_module_3","createDeclaration","tsplus_module_2","map","tp","predicate","createRefinement","brand","validation","validate","tsplus_module_4","Brand","vector","makeLiteral","createLiteral","literal","literals","never","neverKeyword","unknown_1","unknownKeyword","unknown","any","anyKeyword","_undefined_1","undefinedKeyword","_undefined","undefined","_null_1","_null","null","_void_1","voidKeyword","_void","void","string","stringKeyword","number","numberKeyword","boolean","booleanKeyword","bigint","bigIntKeyword","symbol","symbolKeyword","object_1","objectKeyword","object","date_1","Date","date","implicitDate","input","options","tsplus_module_5","succeed","tsplus_module_6","members","createUnion","from","m","nullable","uniqueSymbol","createUniqueSymbol","optional","Optional","tsplus_module_7","getOrElse","get","parseOptional","ParseOptional","struct","fields","parseOptionalKeys","key","createTypeLiteral","createPropertySignature","empty","isEmpty","propertySignatures","p","includes","name","type","isReadonly","to","isLazy","createLazy","tsplus_module_8","maybe","output","tsplus_module_9","fromNullable","tsplus_module_10","isNothing","toUndefined","tuple","elements","createTuple","schema","createElement","nothing","fileName_1","lazy","f","array","item","just","mutableArray","record","createRecord","enums","createEnum","Object","keys","enum","getTemplateLiterals","_tag","createTemplateLiteral","flatMap","types","Error","combineTemplateLiterals","a","b","isLiteral","String","head","spans","isNonEmpty","last","unsafeLast","append","slice","concat","templateLiteral","tail","span","keyof","isOverlappingPropertySignatures","x","y","some","px","py","isOverlappingIndexSignatures","ix","iy","bx","parameter","by","isStringKeyword","isSymbolKeyword","indexSignatures","extend","that","selfTypes","isUnion","thatTypes","every","isTypeLiteral","constructor","Description","createTransform","pick","omit"],"sources":["../../_src/Schema/api.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;aAYgBA,IAAI,GAAAC,MAAA;aAOJC,QAAQ,GAAAC,UAAA;aA8BRC,MAAM,GAAAC,QAAA;aAqINC,KAAK,GAAAC,OAAA;aAkCLC,UAAU,GAAAC,YAAA;aAkBVC,eAAe,GAAAC,iBAAA;aA0IfC,KAAK,GAAAC,MAAA;aAsILC,UAAU,GAAAC,YAAA;aAWVC,eAAe,GAAAC,iBAAA;aAafC,SAAS,GAAAC,WAAA;AA/gBzB,SAASC,IAAI,QAAQ,2BAA2B;AAEhD,SAASC,YAAY,QAAQ,YAAW;AACxC,SAAiBC,QAAQ,EAAEC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4D;EAE5D,OAAQ4D,IAAe,IAAe;IACpC,OAAO/F,MAAA,CAAeoC,eAAA,CAAAmK,eAAA,CAAoBxG,IAAI,CAACvE,GAAG,EAAEiG,EAAE,CAACjG,GAAG,EAAEU,MAAM,EAAEC,MAAM,CAAC,CAAC;EAC9E,CAAC;AACH;AAEA;;;AAGA,SAAAjB,YACEuG,EAAa,EACbvF,MAA+C,EAC/CC,MAA+C;EAE/C,OAAQ4D,IAAe,IAAe;IACpC,OAAO/E,iBAAA,CACLyG,EAAE,EACF,CAACjC,KAAK,EAAEC,OAAO,KAAKC,eAAA,CAAAC,OAAA,CAAoBzD,MAAM,CAACsD,KAAK,EAAEC,OAAO,CAAC,CAAC,EAC/D,CAACD,KAAK,EAAEC,OAAO,KAAKC,eAAA,CAAAC,OAAA,CAAoBxD,MAAM,CAACqD,KAAK,EAAEC,OAAO,CAAC,CAAC,EAH1DM,IAAI,CAIV;EACH,CAAC;AACH;AAEA;;;AAGA,OAAM,SAAUyG,IAAIA,CAAyC,GAAGlD,IAAU;EACxE,OAAQzH,IAAe,IAAmC;IACxD,OAAO7B,MAAA,CAAeoC,eAAA,CAAAoK,IAAA,CAAclK,eAAA,CAAAyD,IAAA,CAAYuD,IAAI,CAAC,EAA/BzH,IAAI,CAACL,GAAG,CAAwB,CAAC;EACzD,CAAC;AACH;AAEA;;;AAGA,OAAM,SAAUiL,IAAIA,CAAyC,GAAGnD,IAAU;EACxE,OAAQzH,IAAe,IAAmC;IACxD,OAAO7B,MAAA,CAAeoC,eAAA,CAAAqK,IAAA,CAAcnK,eAAA,CAAAyD,IAAA,CAAYuD,IAAI,CAAC,EAA/BzH,IAAI,CAACL,GAAG,CAAwB,CAAC;EACzD,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"api.mjs","names":[],"sources":["../../esm/Schema/api.js"],"sourcesContent":["const fileName_1 = \"(@fncts/schema) src/Schema/api.ts\";\nimport * as tsplus_module_1 from \"@fncts/schema/Schema/definition\";\nimport * as tsplus_module_2 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_3 from \"@fncts/schema/AST\";\nimport * as tsplus_module_4 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_5 from \"@fncts/schema/ParseResult\";\nimport * as tsplus_module_6 from \"@fncts/schema/Parser/api\";\nimport * as tsplus_module_7 from \"@fncts/base/data/Maybe/api\";\nimport * as tsplus_module_8 from \"@fncts/schema/Schema/api/maybe\";\nimport * as tsplus_module_9 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_10 from \"@fncts/base/data/Maybe/definition\";\nexport const make = make_1;\nexport const annotate = annotate_1;\nexport const filter = filter_1;\nexport const union = union_1;\nexport const isOptional = isOptional_1;\nexport const isParseOptional = isParseOptional_1;\nexport const enum_ = enum_1;\nexport const instanceOf = instanceOf_1;\nexport const transformOrFail = transformOrFail_1;\nexport const transform = transform_1;\nimport { show } from \"@fncts/base/data/Showable\";\nimport { getParameter } from \"../AST.js\";\nimport { concrete, TemplateLiteralSpan } from \"../AST.js\";\nimport { ownKeys } from \"../utils.js\";\n/**\n * @tsplus static fncts.schema.SchemaOps fromAST\n */\nfunction make_1(ast) {\n return new tsplus_module_1.Schema(ast);\n}\n/**\n * @tsplus pipeable fncts.schema.Schema annotate\n */\nfunction annotate_1(annotation, value) {\n return (self) => {\n return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(annotation, value) }));\n };\n}\n/**\n * @tsplus static fncts.schema.SchemaOps declaration\n */\nexport function declaration(typeParameters, decode, encode, annotations) {\n return make_1(tsplus_module_3.createDeclaration(tsplus_module_2.map((tp) => tp.ast)(typeParameters), (...typeParameters) => decode(...typeParameters.map(make_1)), (...typeParameters) => encode(...typeParameters.map(make_1)), annotations));\n}\nfunction filter_1(predicate) {\n return (self) => {\n const ast = tsplus_module_3.createRefinement(self.ast, predicate);\n return make_1(ast);\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema brand\n */\nexport function brand(validation) {\n return (self) => {\n const ast = tsplus_module_3.createRefinement(self.ast, validation.validate, self.ast.annotations.annotate(tsplus_module_4.Brand, tsplus_module_2.vector(validation)));\n return make_1(ast);\n };\n}\nfunction makeLiteral(value) {\n return make_1(tsplus_module_3.createLiteral(value));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps literal\n */\nexport function literal(...literals) {\n return union_1(...literals.map(makeLiteral));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps never\n * @tsplus implicit\n */\nexport const never = make_1(tsplus_module_3.neverKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps unknown\n * @tsplus implicit\n */\nconst unknown_1 = make_1(tsplus_module_3.unknownKeyword);\nexport const unknown = unknown_1;\n/**\n * @tsplus static fncts.schema.SchemaOps any\n */\nexport const any = make_1(tsplus_module_3.anyKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps undefined\n * @tsplus implicit\n */\nconst _undefined_1 = make_1(tsplus_module_3.undefinedKeyword);\nexport const _undefined = _undefined_1;\nexport { _undefined_1 as undefined };\n/**\n * @tsplus static fncts.schema.SchemaOps null\n * @tsplus implicit\n */\nconst _null_1 = make_1(tsplus_module_3.createLiteral(null));\nexport const _null = _null_1;\nexport { _null_1 as null };\n/**\n * @tsplus static fncts.schema.SchemaOps void\n * @tsplus implicit\n */\nconst _void_1 = make_1(tsplus_module_3.voidKeyword);\nexport const _void = _void_1;\nexport { _void_1 as void };\n/**\n * @tsplus static fncts.schema.SchemaOps string\n * @tsplus implicit\n */\nexport const string = make_1(tsplus_module_3.stringKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps number\n * @tsplus implicit\n */\nexport const number = make_1(tsplus_module_3.numberKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps boolean\n * @tsplus implicit\n */\nexport const boolean = make_1(tsplus_module_3.booleanKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps bigint\n * @tsplus implicit\n */\nexport const bigint = make_1(tsplus_module_3.bigIntKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps symbol\n * @tsplus implicit\n */\nexport const symbol = make_1(tsplus_module_3.symbolKeyword);\n/**\n * @tsplus static fncts.schema.SchemaOps object\n * @tsplus implicit\n */\nconst object_1 = make_1(tsplus_module_3.objectKeyword);\nexport const object = object_1;\n/**\n * @tsplus static fncts.schema.SchemaOps date\n */\nconst date_1 = instanceOf_1(Date)(object_1);\nexport const date = date_1;\n/**\n * @tsplus implicit\n */\nexport const implicitDate = transformOrFail_1(date_1, (input, options) => {\n if (typeof input === \"string\" || typeof input === \"number\") {\n return tsplus_module_5.succeed(new Date(input));\n }\n else {\n return tsplus_module_6.decode(date_1)(input, options);\n }\n}, (input) => tsplus_module_5.succeed(input))(unknown_1);\n/**\n * @tsplus derive fncts.schema.Schema<|> 30\n * @tsplus static fncts.schema.SchemaOps union\n */\nfunction union_1(...members) {\n return make_1(tsplus_module_3.createUnion(tsplus_module_2.from(members.map((m) => m.ast))));\n}\n/**\n * @tsplus getter fncts.schema.Schema nullable\n */\nexport function nullable(self) {\n return union_1(_null_1, self);\n}\n/**\n * @tsplus static fncts.schema.SchemaOps uniqueSymbol\n */\nexport function uniqueSymbol(symbol, annotations) {\n return make_1(tsplus_module_3.createUniqueSymbol(symbol, annotations));\n}\n/**\n * @tsplus getter fncts.schema.Schema optional\n */\nexport function optional(self) {\n return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(tsplus_module_4.Optional, true) }));\n}\n/**\n * @tsplus fluent fncts.schema.Schema isOptional\n */\nfunction isOptional_1(self) {\n return tsplus_module_7.getOrElse(() => false)(self.ast.annotations.get(tsplus_module_4.Optional));\n}\n/**\n * @tsplus getter fncts.schema.Schema parseOptional\n */\nexport function parseOptional(self) {\n return make_1(self.ast.clone({ annotations: self.ast.annotations.annotate(tsplus_module_4.ParseOptional, true) }));\n}\n/**\n * @tsplus fluent fncts.schema.Schema isParseOptional\n */\nfunction isParseOptional_1(self) {\n return tsplus_module_7.getOrElse(() => false)(self.ast.annotations.get(tsplus_module_4.ParseOptional));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps struct\n */\nexport function struct(fields) {\n const parseOptionalKeys = tsplus_module_2.filter((key) => isParseOptional_1(fields[key]))(ownKeys(fields));\n const struct = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((key) => tsplus_module_3.createPropertySignature(key, fields[key].ast, isOptional_1(fields[key]), true))(ownKeys(fields)), tsplus_module_2.empty()));\n if (tsplus_module_2.isEmpty(parseOptionalKeys)) {\n return struct;\n }\n const propertySignatures = struct.ast.propertySignatures;\n const from = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((p) => tsplus_module_2.includes(p.name)(parseOptionalKeys)\n ? tsplus_module_3.createPropertySignature(p.name, tsplus_module_3.createUnion(tsplus_module_2.vector(tsplus_module_3.undefinedKeyword, tsplus_module_3.createLiteral(null), p.type)), true, p.isReadonly)\n : p)(propertySignatures), tsplus_module_2.empty()));\n const to = make_1(tsplus_module_3.createTypeLiteral(tsplus_module_2.map((p) => {\n if (tsplus_module_2.includes(p.name)(parseOptionalKeys)) {\n if (tsplus_module_3.isLazy(fields[p.name].ast)) {\n return tsplus_module_3.createPropertySignature(p.name, tsplus_module_3.createLazy(() => tsplus_module_8.maybe(fields[p.name]).ast), true, p.isReadonly);\n }\n return tsplus_module_3.createPropertySignature(p.name, tsplus_module_8.maybe(fields[p.name]).ast, true, p.isReadonly);\n }\n return p;\n })(propertySignatures), tsplus_module_2.empty()));\n return transform_1(to, (input) => {\n const output = { ...input };\n for (const key of parseOptionalKeys) {\n output[key] = tsplus_module_9.fromNullable(input[key]);\n }\n return output;\n }, (input) => {\n const output = { ...input };\n for (const key of parseOptionalKeys) {\n const value = input[key];\n if (tsplus_module_10.isNothing(value)) {\n delete output[key];\n continue;\n }\n output[key] = tsplus_module_7.toUndefined(value);\n }\n return output;\n })(from);\n}\n/**\n * @tsplus static fncts.schema.SchemaOps tuple\n */\nexport function tuple(...elements) {\n return make_1(tsplus_module_3.createTuple(tsplus_module_2.from(elements.map((schema) => tsplus_module_3.createElement(schema.ast, false))), tsplus_module_9.nothing(fileName_1 + \":333:105\"), true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps lazy\n */\nexport function lazy(f, annotations) {\n return make_1(tsplus_module_3.createLazy(() => f().ast, annotations));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps array\n * @tsplus getter fncts.schema.Schema array\n */\nexport function array(item) {\n return make_1(tsplus_module_3.createTuple(tsplus_module_2.empty(), tsplus_module_9.just(tsplus_module_2.vector(item.ast), fileName_1 + \":349:61\"), true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps mutableArray\n * @tsplus getter fncts.schema.Schema mutableArray\n */\nexport function mutableArray(item) {\n return make_1(tsplus_module_3.createTuple(tsplus_module_2.empty(), tsplus_module_9.just(tsplus_module_2.vector(item.ast), fileName_1 + \":357:61\"), false));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps record\n */\nexport function record(key, value) {\n return make_1(tsplus_module_3.createRecord(key.ast, value.ast, true));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps enum\n */\nfunction enum_1(enums) {\n return make_1(tsplus_module_3.createEnum(tsplus_module_2.from(Object.keys(enums)\n .filter((key) => typeof enums[enums[key]] !== \"number\")\n .map((key) => [key, enums[key]]))));\n}\nexport { enum_1 as enum };\nfunction getTemplateLiterals(ast) {\n void 0;\n switch (ast._tag) {\n case 1 /* ASTTag.Literal */:\n return tsplus_module_2.vector(ast);\n case 9 /* ASTTag.NumberKeyword */:\n case 8 /* ASTTag.StringKeyword */:\n return tsplus_module_2.vector(tsplus_module_3.createTemplateLiteral(\"\", tsplus_module_2.vector(new TemplateLiteralSpan(ast, \"\"))));\n case 18 /* ASTTag.Union */:\n return tsplus_module_2.flatMap(getTemplateLiterals)(ast.types);\n default:\n throw new Error(`Unsupported template literal span ${show(ast)}`);\n }\n}\nfunction combineTemplateLiterals(a, b) {\n if (tsplus_module_3.isLiteral(a)) {\n return tsplus_module_3.isLiteral(b)\n ? tsplus_module_3.createLiteral(String(a.literal) + String(b.literal))\n : tsplus_module_3.createTemplateLiteral(String(a.literal) + b.head, b.spans);\n }\n if (tsplus_module_3.isLiteral(b)) {\n if (!tsplus_module_2.isNonEmpty(a.spans)) {\n throw new Error(\"Invalid template literal\");\n }\n const last = tsplus_module_2.unsafeLast(a.spans);\n return tsplus_module_3.createTemplateLiteral(a.head, tsplus_module_2.append(new TemplateLiteralSpan(last.type, last.literal + String(b.literal)))(tsplus_module_2.slice(0, -1)(a.spans)));\n }\n if (!tsplus_module_2.isNonEmpty(a.spans)) {\n throw new Error(\"Invalid template literal\");\n }\n const last = tsplus_module_2.unsafeLast(a.spans);\n return tsplus_module_3.createTemplateLiteral(a.head, tsplus_module_2.concat(b.spans)(tsplus_module_2.append(new TemplateLiteralSpan(last.type, last.literal + String(b.head)))(tsplus_module_2.slice(0, -1)(a.spans))));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps templateLiteral\n */\nexport function templateLiteral(...[head, ...tail]) {\n let types = getTemplateLiterals(head.ast);\n for (const span of tail) {\n types = tsplus_module_2.flatMap((a) => tsplus_module_2.map((b) => combineTemplateLiterals(a, b))(getTemplateLiterals(span.ast)))(types);\n }\n return make_1(tsplus_module_3.createUnion(types));\n}\n/**\n * @tsplus static fncts.schema.SchemaOps keyof\n * @tsplus getter fncts.schema.Schema keyof\n */\nexport function keyof(self) {\n return make_1(tsplus_module_3.keyof(self.ast));\n}\nfunction isOverlappingPropertySignatures(x, y) {\n return tsplus_module_2.some((px) => tsplus_module_2.some((py) => px.name === py.name)(y.propertySignatures))(x.propertySignatures);\n}\nfunction isOverlappingIndexSignatures(x, y) {\n return tsplus_module_2.some((ix) => tsplus_module_2.some((iy) => {\n const bx = getParameter(ix.parameter);\n const by = getParameter(iy.parameter);\n return (tsplus_module_3.isStringKeyword(bx) && tsplus_module_3.isStringKeyword(by)) || (tsplus_module_3.isSymbolKeyword(bx) && tsplus_module_3.isSymbolKeyword(by));\n })(y.indexSignatures))(x.indexSignatures);\n}\n/**\n * @tsplus pipeable fncts.schema.Schema extend\n */\nexport function extend(that) {\n return (self) => {\n const selfTypes = tsplus_module_3.isUnion(self.ast) ? self.ast.types : tsplus_module_2.vector(self.ast);\n const thatTypes = tsplus_module_3.isUnion(that.ast) ? that.ast.types : tsplus_module_2.vector(that.ast);\n if (tsplus_module_2.every(tsplus_module_3.isTypeLiteral)(selfTypes) && tsplus_module_2.every(tsplus_module_3.isTypeLiteral)(thatTypes)) {\n return make_1(tsplus_module_3.createUnion(tsplus_module_2.flatMap((x) => tsplus_module_2.map((y) => {\n if (isOverlappingPropertySignatures(x, y)) {\n throw new Error(\"`extend` cannot handle overlapping property signatures\");\n }\n if (isOverlappingIndexSignatures(x, y)) {\n throw new Error(\"`extend` cannot handle overlapping index signatures\");\n }\n return tsplus_module_3.createTypeLiteral(tsplus_module_2.concat(y.propertySignatures)(x.propertySignatures), tsplus_module_2.concat(y.indexSignatures)(x.indexSignatures));\n })(thatTypes))(selfTypes)));\n }\n throw new Error(\"`extend can only handle type literals or unions of type literals`\");\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema instanceOf\n */\nfunction instanceOf_1(constructor) {\n return (self) => {\n return annotate_1(tsplus_module_4.Description, `an instance of ${constructor.name}`)(filter_1((value) => value instanceof constructor)(self));\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema transformOrFail\n */\nfunction transformOrFail_1(to, decode, encode) {\n return (from) => {\n return make_1(tsplus_module_3.createTransform(from.ast, to.ast, decode, encode));\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema transform\n */\nfunction transform_1(to, decode, encode) {\n return (from) => {\n return transformOrFail_1(to, (input, options) => tsplus_module_5.succeed(decode(input, options)), (input, options) => tsplus_module_5.succeed(encode(input, options)))(from);\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema pick\n */\nexport function pick(...keys) {\n return (self) => {\n return make_1(tsplus_module_3.pick(tsplus_module_2.from(keys))(self.ast));\n };\n}\n/**\n * @tsplus pipeable fncts.schema.Schema omit\n */\nexport function omit(...keys) {\n return (self) => {\n return make_1(tsplus_module_3.omit(tsplus_module_2.from(keys))(self.ast));\n };\n}\n//# sourceMappingURL=api.js.map"],"mappings":";;;;;;;;;;;;;;AAAA,MAAM,aAAa;AAWnB,MAAa,OAAO;AACpB,MAAa,WAAW;AACxB,MAAa,SAAS;AACtB,MAAa,QAAQ;AACrB,MAAa,aAAa;AAC1B,MAAa,kBAAkB;AAC/B,MAAa,QAAQ;AACrB,MAAa,aAAa;AAC1B,MAAa,kBAAkB;AAC/B,MAAa,YAAY;;;;AAQzB,SAAS,OAAO,KAAK;AACjB,QAAO,IAAI,gBAAgB,OAAO,IAAI;;;;;AAK1C,SAAS,WAAW,YAAY,OAAO;AACnC,SAAQ,SAAS;AACb,SAAO,OAAO,KAAK,IAAI,MAAM,EAAE,aAAa,KAAK,IAAI,YAAY,SAAS,YAAY,MAAM,EAAE,CAAC,CAAC;;;;;;AAMxG,SAAgB,YAAY,gBAAgB,QAAQ,QAAQ,aAAa;AACrE,QAAO,OAAO,gBAAgB,kBAAkB,gBAAgB,KAAK,OAAO,GAAG,IAAI,CAAC,eAAe,GAAG,GAAG,mBAAmB,OAAO,GAAG,eAAe,IAAI,OAAO,CAAC,GAAG,GAAG,mBAAmB,OAAO,GAAG,eAAe,IAAI,OAAO,CAAC,EAAE,YAAY,CAAC;;AAElP,SAAS,SAAS,WAAW;AACzB,SAAQ,SAAS;AAEb,SAAO,OADK,gBAAgB,iBAAiB,KAAK,KAAK,UACtC,CAAC;;;;;;AAM1B,SAAgB,MAAM,YAAY;AAC9B,SAAQ,SAAS;AAEb,SAAO,OADK,gBAAgB,iBAAiB,KAAK,KAAK,WAAW,UAAU,KAAK,IAAI,YAAY,SAAS,gBAAgB,OAAO,gBAAgB,OAAO,WAAW,CAAC,CACnJ,CAAC;;;AAG1B,SAAS,YAAY,OAAO;AACxB,QAAO,OAAO,gBAAgB,cAAc,MAAM,CAAC;;;;;AAKvD,SAAgB,QAAQ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AO,CAAC,UAAU,UAAU,iBAAiB,YAAY,CAAC,KAAK,CAAC;;;;;;AAMrJ,SAAS,kBAAkB,IAAI,QAAQ,QAAQ;AAC3C,SAAQ,SAAS;AACb,SAAO,OAAO,gBAAgB,gBAAgB,KAAK,KAAK,GAAG,KAAK,QAAQ,OAAO,CAAC;;;;;;AAMxF,SAAS,YAAY,IAAI,QAAQ,QAAQ;AACrC,SAAQ,SAAS;AACb,SAAO,kBAAkB,KAAK,OAAO,YAAY,gBAAgB,QAAQ,OAAO,OAAO,QAAQ,CAAC,GAAG,OAAO,YAAY,gBAAgB,QAAQ,OAAO,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK;;;;;;AAMpL,SAAgB,KAAK,GAAG,MAAM;AAC1B,SAAQ,SAAS;AACb,SAAO,OAAO,gBAAgB,KAAK,gBAAgB,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;;;;;;AAMjF,SAAgB,KAAK,GAAG,MAAM;AAC1B,SAAQ,SAAS;AACb,SAAO,OAAO,gBAAgB,KAAK,gBAAgB,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC"}
@@ -1,22 +1,26 @@
1
1
  import * as tsplus_module_1 from "@fncts/base/util/predicates";
2
- export const SchemaVariance = /*#__PURE__*/Symbol.for("fncts.schema.Schema.Variance");
3
- export const SchemaTypeId = /*#__PURE__*/Symbol.for("fncts.schema.Schema");
4
- export const OptionalSchemaSymbol = /*#__PURE__*/Symbol.for("fncts.schema.Schema.OptionalSchema");
2
+ //#region build/esm/Schema/definition.js
3
+ const SchemaVariance = Symbol.for("fncts.schema.Schema.Variance");
4
+ const SchemaTypeId = Symbol.for("fncts.schema.Schema");
5
+ const OptionalSchemaSymbol = Symbol.for("fncts.schema.Schema.OptionalSchema");
5
6
  /**
6
- * @tsplus type fncts.schema.Schema
7
- * @tsplus companion fncts.schema.SchemaOps
8
- */
9
- export class Schema {
10
- ast;
11
- [SchemaTypeId] = SchemaTypeId;
12
- constructor(ast) {
13
- this.ast = ast;
14
- }
15
- }
7
+ * @tsplus type fncts.schema.Schema
8
+ * @tsplus companion fncts.schema.SchemaOps
9
+ */
10
+ var Schema = class {
11
+ ast;
12
+ [SchemaTypeId] = SchemaTypeId;
13
+ constructor(ast) {
14
+ this.ast = ast;
15
+ }
16
+ };
16
17
  /**
17
- * @tsplus static fncts.schema.SchemaOps isSchema
18
- */
19
- export function isSchema(u) {
20
- return tsplus_module_1.isObject(u) && SchemaTypeId in u;
18
+ * @tsplus static fncts.schema.SchemaOps isSchema
19
+ */
20
+ function isSchema(u) {
21
+ return tsplus_module_1.isObject(u) && SchemaTypeId in u;
21
22
  }
23
+ //#endregion
24
+ export { OptionalSchemaSymbol, Schema, SchemaTypeId, SchemaVariance, isSchema };
25
+
22
26
  //# sourceMappingURL=definition.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"definition.mjs","names":["SchemaVariance","Symbol","for","SchemaTypeId","OptionalSchemaSymbol","Schema","ast","constructor","isSchema","u","tsplus_module_1","isObject"],"sources":["../../_src/Schema/definition.ts"],"sourcesContent":[null],"mappings":";AAAA,OAAO,MAAMA,cAAc,gBAAGC,MAAM,CAACC,GAAG,CAAC,8BAA8B,CAAC;AAGxE,OAAO,MAAMC,YAAY,gBAAGF,MAAM,CAACC,GAAG,CAAC,qBAAqB,CAAC;AAG7D,OAAO,MAAME,oBAAoB,gBAAGH,MAAM,CAACC,GAAG,CAAC,oCAAoC,CAAC;AAOpF;;;;AAIA,OAAM,MAAOG,MAAM;EAKIC,GAAA;EAJZ,CAACH,YAAY,IAAkBA,YAAY;EAIpDI,YAAqBD,GAAQ;IAAR,KAAAA,GAAG,GAAHA,GAAG;EAAQ;;AAWlC;;;AAGA,OAAM,SAAUE,QAAQA,CAACC,CAAU;EACjC,OAAOC,eAAA,CAAAC,QAAQ,CAACF,CAAC,CAAC,IAAIN,YAAY,IAAIM,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"file":"definition.mjs","names":[],"sources":["../../esm/Schema/definition.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/util/predicates\";\nexport const SchemaVariance = Symbol.for(\"fncts.schema.Schema.Variance\");\nexport const SchemaTypeId = Symbol.for(\"fncts.schema.Schema\");\nexport const OptionalSchemaSymbol = Symbol.for(\"fncts.schema.Schema.OptionalSchema\");\n/**\n * @tsplus type fncts.schema.Schema\n * @tsplus companion fncts.schema.SchemaOps\n */\nexport class Schema {\n ast;\n [SchemaTypeId] = SchemaTypeId;\n constructor(ast) {\n this.ast = ast;\n }\n}\n/**\n * @tsplus static fncts.schema.SchemaOps isSchema\n */\nexport function isSchema(u) {\n return tsplus_module_1.isObject(u) && SchemaTypeId in u;\n}\n//# sourceMappingURL=definition.js.map"],"mappings":";;AACA,MAAa,iBAAiB,OAAO,IAAI,+BAA+B;AACxE,MAAa,eAAe,OAAO,IAAI,sBAAsB;AAC7D,MAAa,uBAAuB,OAAO,IAAI,qCAAqC;;;;;AAKpF,IAAa,SAAb,MAAoB;CAChB;CACA,CAAC,gBAAgB;CACjB,YAAY,KAAK;AACb,OAAK,MAAM;;;;;;AAMnB,SAAgB,SAAS,GAAG;AACxB,QAAO,gBAAgB,SAAS,EAAE,IAAI,gBAAgB"}
@@ -1,111 +1,92 @@
1
1
  import * as tsplus_module_1 from "@fncts/base/collection/immutable/Vector/api";
2
- import * as tsplus_module_2 from "@fncts/schema/ASTAnnotation";
3
2
  import * as tsplus_module_3 from "@fncts/schema/AST";
4
- import * as tsplus_module_4 from "@fncts/schema/Schema/api";
5
- import * as tsplus_module_5 from "@fncts/schema/Schema/api/maybe";
6
- import * as tsplus_module_6 from "@fncts/base/data/Maybe/constructors";
7
- import * as tsplus_module_7 from "@fncts/base/data/Maybe/definition";
8
3
  import * as tsplus_module_8 from "@fncts/base/data/Maybe/api";
9
- import * as tsplus_module_9 from "@fncts/base/data/function/api";
4
+ import * as tsplus_module_6 from "@fncts/base/data/Maybe/constructors";
10
5
  import { ownKeys } from "@fncts/schema/utils";
6
+ import * as tsplus_module_2 from "@fncts/schema/ASTAnnotation";
7
+ import * as tsplus_module_5 from "@fncts/schema/Schema/api/maybe";
8
+ import * as tsplus_module_7 from "@fncts/base/data/Maybe/definition";
9
+ import * as tsplus_module_4 from "@fncts/schema/Schema/api";
10
+ import "@fncts/base/data/function/api";
11
+ //#region build/esm/Schema/derivations.js
11
12
  /**
12
- * @tsplus derive fncts.schema.Schema<_> 10
13
- */
14
- export function deriveValidation(...[base, brands]) {
15
- return tsplus_module_4.make(tsplus_module_3.createValidation(base.ast, tsplus_module_1.from(Object.values(brands)), base.ast.annotations.annotate(tsplus_module_2.Brand, tsplus_module_1.from(Object.values(brands)))));
13
+ * @tsplus derive fncts.schema.Schema<_> 10
14
+ */
15
+ function deriveValidation(...[base, brands]) {
16
+ return tsplus_module_4.make(tsplus_module_3.createValidation(base.ast, tsplus_module_1.from(Object.values(brands)), base.ast.annotations.annotate(tsplus_module_2.Brand, tsplus_module_1.from(Object.values(brands)))));
16
17
  }
17
18
  /**
18
- * @tsplus derive fncts.schema.Schema<_> 20
19
- */
20
- export function deriveLiteral(...[value]) {
21
- return tsplus_module_4.literal(value);
19
+ * @tsplus derive fncts.schema.Schema<_> 20
20
+ */
21
+ function deriveLiteral(...[value]) {
22
+ return tsplus_module_4.literal(value);
22
23
  }
23
24
  /**
24
- * @tsplus derive fncts.schema.Schema<_> 20
25
- */
26
- export function deriveStruct(...[requiredFields, optionalFields, maybeFields, indexSchema]) {
27
- const maybeFieldsKeys = ownKeys(maybeFields);
28
- let propertySignatures = tsplus_module_1.map(key =>
29
- // @ts-expect-error
30
- tsplus_module_3.createPropertySignature(key, requiredFields[key].ast, false, true))(ownKeys(requiredFields));
31
- const indexSignatures = indexSchema.map(({
32
- key,
33
- value
34
- }) => tsplus_module_3.createIndexSignature(key.ast, value.ast, false));
35
- if (optionalFields) {
36
- propertySignatures = tsplus_module_1.concat(
37
- // @ts-expect-error
38
- tsplus_module_1.map(key => tsplus_module_3.createPropertySignature(key, optionalFields[key].ast, true, true))(ownKeys(optionalFields)))(propertySignatures);
39
- }
40
- const struct = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(propertySignatures, tsplus_module_1.from(indexSignatures)));
41
- if (tsplus_module_1.isEmpty(maybeFieldsKeys)) {
42
- return struct;
43
- }
44
- propertySignatures = struct.ast.propertySignatures;
45
- const from = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map(key => tsplus_module_3.createPropertySignature(key,
46
- // @ts-expect-error
47
- tsplus_module_3.createUnion(tsplus_module_1.vector(tsplus_module_3.undefinedKeyword, tsplus_module_3.createLiteral(null), maybeFields[key].ast)), true, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));
48
- const to = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map(key =>
49
- // @ts-expect-error
50
- tsplus_module_3.createPropertySignature(key, tsplus_module_5.maybe(maybeFields[key]).ast, false, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));
51
- return tsplus_module_4.transform(to, input => {
52
- const output = {
53
- ...input
54
- };
55
- for (const key of maybeFieldsKeys) {
56
- output[key] = tsplus_module_6.fromNullable(input[key]);
57
- }
58
- return output;
59
- }, input => {
60
- const output = {
61
- ...input
62
- };
63
- for (const key of maybeFieldsKeys) {
64
- const value = input[key];
65
- if (tsplus_module_7.isNothing(value)) {
66
- delete output[key];
67
- continue;
68
- }
69
- output[key] = tsplus_module_8.toUndefined(value);
70
- }
71
- return output;
72
- })(from);
25
+ * @tsplus derive fncts.schema.Schema<_> 20
26
+ */
27
+ function deriveStruct(...[requiredFields, optionalFields, maybeFields, indexSchema]) {
28
+ const maybeFieldsKeys = ownKeys(maybeFields);
29
+ let propertySignatures = tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, requiredFields[key].ast, false, true))(ownKeys(requiredFields));
30
+ const indexSignatures = indexSchema.map(({ key, value }) => tsplus_module_3.createIndexSignature(key.ast, value.ast, false));
31
+ if (optionalFields) propertySignatures = tsplus_module_1.concat(tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, optionalFields[key].ast, true, true))(ownKeys(optionalFields)))(propertySignatures);
32
+ const struct = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(propertySignatures, tsplus_module_1.from(indexSignatures)));
33
+ if (tsplus_module_1.isEmpty(maybeFieldsKeys)) return struct;
34
+ propertySignatures = struct.ast.propertySignatures;
35
+ const from = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, tsplus_module_3.createUnion(tsplus_module_1.vector(tsplus_module_3.undefinedKeyword, tsplus_module_3.createLiteral(null), maybeFields[key].ast)), true, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));
36
+ const to = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, tsplus_module_5.maybe(maybeFields[key]).ast, false, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));
37
+ return tsplus_module_4.transform(to, (input) => {
38
+ const output = { ...input };
39
+ for (const key of maybeFieldsKeys) output[key] = tsplus_module_6.fromNullable(input[key]);
40
+ return output;
41
+ }, (input) => {
42
+ const output = { ...input };
43
+ for (const key of maybeFieldsKeys) {
44
+ const value = input[key];
45
+ if (tsplus_module_7.isNothing(value)) {
46
+ delete output[key];
47
+ continue;
48
+ }
49
+ output[key] = tsplus_module_8.toUndefined(value);
50
+ }
51
+ return output;
52
+ })(from);
73
53
  }
74
54
  /**
75
- * @tsplus derive fncts.schema.Schema<_> 10
76
- */
77
- export function deriveTuple(...[components]) {
78
- return tsplus_module_4.tuple(...components);
55
+ * @tsplus derive fncts.schema.Schema<_> 10
56
+ */
57
+ function deriveTuple(...[components]) {
58
+ return tsplus_module_4.tuple(...components);
79
59
  }
80
60
  /**
81
- * @tsplus derive fncts.schema.Schema lazy
82
- */
83
- export function deriveLazy(f) {
84
- let cached;
85
- const ast = tsplus_module_3.createLazy(() => {
86
- if (!cached) {
87
- cached = f(tsplus_module_4.make(ast)).ast;
88
- }
89
- return cached;
90
- });
91
- return tsplus_module_4.make(ast);
61
+ * @tsplus derive fncts.schema.Schema lazy
62
+ */
63
+ function deriveLazy(f) {
64
+ let cached;
65
+ const ast = tsplus_module_3.createLazy(() => {
66
+ if (!cached) cached = f(tsplus_module_4.make(ast)).ast;
67
+ return cached;
68
+ });
69
+ return tsplus_module_4.make(ast);
92
70
  }
93
71
  /**
94
- * @tsplus derive fncts.schema.Schema[fncts.ReadonlyArray]<_> 10
95
- */
96
- export function deriveReadonlyArray(...[element]) {
97
- return tsplus_module_4.array(element);
72
+ * @tsplus derive fncts.schema.Schema[fncts.ReadonlyArray]<_> 10
73
+ */
74
+ function deriveReadonlyArray(...[element]) {
75
+ return tsplus_module_4.array(element);
98
76
  }
99
77
  /**
100
- * @tsplus derive fncts.schema.Schema[fncts.Array]<_> 10
101
- */
102
- export function deriveArray(...[element]) {
103
- return tsplus_module_4.mutableArray(element);
78
+ * @tsplus derive fncts.schema.Schema[fncts.Array]<_> 10
79
+ */
80
+ function deriveArray(...[element]) {
81
+ return tsplus_module_4.mutableArray(element);
104
82
  }
105
83
  /**
106
- * @tsplus derive fncts.schema.Schema<_> 15
107
- */
108
- export function deriveRecord(...[keySchema, valueSchema]) {
109
- return tsplus_module_4.record(keySchema, valueSchema);
84
+ * @tsplus derive fncts.schema.Schema<_> 15
85
+ */
86
+ function deriveRecord(...[keySchema, valueSchema]) {
87
+ return tsplus_module_4.record(keySchema, valueSchema);
110
88
  }
89
+ //#endregion
90
+ export { deriveArray, deriveLazy, deriveLiteral, deriveReadonlyArray, deriveRecord, deriveStruct, deriveTuple, deriveValidation };
91
+
111
92
  //# sourceMappingURL=derivations.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"derivations.mjs","names":["ownKeys","deriveValidation","base","brands","tsplus_module_4","make","tsplus_module_3","createValidation","ast","tsplus_module_1","from","Object","values","annotations","annotate","tsplus_module_2","Brand","deriveLiteral","value","literal","deriveStruct","requiredFields","optionalFields","maybeFields","indexSchema","maybeFieldsKeys","propertySignatures","map","key","createPropertySignature","indexSignatures","createIndexSignature","concat","struct","createTypeLiteral","isEmpty","createUnion","vector","undefinedKeyword","createLiteral","to","tsplus_module_5","maybe","transform","input","output","tsplus_module_6","fromNullable","tsplus_module_7","isNothing","tsplus_module_8","toUndefined","deriveTuple","components","tuple","deriveLazy","f","cached","createLazy","deriveReadonlyArray","element","array","deriveArray","mutableArray","deriveRecord","keySchema","valueSchema","record"],"sources":["../../_src/Schema/derivations.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;AAIA,SAASA,OAAO,QAAQ,qBAAqB;AAE7C;;;AAGA,OAAM,SAAUC,gBAAgBA,CAC9B,GAAG,CAACC,IAAI,EAAEC,MAAM,CAOP;EAET,OAAOC,eAAA,CAAAC,IAAA,CACLC,eAAA,CAAAC,gBAAA,CACEL,IAAI,CAACM,GAAG,EACRC,eAAA,CAAAC,IAAA,CAAYC,MAAM,CAACC,MAAM,CAACT,MAAM,CAAC,CAAC,EAClCD,IAAI,CAACM,GAAG,CAACK,WAAW,CAACC,QAAQ,CAAAC,eAAA,CAAAC,KAAA,EAAsBP,eAAA,CAAAC,IAAA,CAAYC,MAAM,CAACC,MAAM,CAACT,MAAM,CAAC,CAAC,CAAC,CACvF,CACF;AACH;AAEA;;;AAGA,OAAM,SAAUc,aAAaA,CAC3B,GAAG,CAACC,KAAK,CAAkG;EAE3G,OAAOd,eAAA,CAAAe,OAAA,CAAeD,KAAK,CAAC;AAC9B;AAUA;;;AAGA,OAAM,SAAUE,YAAYA,CAC1B,GAAG,CAACC,cAAc,EAAEC,cAAc,EAAEC,WAAW,EAAEC,WAAW,CAuBnD;EAET,MAAMC,eAAe,GAAwBzB,OAAO,CAACuB,WAAW,CAAC;EACjE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AK,CAAY,EAAE;QACrB,OAAO2B,MAAM,CAACjB,GAAG,CAAC;QAClB;MACF;MACAiB,MAAM,CAACjB,GAAG,CAAC,GAAAsB,eAAA,CAAAC,WAAA,CAAGjC,KAAK,CAAM;IAC3B;IACA,OAAO2B,MAAM;EACf,CAAC,EApBInC,IAAI,CAqBV;AACH;AAEA;;;AAGA,OAAM,SAAU0C,WAAWA,CACzB,GAAG,CAACC,UAAU,CAAsG;EAEpH,OAAoBjD,eAAA,CAAAkD,KAAA,CAAa,GAAGD,UAAU,CAAC;AACjD;AAEA;;;AAGA,OAAM,SAAUE,UAAUA,CAAIC,CAA8B;EAC1D,IAAIC,MAAuB;EAC3B,MAAMjD,GAAG,GAAGF,eAAA,CAAAoD,UAAA,CAAe,MAAK;IAC9B,IAAI,CAACD,MAAM,EAAE;MACXA,MAAM,GAAGD,CAAC,CAACpD,eAAA,CAAAC,IAAA,CAAeG,GAAG,CAAC,CAAC,CAACA,GAAG;IACrC;IACA,OAAOiD,MAAM;EACf,CAAC,CAAC;EACF,OAAOrD,eAAA,CAAAC,IAAA,CAAeG,GAAG,CAAC;AAC5B;AAEA;;;AAGA,OAAM,SAAUmD,mBAAmBA,CACjC,GAAG,CAACC,OAAO,CAIF;EAET,OAAOxD,eAAA,CAAAyD,KAAA,CAAaD,OAAO,CAAyB;AACtD;AAEA;;;AAGA,OAAM,SAAUE,WAAWA,CACzB,GAAG,CAACF,OAAO,CAIF;EAET,OAAOxD,eAAA,CAAA2D,YAAA,CAAoBH,OAAO,CAAyB;AAC7D;AAEA;;;AAGA,OAAM,SAAUI,YAAYA,CAC1B,GAAG,CAACC,SAAS,EAAEC,WAAW,CAIjB;EAET,OAAO9D,eAAA,CAAA+D,MAAA,CAAcF,SAAoC,EAAEC,WAAW,CAAc;AACtF","ignoreList":[]}
1
+ {"version":3,"file":"derivations.mjs","names":[],"sources":["../../esm/Schema/derivations.js"],"sourcesContent":["import * as tsplus_module_1 from \"@fncts/base/collection/immutable/Vector/api\";\nimport * as tsplus_module_2 from \"@fncts/schema/ASTAnnotation\";\nimport * as tsplus_module_3 from \"@fncts/schema/AST\";\nimport * as tsplus_module_4 from \"@fncts/schema/Schema/api\";\nimport * as tsplus_module_5 from \"@fncts/schema/Schema/api/maybe\";\nimport * as tsplus_module_6 from \"@fncts/base/data/Maybe/constructors\";\nimport * as tsplus_module_7 from \"@fncts/base/data/Maybe/definition\";\nimport * as tsplus_module_8 from \"@fncts/base/data/Maybe/api\";\nimport * as tsplus_module_9 from \"@fncts/base/data/function/api\";\nimport { ownKeys } from \"@fncts/schema/utils\";\n/**\n * @tsplus derive fncts.schema.Schema<_> 10\n */\nexport function deriveValidation(...[base, brands]) {\n return tsplus_module_4.make(tsplus_module_3.createValidation(base.ast, tsplus_module_1.from(Object.values(brands)), base.ast.annotations.annotate(tsplus_module_2.Brand, tsplus_module_1.from(Object.values(brands)))));\n}\n/**\n * @tsplus derive fncts.schema.Schema<_> 20\n */\nexport function deriveLiteral(...[value]) {\n return tsplus_module_4.literal(value);\n}\n/**\n * @tsplus derive fncts.schema.Schema<_> 20\n */\nexport function deriveStruct(...[requiredFields, optionalFields, maybeFields, indexSchema]) {\n const maybeFieldsKeys = ownKeys(maybeFields);\n let propertySignatures = tsplus_module_1.map((key) => \n // @ts-expect-error\n tsplus_module_3.createPropertySignature(key, requiredFields[key].ast, false, true))(ownKeys(requiredFields));\n const indexSignatures = indexSchema.map(({ key, value }) => tsplus_module_3.createIndexSignature(key.ast, value.ast, false));\n if (optionalFields) {\n propertySignatures = tsplus_module_1.concat(\n // @ts-expect-error\n tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, optionalFields[key].ast, true, true))(ownKeys(optionalFields)))(propertySignatures);\n }\n const struct = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(propertySignatures, tsplus_module_1.from(indexSignatures)));\n if (tsplus_module_1.isEmpty(maybeFieldsKeys)) {\n return struct;\n }\n propertySignatures = struct.ast.propertySignatures;\n const from = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map((key) => tsplus_module_3.createPropertySignature(key, \n // @ts-expect-error\n tsplus_module_3.createUnion(tsplus_module_1.vector(tsplus_module_3.undefinedKeyword, tsplus_module_3.createLiteral(null), maybeFields[key].ast)), true, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));\n const to = tsplus_module_4.make(tsplus_module_3.createTypeLiteral(tsplus_module_1.concat(tsplus_module_1.map((key) => \n // @ts-expect-error\n tsplus_module_3.createPropertySignature(key, tsplus_module_5.maybe(maybeFields[key]).ast, false, true))(maybeFieldsKeys))(propertySignatures), tsplus_module_1.from(indexSignatures)));\n return tsplus_module_4.transform(to, (input) => {\n const output = { ...input };\n for (const key of maybeFieldsKeys) {\n output[key] = tsplus_module_6.fromNullable(input[key]);\n }\n return output;\n }, (input) => {\n const output = { ...input };\n for (const key of maybeFieldsKeys) {\n const value = input[key];\n if (tsplus_module_7.isNothing(value)) {\n delete output[key];\n continue;\n }\n output[key] = tsplus_module_8.toUndefined(value);\n }\n return output;\n })(from);\n}\n/**\n * @tsplus derive fncts.schema.Schema<_> 10\n */\nexport function deriveTuple(...[components]) {\n return tsplus_module_4.tuple(...components);\n}\n/**\n * @tsplus derive fncts.schema.Schema lazy\n */\nexport function deriveLazy(f) {\n let cached;\n const ast = tsplus_module_3.createLazy(() => {\n if (!cached) {\n cached = f(tsplus_module_4.make(ast)).ast;\n }\n return cached;\n });\n return tsplus_module_4.make(ast);\n}\n/**\n * @tsplus derive fncts.schema.Schema[fncts.ReadonlyArray]<_> 10\n */\nexport function deriveReadonlyArray(...[element]) {\n return tsplus_module_4.array(element);\n}\n/**\n * @tsplus derive fncts.schema.Schema[fncts.Array]<_> 10\n */\nexport function deriveArray(...[element]) {\n return tsplus_module_4.mutableArray(element);\n}\n/**\n * @tsplus derive fncts.schema.Schema<_> 15\n */\nexport function deriveRecord(...[keySchema, valueSchema]) {\n return tsplus_module_4.record(keySchema, valueS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AW,cAAc;AACtD,QAAO,gBAAgB,OAAO,WAAW,YAAY"}
package/_mjs/Schema.mjs CHANGED
@@ -1,15 +1,12 @@
1
- // codegen:start { preset: barrel, include: ./Schema/*.ts }
2
- export * from "./Schema/api.mjs";
3
- export * from "./Schema/definition.mjs";
4
- export * from "./Schema/derivations.mjs";
5
- // codegen:end
6
- // codegen:start { preset: barrel, include: ./Schema/api/*.ts }
7
- export * from "./Schema/api/conc.mjs";
8
- export * from "./Schema/api/either.mjs";
9
- export * from "./Schema/api/hashMap.mjs";
10
- export * from "./Schema/api/hashSet.mjs";
11
- export * from "./Schema/api/list.mjs";
12
- export * from "./Schema/api/map.mjs";
13
- export * from "./Schema/api/maybe.mjs";
14
- export * from "./Schema/api/set.mjs";
15
- //# sourceMappingURL=Schema.mjs.map
1
+ import { _null, _undefined, _void, annotate, any, array, bigint, boolean, brand, date, declaration, enum as enum_1, enum_, extend, filter, implicitDate, instanceOf, isOptional, isParseOptional, keyof, lazy, literal, make, mutableArray, never, null as _null_1, nullable, number, object, omit, optional, parseOptional, pick, record, string, struct, symbol, templateLiteral, transform, transformOrFail, tuple, undefined as _undefined_1, union, uniqueSymbol, unknown, void as _void_1 } from "./Schema/api.mjs";
2
+ import { OptionalSchemaSymbol, Schema, SchemaTypeId, SchemaVariance, isSchema } from "./Schema/definition.mjs";
3
+ import { deriveArray, deriveLazy, deriveLiteral, deriveReadonlyArray, deriveRecord, deriveStruct, deriveTuple, deriveValidation } from "./Schema/derivations.mjs";
4
+ import { conc, concFromArray, deriveConc } from "./Schema/api/conc.mjs";
5
+ import { deriveEither, either, eitherFromJson } from "./Schema/api/either.mjs";
6
+ import { deriveHashMap, hashMap, hashMapFromRecord } from "./Schema/api/hashMap.mjs";
7
+ import { deriveHashSet, hashSet, hashSetFromArray } from "./Schema/api/hashSet.mjs";
8
+ import { deriveList, list, listFromArray } from "./Schema/api/list.mjs";
9
+ import { deriveMap, map, mapFromRecord } from "./Schema/api/map.mjs";
10
+ import { deriveMaybe, maybe, maybeFromNullable } from "./Schema/api/maybe.mjs";
11
+ import { deriveSet, set, setFromArray } from "./Schema/api/set.mjs";
12
+ export { OptionalSchemaSymbol, Schema, SchemaTypeId, SchemaVariance, _null, _undefined, _void, annotate, any, array, bigint, boolean, brand, conc, concFromArray, date, declaration, deriveArray, deriveConc, deriveEither, deriveHashMap, deriveHashSet, deriveLazy, deriveList, deriveLiteral, deriveMap, deriveMaybe, deriveReadonlyArray, deriveRecord, deriveSet, deriveStruct, deriveTuple, deriveValidation, either, eitherFromJson, enum_1 as enum, enum_, extend, filter, hashMap, hashMapFromRecord, hashSet, hashSetFromArray, implicitDate, instanceOf, isOptional, isParseOptional, isSchema, keyof, lazy, list, listFromArray, literal, make, map, mapFromRecord, maybe, maybeFromNullable, mutableArray, never, _null_1 as null, nullable, number, object, omit, optional, parseOptional, pick, record, set, setFromArray, string, struct, symbol, templateLiteral, transform, transformOrFail, tuple, _undefined_1 as undefined, union, uniqueSymbol, unknown, _void_1 as void };