@mionjs/run-types 0.13.0 → 0.14.0
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/README.md +3 -3
- package/dist/builders/atomic.js.map +1 -1
- package/dist/builders/compose.js.map +1 -1
- package/dist/builders/index.js.map +1 -1
- package/dist/builders/static.js.map +1 -1
- package/dist/builders/utility.js.map +1 -1
- package/dist/createRTFunctions.js.map +1 -1
- package/dist/enrich/createFriendlyText.js.map +1 -1
- package/dist/enrich/friendlyText.js.map +1 -1
- package/dist/enrich/mockData.js.map +1 -1
- package/dist/fnHash.js.map +1 -1
- package/dist/formats/bigintFormats.js.map +1 -1
- package/dist/formats/datetime/dateFormats.js.map +1 -1
- package/dist/formats/datetime/dateTime-pure-fns.d.ts +21 -21
- package/dist/formats/datetime/dateTime-pure-fns.js +7 -0
- package/dist/formats/datetime/dateTime-pure-fns.js.map +1 -1
- package/dist/formats/datetime/dateTimeParams.js.map +1 -1
- package/dist/formats/datetime/stringDateTimeFormats.js.map +1 -1
- package/dist/formats/datetime/temporalFormats.js.map +1 -1
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/numberFormats.js.map +1 -1
- package/dist/formats/refineFormat.js.map +1 -1
- package/dist/formats/scalars.js.map +1 -1
- package/dist/formats/string/credit-card-pure-fns.d.ts +4 -4
- package/dist/formats/string/credit-card-pure-fns.js.map +1 -1
- package/dist/formats/string/string-formats-pure-fns.d.ts +12 -12
- package/dist/formats/string/string-formats-pure-fns.js +9 -0
- package/dist/formats/string/string-formats-pure-fns.js.map +1 -1
- package/dist/formats/string/string-patterns.js.map +1 -1
- package/dist/formats/string/stringFormats.js.map +1 -1
- package/dist/formats/structural.js.map +1 -1
- package/dist/getRunType.js.map +1 -1
- package/dist/go-generated/fnHashes.generated.js.map +1 -1
- package/dist/go-generated/formatErrorKeys.generated.js.map +1 -1
- package/dist/go-generated/runTypeKind.generated.js.map +1 -1
- package/dist/go-generated/typeFormats.generated.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/markers.js.map +1 -1
- package/dist/mion-pure-fns/_rt/-yTRFuK01Y.js +2 -0
- package/dist/mion-pure-fns/_rt/0yJQ37XnmN.js +2 -0
- package/dist/mion-pure-fns/_rt/2xtQHAMu-y.js +1 -0
- package/dist/mion-pure-fns/_rt/3RndhrueRD.js +2 -0
- package/dist/mion-pure-fns/_rt/5oCqd7YyfA.js +1 -0
- package/dist/mion-pure-fns/_rt/6E7qWsIwaF.js +1 -0
- package/dist/mion-pure-fns/_rt/8AgZCCAhyw.js +1 -0
- package/dist/mion-pure-fns/_rt/AmEsDA-eXW.js +2 -0
- package/dist/mion-pure-fns/_rt/D503ooPt08.js +2 -0
- package/dist/mion-pure-fns/_rt/GA20s6bj41.js +1 -0
- package/dist/mion-pure-fns/_rt/GaLOTE4b_F.js +2 -0
- package/dist/mion-pure-fns/_rt/ICDNQUtC8e.js +1 -0
- package/dist/mion-pure-fns/_rt/IyjvBbz0zS.js +1 -0
- package/dist/mion-pure-fns/_rt/Nnf7kyDfjI.js +2 -0
- package/dist/mion-pure-fns/_rt/OCJ1B0-ZCA.js +1 -0
- package/dist/mion-pure-fns/_rt/OXVO2EpSFv.js +1 -0
- package/dist/mion-pure-fns/_rt/PZzwu-J2YB.js +2 -0
- package/dist/mion-pure-fns/_rt/Qd_9GJQlOC.js +1 -0
- package/dist/mion-pure-fns/_rt/T48n0wyjPx.js +2 -0
- package/dist/mion-pure-fns/_rt/VJiknJ2exR.js +1 -0
- package/dist/mion-pure-fns/_rt/Z2sc5xQPKB.js +1 -0
- package/dist/mion-pure-fns/_rt/ZPLfUKoTJQ.js +1 -0
- package/dist/mion-pure-fns/_rt/_abcB3do2M.js +1 -0
- package/dist/mion-pure-fns/_rt/cK87_2eKQW.js +1 -0
- package/dist/mion-pure-fns/_rt/cgwpjq6rGs.js +1 -0
- package/dist/mion-pure-fns/_rt/d8U9HjmMsN.js +1 -0
- package/dist/mion-pure-fns/_rt/eglb1lzTW9.js +1 -0
- package/dist/mion-pure-fns/_rt/eupKgBrCGt.js +2 -0
- package/dist/mion-pure-fns/_rt/gNpMnJMAUE.js +4 -0
- package/dist/mion-pure-fns/_rt/hiotRbfSKF.js +1 -0
- package/dist/mion-pure-fns/_rt/i-jWpjiwhL.js +1 -0
- package/dist/mion-pure-fns/_rt/iFXkEtW54e.js +1 -0
- package/dist/mion-pure-fns/_rt/jKlKNzqG2-.js +1 -0
- package/dist/mion-pure-fns/_rt/kSLD_nEHux.js +1 -0
- package/dist/mion-pure-fns/_rt/lBHf1kg5nQ.js +1 -0
- package/dist/mion-pure-fns/_rt/lFYcgG5ZSI.js +1 -0
- package/dist/mion-pure-fns/_rt/nLaf1XVvS4.js +2 -0
- package/dist/mion-pure-fns/_rt/n_ZOWff4X3.js +1 -0
- package/dist/mion-pure-fns/_rt/nsU8QeJCuC.js +1 -0
- package/dist/mion-pure-fns/_rt/oUfCfYMODo.js +2 -0
- package/dist/mion-pure-fns/_rt/t3CflNaUUJ.js +2 -0
- package/dist/mion-pure-fns/_rt/tfRjnFZVF8.js +1 -0
- package/dist/mion-pure-fns/_rt/u0Mw9bizvB.js +1 -0
- package/dist/mion-pure-fns/_rt/vPNeWxcCkj.js +3 -0
- package/dist/mion-pure-fns/_rt/wSBaXrUNw9.js +1 -0
- package/dist/mion-pure-fns/_rt/zaCgqTB_lJ.js +5 -0
- package/dist/mion-pure-fns/index.json +114 -114
- package/dist/mocking/childMatch.js.map +1 -1
- package/dist/mocking/constants.mock.d.ts +0 -1
- package/dist/mocking/constants.mock.js +0 -1
- package/dist/mocking/constants.mock.js.map +1 -1
- package/dist/mocking/createMockData.js.map +1 -1
- package/dist/mocking/index.js.map +1 -1
- package/dist/mocking/isMultipleOf.js.map +1 -1
- package/dist/mocking/mockBigIntFormat.js.map +1 -1
- package/dist/mocking/mockDateTimeBounds.js.map +1 -1
- package/dist/mocking/mockInvalid.js.map +1 -1
- package/dist/mocking/mockNumberFormat.js.map +1 -1
- package/dist/mocking/mockRandom.js.map +1 -1
- package/dist/mocking/mockRegistry.js.map +1 -1
- package/dist/mocking/mockStringFormat.js +1 -1
- package/dist/mocking/mockStringFormat.js.map +1 -1
- package/dist/mocking/mockTemporal.js.map +1 -1
- package/dist/mocking/mockType.js.map +1 -1
- package/dist/mocking/mockTypes.js.map +1 -1
- package/dist/mocking/structuralFormat.js.map +1 -1
- package/dist/modelTypes.js.map +1 -1
- package/dist/overrideRTFunctions.js.map +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtypes/builderCore.js.map +1 -1
- package/dist/runtypes/builderTypes.js.map +1 -1
- package/dist/runtypes/circular-pure-fns.d.ts +1 -1
- package/dist/runtypes/circular-pure-fns.js.map +1 -1
- package/dist/runtypes/circular.js.map +1 -1
- package/dist/runtypes/classSerializerRegistry.js.map +1 -1
- package/dist/runtypes/dataOnly.js.map +1 -1
- package/dist/runtypes/entryTuple.js +30 -3
- package/dist/runtypes/entryTuple.js.map +1 -1
- package/dist/runtypes/formatAnnotation.js.map +1 -1
- package/dist/runtypes/formatErrors.js.map +1 -1
- package/dist/runtypes/formatPattern.js.map +1 -1
- package/dist/runtypes/jsonShape.js.map +1 -1
- package/dist/runtypes/pure-fn-ids.generated.d.ts +47 -47
- package/dist/runtypes/pure-fn-ids.generated.js +47 -47
- package/dist/runtypes/pure-fn-ids.generated.js.map +1 -1
- package/dist/runtypes/pure-fns-utils.d.ts +8 -8
- package/dist/runtypes/pure-fns-utils.js +0 -1
- package/dist/runtypes/pure-fns-utils.js.map +1 -1
- package/dist/runtypes/pureFn.js.map +1 -1
- package/dist/runtypes/rtUtils.js +16 -3
- package/dist/runtypes/rtUtils.js.map +1 -1
- package/dist/runtypes/sentinelKeys.js.map +1 -1
- package/dist/runtypes/stripRunTypeMeta.js.map +1 -1
- package/dist/runtypes/typeFormat.js.map +1 -1
- package/dist/runtypes/types.js.map +1 -1
- package/dist/standard/createJsonSchemaFn.js.map +1 -1
- package/dist/standard/createStandardSchema.js.map +1 -1
- package/dist/standard/issueMapping.js +2 -0
- package/dist/standard/issueMapping.js.map +1 -1
- package/dist/standard/jsonSchemaDoc.js.map +1 -1
- package/dist/standard/spec.js.map +1 -1
- package/package.json +21 -58
- package/dist/cjs/builders/atomic.d.ts +0 -12
- package/dist/cjs/builders/atomic.js +0 -43
- package/dist/cjs/builders/compose.d.ts +0 -60
- package/dist/cjs/builders/compose.js +0 -122
- package/dist/cjs/builders/index.d.ts +0 -5
- package/dist/cjs/builders/index.js +0 -48
- package/dist/cjs/builders/static.d.ts +0 -137
- package/dist/cjs/builders/static.js +0 -2
- package/dist/cjs/builders/utility.d.ts +0 -12
- package/dist/cjs/builders/utility.js +0 -43
- package/dist/cjs/createRTFunctions.d.ts +0 -90
- package/dist/cjs/createRTFunctions.js +0 -38
- package/dist/cjs/enrich/createFriendlyText.d.ts +0 -25
- package/dist/cjs/enrich/createFriendlyText.js +0 -275
- package/dist/cjs/enrich/friendlyText.d.ts +0 -56
- package/dist/cjs/enrich/friendlyText.js +0 -2
- package/dist/cjs/enrich/mockData.d.ts +0 -53
- package/dist/cjs/enrich/mockData.js +0 -2
- package/dist/cjs/fnHash.d.ts +0 -8
- package/dist/cjs/fnHash.js +0 -41
- package/dist/cjs/formats/bigintFormats.d.ts +0 -41
- package/dist/cjs/formats/bigintFormats.js +0 -10
- package/dist/cjs/formats/datetime/dateFormats.d.ts +0 -10
- package/dist/cjs/formats/datetime/dateFormats.js +0 -2
- package/dist/cjs/formats/datetime/dateTime-pure-fns.d.ts +0 -21
- package/dist/cjs/formats/datetime/dateTime-pure-fns.js +0 -405
- package/dist/cjs/formats/datetime/dateTimeParams.d.ts +0 -14
- package/dist/cjs/formats/datetime/dateTimeParams.js +0 -2
- package/dist/cjs/formats/datetime/stringDateTimeFormats.d.ts +0 -33
- package/dist/cjs/formats/datetime/stringDateTimeFormats.js +0 -2
- package/dist/cjs/formats/datetime/temporalFormats.d.ts +0 -84
- package/dist/cjs/formats/datetime/temporalFormats.js +0 -23
- package/dist/cjs/formats/index.d.ts +0 -18
- package/dist/cjs/formats/index.js +0 -88
- package/dist/cjs/formats/numberFormats.d.ts +0 -82
- package/dist/cjs/formats/numberFormats.js +0 -16
- package/dist/cjs/formats/refineFormat.d.ts +0 -24
- package/dist/cjs/formats/refineFormat.js +0 -2
- package/dist/cjs/formats/scalars.d.ts +0 -32
- package/dist/cjs/formats/scalars.js +0 -30
- package/dist/cjs/formats/string/credit-card-pure-fns.d.ts +0 -26
- package/dist/cjs/formats/string/credit-card-pure-fns.js +0 -151
- package/dist/cjs/formats/string/string-formats-pure-fns.d.ts +0 -12
- package/dist/cjs/formats/string/string-formats-pure-fns.js +0 -517
- package/dist/cjs/formats/string/string-patterns.d.ts +0 -111
- package/dist/cjs/formats/string/string-patterns.js +0 -115
- package/dist/cjs/formats/string/stringFormats.d.ts +0 -489
- package/dist/cjs/formats/string/stringFormats.js +0 -84
- package/dist/cjs/formats/structural.d.ts +0 -105
- package/dist/cjs/formats/structural.js +0 -7
- package/dist/cjs/getRunType.d.ts +0 -4
- package/dist/cjs/getRunType.js +0 -20
- package/dist/cjs/go-generated/fnHashes.generated.d.ts +0 -196
- package/dist/cjs/go-generated/fnHashes.generated.js +0 -78
- package/dist/cjs/go-generated/formatErrorKeys.generated.d.ts +0 -78
- package/dist/cjs/go-generated/formatErrorKeys.generated.js +0 -40
- package/dist/cjs/go-generated/runTypeKind.generated.d.ts +0 -62
- package/dist/cjs/go-generated/runTypeKind.generated.js +0 -61
- package/dist/cjs/go-generated/typeFormats.generated.d.ts +0 -104
- package/dist/cjs/go-generated/typeFormats.generated.js +0 -30
- package/dist/cjs/index.d.ts +0 -28
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/markers.d.ts +0 -33
- package/dist/cjs/markers.js +0 -14
- package/dist/cjs/mocking/childMatch.d.ts +0 -3
- package/dist/cjs/mocking/childMatch.js +0 -357
- package/dist/cjs/mocking/constants.mock.d.ts +0 -7
- package/dist/cjs/mocking/constants.mock.js +0 -87
- package/dist/cjs/mocking/createMockData.d.ts +0 -8
- package/dist/cjs/mocking/createMockData.js +0 -53
- package/dist/cjs/mocking/index.d.ts +0 -4
- package/dist/cjs/mocking/index.js +0 -9
- package/dist/cjs/mocking/isMultipleOf.d.ts +0 -2
- package/dist/cjs/mocking/isMultipleOf.js +0 -11
- package/dist/cjs/mocking/mockBigIntFormat.d.ts +0 -1
- package/dist/cjs/mocking/mockBigIntFormat.js +0 -38
- package/dist/cjs/mocking/mockDateTimeBounds.d.ts +0 -13
- package/dist/cjs/mocking/mockDateTimeBounds.js +0 -277
- package/dist/cjs/mocking/mockInvalid.d.ts +0 -15
- package/dist/cjs/mocking/mockInvalid.js +0 -233
- package/dist/cjs/mocking/mockNumberFormat.d.ts +0 -1
- package/dist/cjs/mocking/mockNumberFormat.js +0 -56
- package/dist/cjs/mocking/mockRandom.d.ts +0 -20
- package/dist/cjs/mocking/mockRandom.js +0 -106
- package/dist/cjs/mocking/mockRegistry.d.ts +0 -7
- package/dist/cjs/mocking/mockRegistry.js +0 -11
- package/dist/cjs/mocking/mockStringFormat.d.ts +0 -5
- package/dist/cjs/mocking/mockStringFormat.js +0 -238
- package/dist/cjs/mocking/mockTemporal.d.ts +0 -13
- package/dist/cjs/mocking/mockTemporal.js +0 -233
- package/dist/cjs/mocking/mockType.d.ts +0 -3
- package/dist/cjs/mocking/mockType.js +0 -810
- package/dist/cjs/mocking/mockTypes.d.ts +0 -54
- package/dist/cjs/mocking/mockTypes.js +0 -2
- package/dist/cjs/mocking/structuralFormat.d.ts +0 -5
- package/dist/cjs/mocking/structuralFormat.js +0 -82
- package/dist/cjs/modelTypes.d.ts +0 -11
- package/dist/cjs/modelTypes.js +0 -2
- package/dist/cjs/overrideRTFunctions.d.ts +0 -9
- package/dist/cjs/overrideRTFunctions.js +0 -20
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/runtime/index.d.ts +0 -10
- package/dist/cjs/runtime/index.js +0 -25
- package/dist/cjs/runtypes/builderCore.d.ts +0 -7
- package/dist/cjs/runtypes/builderCore.js +0 -39
- package/dist/cjs/runtypes/builderTypes.d.ts +0 -51
- package/dist/cjs/runtypes/builderTypes.js +0 -2
- package/dist/cjs/runtypes/circular-pure-fns.d.ts +0 -11
- package/dist/cjs/runtypes/circular-pure-fns.js +0 -117
- package/dist/cjs/runtypes/circular.d.ts +0 -6
- package/dist/cjs/runtypes/circular.js +0 -25
- package/dist/cjs/runtypes/classSerializerRegistry.d.ts +0 -28
- package/dist/cjs/runtypes/classSerializerRegistry.js +0 -141
- package/dist/cjs/runtypes/dataOnly.d.ts +0 -29
- package/dist/cjs/runtypes/dataOnly.js +0 -2
- package/dist/cjs/runtypes/entryTuple.d.ts +0 -101
- package/dist/cjs/runtypes/entryTuple.js +0 -395
- package/dist/cjs/runtypes/formatAnnotation.d.ts +0 -4
- package/dist/cjs/runtypes/formatAnnotation.js +0 -2
- package/dist/cjs/runtypes/formatErrors.d.ts +0 -18
- package/dist/cjs/runtypes/formatErrors.js +0 -2
- package/dist/cjs/runtypes/formatPattern.d.ts +0 -20
- package/dist/cjs/runtypes/formatPattern.js +0 -17
- package/dist/cjs/runtypes/jsonShape.d.ts +0 -22
- package/dist/cjs/runtypes/jsonShape.js +0 -2
- package/dist/cjs/runtypes/pure-fn-ids.generated.d.ts +0 -47
- package/dist/cjs/runtypes/pure-fn-ids.generated.js +0 -50
- package/dist/cjs/runtypes/pure-fns-utils.d.ts +0 -8
- package/dist/cjs/runtypes/pure-fns-utils.js +0 -147
- package/dist/cjs/runtypes/pureFn.d.ts +0 -7
- package/dist/cjs/runtypes/pureFn.js +0 -52
- package/dist/cjs/runtypes/rtUtils.d.ts +0 -45
- package/dist/cjs/runtypes/rtUtils.js +0 -218
- package/dist/cjs/runtypes/sentinelKeys.d.ts +0 -7
- package/dist/cjs/runtypes/sentinelKeys.js +0 -2
- package/dist/cjs/runtypes/stripRunTypeMeta.d.ts +0 -53
- package/dist/cjs/runtypes/stripRunTypeMeta.js +0 -2
- package/dist/cjs/runtypes/typeFormat.d.ts +0 -14
- package/dist/cjs/runtypes/typeFormat.js +0 -2
- package/dist/cjs/runtypes/types.d.ts +0 -114
- package/dist/cjs/runtypes/types.js +0 -2
- package/dist/cjs/standard/createJsonSchemaFn.d.ts +0 -8
- package/dist/cjs/standard/createJsonSchemaFn.js +0 -16
- package/dist/cjs/standard/createStandardSchema.d.ts +0 -18
- package/dist/cjs/standard/createStandardSchema.js +0 -30
- package/dist/cjs/standard/issueMapping.d.ts +0 -12
- package/dist/cjs/standard/issueMapping.js +0 -36
- package/dist/cjs/standard/jsonSchemaDoc.d.ts +0 -7
- package/dist/cjs/standard/jsonSchemaDoc.js +0 -95
- package/dist/cjs/standard/spec.d.ts +0 -47
- package/dist/cjs/standard/spec.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/-y__pOnrgnvRMz.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/0ofEnb55W0BDIY.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/18wDCH5CXZoQKV.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/2xtQHAMu-yOBo6.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/5oCqd7YyfA9rEw.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/6E7qWsIwaFRGn6.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/6xkN1Qfs9nqO79.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/8Mj42N3ytEEn67.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/A3KjzpjelkcBST.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/AgOXcprpjsrTKk.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/E29ul2pUOyD_Ay.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/EG8OkOOSnT9bZn.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/EYsxRHRDgAykA_.js +0 -3
- package/dist/mion-pure-fns/@mionjs/run-types/Eube1z0GFHuqlM.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/GA20s6bj41GC1A.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/GfQK19ktpvibuZ.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/IyjvBbz0zSlgCJ.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/LqTR2O-h6MYq9J.js +0 -4
- package/dist/mion-pure-fns/@mionjs/run-types/MnJ72PqkyXHiSP.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/NJ9TCGDnkv_9Mn.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/OCJ1B0-ZCAwagS.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/PQVLEBllZckw8I.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/Qd_9GJQlOCVqDe.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/R0IFkkw4SM2gvv.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/THkAA-KNR1HeAe.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/VJiknJ2exR2oMF.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/XYGjy-tcgDROBw.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/Z2sc5xQPKB0oav.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/_3Pmrr5aNmyNi4.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/cgwpjq6rGsI8jb.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/d8U9HjmMsNFd6Z.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/fL3v1v6aVZwJ7-.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/gFl-yXbCxJqWgQ.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/hiotRbfSKFAuK4.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/lFYcgG5ZSI-8em.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/n_ZOWff4X3qBMQ.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/ndkQPoji6DFHx2.js +0 -2
- package/dist/mion-pure-fns/@mionjs/run-types/nsU8QeJCuCF8Kr.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/qMsNYN8hy_sC8i.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/rXVwGkGDX08BsQ.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/rgWveqNi_HeFF8.js +0 -5
- package/dist/mion-pure-fns/@mionjs/run-types/s-tZDRlQfCG5m2.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/t-ntJ9S0FuxkC2.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/tfRjnFZVF8lqI_.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/vLId7t0J8HNWlN.js +0 -1
- package/dist/mion-pure-fns/@mionjs/run-types/zXMPEMyjGR4ZRc.js +0 -1
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRunTypeValue = isRunTypeValue;
|
|
4
|
-
exports.getRTUtils = getRTUtils;
|
|
5
|
-
exports.getRTFnCaches = getRTFnCaches;
|
|
6
|
-
exports.buildPureFnFactoryFromCode = buildPureFnFactoryFromCode;
|
|
7
|
-
exports.buildFactoryFromCode = buildFactoryFromCode;
|
|
8
|
-
exports.entryCode = entryCode;
|
|
9
|
-
const classSerializerRegistry_ts_1 = require("./classSerializerRegistry.js");
|
|
10
|
-
const circular_ts_1 = require("./circular.js");
|
|
11
|
-
function isRunTypeValue(val) {
|
|
12
|
-
return typeof val === 'object' && val !== null && typeof val.id === 'string' && 'kind' in val;
|
|
13
|
-
}
|
|
14
|
-
const rtFnsCache = {};
|
|
15
|
-
const pureFnsCache = {};
|
|
16
|
-
const runTypesCache = {};
|
|
17
|
-
const findRTForTypeMemo = new Map();
|
|
18
|
-
const rtUtils = {
|
|
19
|
-
addToRTCache(comp) {
|
|
20
|
-
rtFnsCache[comp.rtFnHash] = comp;
|
|
21
|
-
findRTForTypeMemo.clear();
|
|
22
|
-
},
|
|
23
|
-
removeFromRTCache(comp) {
|
|
24
|
-
if (!rtFnsCache[comp.rtFnHash])
|
|
25
|
-
return;
|
|
26
|
-
rtFnsCache[comp.rtFnHash] = undefined;
|
|
27
|
-
findRTForTypeMemo.clear();
|
|
28
|
-
},
|
|
29
|
-
getRT(rtFnHash) {
|
|
30
|
-
const entry = rtFnsCache[rtFnHash];
|
|
31
|
-
if (!entry)
|
|
32
|
-
return undefined;
|
|
33
|
-
materializeRTFn(entry);
|
|
34
|
-
return entry;
|
|
35
|
-
},
|
|
36
|
-
findRTForType(familyTag, typeId) {
|
|
37
|
-
const memoKey = familyTag + '\u0000' + typeId;
|
|
38
|
-
const hit = findRTForTypeMemo.get(memoKey);
|
|
39
|
-
if (hit !== undefined) {
|
|
40
|
-
if (hit === null)
|
|
41
|
-
return undefined;
|
|
42
|
-
materializeRTFn(hit);
|
|
43
|
-
return hit;
|
|
44
|
-
}
|
|
45
|
-
const suffix = '_' + typeId;
|
|
46
|
-
for (const key of Object.keys(rtFnsCache)) {
|
|
47
|
-
if (!key.endsWith(suffix))
|
|
48
|
-
continue;
|
|
49
|
-
const entry = rtFnsCache[key];
|
|
50
|
-
if (!entry || entry.familyTag !== familyTag)
|
|
51
|
-
continue;
|
|
52
|
-
materializeRTFn(entry);
|
|
53
|
-
findRTForTypeMemo.set(memoKey, entry);
|
|
54
|
-
return entry;
|
|
55
|
-
}
|
|
56
|
-
findRTForTypeMemo.set(memoKey, null);
|
|
57
|
-
return undefined;
|
|
58
|
-
},
|
|
59
|
-
getRTFn(rtFnHash) {
|
|
60
|
-
const entry = rtFnsCache[rtFnHash];
|
|
61
|
-
if (!entry)
|
|
62
|
-
throw new Error(`RT function not found for rtFnHash ${rtFnHash}`);
|
|
63
|
-
materializeRTFn(entry);
|
|
64
|
-
return entry.fn;
|
|
65
|
-
},
|
|
66
|
-
hasRTFn(rtFnHash) {
|
|
67
|
-
return !!rtFnsCache[rtFnHash];
|
|
68
|
-
},
|
|
69
|
-
addPureFn(id, compiledFn) {
|
|
70
|
-
if (!id)
|
|
71
|
-
throw new Error('Pure function id must be a non-empty string');
|
|
72
|
-
const key = id;
|
|
73
|
-
const existing = pureFnsCache[key];
|
|
74
|
-
if (existing)
|
|
75
|
-
return existing;
|
|
76
|
-
pureFnsCache[key] = compiledFn;
|
|
77
|
-
return compiledFn;
|
|
78
|
-
},
|
|
79
|
-
usePureFn(key) {
|
|
80
|
-
const compiled = pureFnsCache[key];
|
|
81
|
-
if (!compiled)
|
|
82
|
-
throw new Error(`Pure function not found for key "${key}"`);
|
|
83
|
-
initPureFunction(compiled);
|
|
84
|
-
return compiled.fn;
|
|
85
|
-
},
|
|
86
|
-
getPureFn(key) {
|
|
87
|
-
const compiled = pureFnsCache[key];
|
|
88
|
-
if (!compiled)
|
|
89
|
-
return;
|
|
90
|
-
initPureFunction(compiled);
|
|
91
|
-
return compiled.fn;
|
|
92
|
-
},
|
|
93
|
-
getCompiledPureFn(key) {
|
|
94
|
-
return pureFnsCache[key];
|
|
95
|
-
},
|
|
96
|
-
hasPureFn(key) {
|
|
97
|
-
return !!pureFnsCache[key];
|
|
98
|
-
},
|
|
99
|
-
getPureFnByKey(key) {
|
|
100
|
-
const compiled = pureFnsCache[key];
|
|
101
|
-
if (!compiled)
|
|
102
|
-
return;
|
|
103
|
-
initPureFunction(compiled);
|
|
104
|
-
return compiled.fn;
|
|
105
|
-
},
|
|
106
|
-
hasPureFnByKey(key) {
|
|
107
|
-
return !!pureFnsCache[key];
|
|
108
|
-
},
|
|
109
|
-
getCompiledPureFnByKey(key) {
|
|
110
|
-
return pureFnsCache[key];
|
|
111
|
-
},
|
|
112
|
-
addRunType(id, runType) {
|
|
113
|
-
if (!id)
|
|
114
|
-
throw new Error('Run-type id must be a non-empty string');
|
|
115
|
-
runTypesCache[id] = runType;
|
|
116
|
-
return runType;
|
|
117
|
-
},
|
|
118
|
-
removeRunType(id) {
|
|
119
|
-
if (!runTypesCache[id])
|
|
120
|
-
return;
|
|
121
|
-
runTypesCache[id] = undefined;
|
|
122
|
-
},
|
|
123
|
-
getRunType(id) {
|
|
124
|
-
return runTypesCache[id];
|
|
125
|
-
},
|
|
126
|
-
useRunType(id) {
|
|
127
|
-
const rt = runTypesCache[id];
|
|
128
|
-
if (!rt)
|
|
129
|
-
throw new Error(`Run-type not found for id "${id}"`);
|
|
130
|
-
return rt;
|
|
131
|
-
},
|
|
132
|
-
hasRunType(id) {
|
|
133
|
-
return !!runTypesCache[id];
|
|
134
|
-
},
|
|
135
|
-
knowsType(typeId) {
|
|
136
|
-
if (runTypesCache[typeId])
|
|
137
|
-
return true;
|
|
138
|
-
const suffix = '_' + typeId;
|
|
139
|
-
for (const key of Object.keys(rtFnsCache)) {
|
|
140
|
-
if (key.endsWith(suffix) && rtFnsCache[key])
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
return false;
|
|
144
|
-
},
|
|
145
|
-
alwaysThrowFactory(message) {
|
|
146
|
-
return () => {
|
|
147
|
-
throw new Error(message);
|
|
148
|
-
};
|
|
149
|
-
},
|
|
150
|
-
circularError(path) {
|
|
151
|
-
return new circular_ts_1.CircularReferenceError(path);
|
|
152
|
-
},
|
|
153
|
-
getClassSerializer(typeId, className) {
|
|
154
|
-
return (0, classSerializerRegistry_ts_1.getClassSerializer)(typeId, className);
|
|
155
|
-
},
|
|
156
|
-
csEpoch() {
|
|
157
|
-
return (0, classSerializerRegistry_ts_1.classSerializerEpoch)();
|
|
158
|
-
},
|
|
159
|
-
deserializeClass(entry, data, keys) {
|
|
160
|
-
return (0, classSerializerRegistry_ts_1.deserializeClass)(entry, data, keys);
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
function getRTUtils() {
|
|
164
|
-
return rtUtils;
|
|
165
|
-
}
|
|
166
|
-
function getRTFnCaches() {
|
|
167
|
-
return {
|
|
168
|
-
rtFnsCache: rtFnsCache,
|
|
169
|
-
pureFnsCache: pureFnsCache,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function initPureFunction(compiled) {
|
|
173
|
-
if (compiled.fn)
|
|
174
|
-
return;
|
|
175
|
-
let factory = compiled.createPureFn;
|
|
176
|
-
if (!factory) {
|
|
177
|
-
factory = buildPureFnFactoryFromCode(compiled.paramNames, compiled.code ?? '');
|
|
178
|
-
compiled.createPureFn = factory;
|
|
179
|
-
}
|
|
180
|
-
compiled.fn = factory(rtUtils);
|
|
181
|
-
}
|
|
182
|
-
function buildPureFnFactoryFromCode(paramNames, code) {
|
|
183
|
-
return new Function(...paramNames, `'use strict'; ${code}`);
|
|
184
|
-
}
|
|
185
|
-
function buildFactoryFromCode(code) {
|
|
186
|
-
return new Function('utl', `'use strict'; ${code}`);
|
|
187
|
-
}
|
|
188
|
-
function entryCode(entry) {
|
|
189
|
-
if (entry.code !== undefined)
|
|
190
|
-
return entry.code;
|
|
191
|
-
if (entry.createRTFn) {
|
|
192
|
-
const src = entry.createRTFn.toString();
|
|
193
|
-
const open = src.indexOf('{');
|
|
194
|
-
const close = src.lastIndexOf('}');
|
|
195
|
-
const derived = open >= 0 && close > open ? src.slice(open + 1, close) : '';
|
|
196
|
-
entry.code = derived;
|
|
197
|
-
return derived;
|
|
198
|
-
}
|
|
199
|
-
return '';
|
|
200
|
-
}
|
|
201
|
-
const materializing = new Set();
|
|
202
|
-
function materializeRTFn(entry) {
|
|
203
|
-
if (entry.fn)
|
|
204
|
-
return;
|
|
205
|
-
if (materializing.has(entry.rtFnHash))
|
|
206
|
-
return;
|
|
207
|
-
if (!entry.createRTFn && !entry.code)
|
|
208
|
-
return;
|
|
209
|
-
materializing.add(entry.rtFnHash);
|
|
210
|
-
try {
|
|
211
|
-
if (!entry.createRTFn)
|
|
212
|
-
entry.createRTFn = buildFactoryFromCode(entryCode(entry));
|
|
213
|
-
entry.fn = entry.createRTFn(rtUtils);
|
|
214
|
-
}
|
|
215
|
-
finally {
|
|
216
|
-
materializing.delete(entry.rtFnHash);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const __rtFormatName: unique symbol;
|
|
2
|
-
export declare const __rtFormatParams: unique symbol;
|
|
3
|
-
export declare const __rtFormatBrand: unique symbol;
|
|
4
|
-
export declare const __rtContains: unique symbol;
|
|
5
|
-
export declare const __rtPatternProps: unique symbol;
|
|
6
|
-
export declare const __rtPropNames: unique symbol;
|
|
7
|
-
export declare const __rtLabels: unique symbol;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { __rtFormatName, __rtFormatParams, __rtFormatBrand, __rtContains, __rtPatternProps, __rtPropNames } from './sentinelKeys.ts';
|
|
2
|
-
type StripMetaSentinelKeys = typeof __rtFormatName | typeof __rtFormatParams | typeof __rtFormatBrand | typeof __rtContains | typeof __rtPatternProps | typeof __rtPropNames;
|
|
3
|
-
type StripMetaUrl = typeof globalThis extends {
|
|
4
|
-
URL: {
|
|
5
|
-
prototype: infer I;
|
|
6
|
-
};
|
|
7
|
-
} ? I : never;
|
|
8
|
-
type _StripMetaDepth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
9
|
-
export type JsonValue = string | number | boolean | unknown[] | {
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
} | null;
|
|
12
|
-
type StripMetaHasStructuredArm<T> = true extends (T extends string | number | bigint | boolean | null | undefined ? false : T extends readonly unknown[] ? false : T extends object ? StripMetaNoNamedKeys<T> extends true ? false : true : false) ? true : false;
|
|
13
|
-
type StripMetaFmtPart<T> = typeof __rtFormatName extends keyof T ? typeof __rtFormatParams extends keyof T ? {
|
|
14
|
-
readonly [__rtFormatName]?: T[typeof __rtFormatName & keyof T];
|
|
15
|
-
readonly [__rtFormatParams]?: T[typeof __rtFormatParams & keyof T];
|
|
16
|
-
} : {
|
|
17
|
-
readonly [__rtFormatName]?: T[typeof __rtFormatName & keyof T];
|
|
18
|
-
} : unknown;
|
|
19
|
-
type StripMetaContainsPart<T> = typeof __rtContains extends keyof T ? {
|
|
20
|
-
readonly [__rtContains]?: T[typeof __rtContains & keyof T];
|
|
21
|
-
} : unknown;
|
|
22
|
-
type StripMetaPatternPropsPart<T> = typeof __rtPatternProps extends keyof T ? {
|
|
23
|
-
readonly [__rtPatternProps]?: T[typeof __rtPatternProps & keyof T];
|
|
24
|
-
} : unknown;
|
|
25
|
-
type StripMetaPropNamesPart<T> = typeof __rtPropNames extends keyof T ? {
|
|
26
|
-
readonly [__rtPropNames]?: T[typeof __rtPropNames & keyof T];
|
|
27
|
-
} : unknown;
|
|
28
|
-
type StripMetaUnbrandLit<T, Base> = T extends (infer U) & StripMetaFmtPart<T> ? [Extract<keyof U, StripMetaSentinelKeys>] extends [never] ? U : Base : Base;
|
|
29
|
-
type StripMetaUnbrandCollection<T> = T extends ReadonlyMap<infer K, infer V> ? T extends Map<any, any> ? Map<K, V> : ReadonlyMap<K, V> : T extends ReadonlySet<infer U> ? T extends Set<any> ? Set<U> : ReadonlySet<U> : T;
|
|
30
|
-
type StripMetaUnbrandTuple<T, Depth extends number> = T extends (infer U) & StripMetaFmtPart<T> & StripMetaContainsPart<T> & StripMetaPatternPropsPart<T> & StripMetaPropNamesPart<T> ? [Extract<keyof U, StripMetaSentinelKeys>] extends [never] ? U extends readonly unknown[] ? {
|
|
31
|
-
[K in keyof U]: StripRunTypeMeta<U[K], _StripMetaDepth[Depth]>;
|
|
32
|
-
} : T : T : T;
|
|
33
|
-
export type StripRunTypeMeta<T, Depth extends number = 8> = Depth extends 0 ? unknown : unknown extends T ? T : [JsonValue] extends [T] ? [T] extends [JsonValue] ? StripMetaHasStructuredArm<T> extends true ? StripMetaNode<T, Depth> : JsonValue : StripMetaNode<T, Depth> : StripMetaNode<T, Depth>;
|
|
34
|
-
type StripMetaNode<T, Depth extends number> = T extends string ? string extends T ? string : T extends {
|
|
35
|
-
readonly [__rtFormatBrand]: string;
|
|
36
|
-
} ? string : Extract<keyof T, StripMetaSentinelKeys> extends never ? T : StripMetaUnbrandLit<T, string> : T extends number ? number extends T ? number : T extends {
|
|
37
|
-
readonly [__rtFormatBrand]: string;
|
|
38
|
-
} ? number : Extract<keyof T, StripMetaSentinelKeys> extends never ? T : StripMetaUnbrandLit<T, number> : T extends bigint ? bigint extends T ? bigint : T extends {
|
|
39
|
-
readonly [__rtFormatBrand]: string;
|
|
40
|
-
} ? bigint : Extract<keyof T, StripMetaSentinelKeys> extends never ? T : StripMetaUnbrandLit<T, bigint> : T extends boolean ? Extract<keyof T, StripMetaSentinelKeys> extends never ? T : T extends true ? true : T extends false ? false : boolean : T extends null | undefined ? T : T extends Date ? Date : T extends (...args: never[]) => unknown ? T : T extends readonly unknown[] ? StripMetaArray<T, Depth> : T extends object ? StripMetaObject<T, Depth> : T;
|
|
41
|
-
type StripMetaArray<T extends readonly unknown[], Depth extends number> = Extract<keyof T, StripMetaSentinelKeys> extends never ? {
|
|
42
|
-
[K in keyof T]: StripRunTypeMeta<T[K], _StripMetaDepth[Depth]>;
|
|
43
|
-
} : number extends T['length'] ? T extends readonly (infer E)[] ? T extends unknown[] ? StripRunTypeMeta<E, _StripMetaDepth[Depth]>[] : readonly StripRunTypeMeta<E, _StripMetaDepth[Depth]>[] : T : StripMetaUnbrandTuple<T, Depth>;
|
|
44
|
-
type StripMetaLiteralKeys<T> = {
|
|
45
|
-
[K in keyof T as string extends K ? never : number extends K ? never : K extends symbol ? never : K]-?: 0;
|
|
46
|
-
};
|
|
47
|
-
type StripMetaNoNamedKeys<T> = Record<never, never> extends StripMetaLiteralKeys<T> ? true : false;
|
|
48
|
-
type StripMetaObject<T extends object, Depth extends number> = Extract<keyof T, StripMetaSentinelKeys> extends never ? keyof T extends never ? T : T extends ReadonlyMap<any, any> | ReadonlySet<any> | StripMetaUrl ? T : {
|
|
49
|
-
[K in keyof T as K extends symbol ? never : K]: string extends K ? StripMetaNoNamedKeys<T> extends true ? StripRunTypeMeta<T[K], _StripMetaDepth[Depth]> : unknown : number extends K ? StripMetaNoNamedKeys<T> extends true ? StripRunTypeMeta<T[K], _StripMetaDepth[Depth]> : unknown : StripRunTypeMeta<T[K], _StripMetaDepth[Depth]>;
|
|
50
|
-
} : T extends ReadonlyMap<any, any> | ReadonlySet<any> ? StripMetaUnbrandCollection<T> : T extends StripMetaUrl ? StripMetaUrl : Exclude<keyof T, StripMetaSentinelKeys | symbol> extends never ? unknown : {
|
|
51
|
-
[K in keyof T as K extends symbol ? never : K]: string extends K ? StripMetaNoNamedKeys<T> extends true ? StripRunTypeMeta<T[K], _StripMetaDepth[Depth]> : unknown : number extends K ? StripMetaNoNamedKeys<T> extends true ? StripRunTypeMeta<T[K], _StripMetaDepth[Depth]> : unknown : StripRunTypeMeta<T[K], _StripMetaDepth[Depth]>;
|
|
52
|
-
};
|
|
53
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { __rtFormatName, __rtFormatParams, __rtFormatBrand } from './sentinelKeys.ts';
|
|
2
|
-
export type TypeFormatBase = string | number | bigint | Date;
|
|
3
|
-
export type TypeFormatParams = Record<string, unknown>;
|
|
4
|
-
export type TypeFormat<Base extends TypeFormatBase, Name extends string, Params extends object, BrandName extends string = never> = Base & FormatBrand<Name, Params> & ([BrandName] extends [never] ? unknown : NominalBrand<BrandName>);
|
|
5
|
-
export interface FormatBrand<Name extends string, Params extends object> {
|
|
6
|
-
readonly [__rtFormatName]?: Name;
|
|
7
|
-
readonly [__rtFormatParams]?: Params;
|
|
8
|
-
}
|
|
9
|
-
export interface NominalBrand<BrandName extends string> {
|
|
10
|
-
readonly [__rtFormatBrand]: BrandName;
|
|
11
|
-
}
|
|
12
|
-
export type FormatNameOf<T> = typeof __rtFormatName extends keyof T ? NonNullable<T[typeof __rtFormatName & keyof T]> & string : never;
|
|
13
|
-
export type FormatParamsOf<T> = typeof __rtFormatParams extends keyof T ? NonNullable<T[typeof __rtFormatParams & keyof T]> : never;
|
|
14
|
-
export type FormatBrandNameOf<T> = typeof __rtFormatBrand extends keyof T ? T[typeof __rtFormatBrand & keyof T] & string : never;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { RTUtils } from './rtUtils.ts';
|
|
2
|
-
import type { FormatAnnotation } from './formatAnnotation.ts';
|
|
3
|
-
import type { ValidateFn, GetValidationErrorsFn, RemoveUnknownKeysFn, PrepareForJsonFn, RestoreFromJsonFn } from '../createRTFunctions.ts';
|
|
4
|
-
export type PureFunction = (...args: any[]) => any;
|
|
5
|
-
export type PureFunctionFactory = (rtUtils: RTUtils) => PureFunction;
|
|
6
|
-
export interface PureFunctionData {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly paramNames: string[];
|
|
9
|
-
readonly code?: string;
|
|
10
|
-
readonly pureFnDependencies?: Array<string>;
|
|
11
|
-
}
|
|
12
|
-
export interface CompiledPureFunction extends PureFunctionData {
|
|
13
|
-
createPureFn?: PureFunctionFactory;
|
|
14
|
-
fn?: PureFunction;
|
|
15
|
-
}
|
|
16
|
-
export interface SchemaChecks {
|
|
17
|
-
contains?: {
|
|
18
|
-
child: RunType;
|
|
19
|
-
min: number;
|
|
20
|
-
max: number;
|
|
21
|
-
}[];
|
|
22
|
-
patternProps?: {
|
|
23
|
-
source: string;
|
|
24
|
-
key?: RunType;
|
|
25
|
-
value: RunType;
|
|
26
|
-
}[];
|
|
27
|
-
propNames?: RunType[];
|
|
28
|
-
}
|
|
29
|
-
export interface RunType<T = unknown> extends SchemaChecks {
|
|
30
|
-
id: string;
|
|
31
|
-
kind: unknown;
|
|
32
|
-
subKind?: unknown;
|
|
33
|
-
typeName?: unknown;
|
|
34
|
-
name?: unknown;
|
|
35
|
-
literal?: unknown;
|
|
36
|
-
optional?: unknown;
|
|
37
|
-
readonly?: unknown;
|
|
38
|
-
nonEnumerable?: boolean;
|
|
39
|
-
isAbstract?: unknown;
|
|
40
|
-
isStatic?: unknown;
|
|
41
|
-
visibility?: unknown;
|
|
42
|
-
isSafeName?: unknown;
|
|
43
|
-
position?: unknown;
|
|
44
|
-
isCircular?: boolean;
|
|
45
|
-
notSupported?: boolean;
|
|
46
|
-
jsonMaxBytes?: number;
|
|
47
|
-
flags?: unknown;
|
|
48
|
-
description?: unknown;
|
|
49
|
-
defaultVal?: unknown;
|
|
50
|
-
enumVal?: unknown;
|
|
51
|
-
values?: unknown;
|
|
52
|
-
child?: RunType;
|
|
53
|
-
index?: RunType;
|
|
54
|
-
return?: RunType;
|
|
55
|
-
indexType?: RunType;
|
|
56
|
-
parameters?: RunType[];
|
|
57
|
-
children?: RunType[];
|
|
58
|
-
safeUnionChildren?: RunType[];
|
|
59
|
-
unionDiscriminators?: unknown;
|
|
60
|
-
typeMeta?: unknown;
|
|
61
|
-
formatAnnotation?: FormatAnnotation;
|
|
62
|
-
typeArguments?: RunType[];
|
|
63
|
-
arguments?: RunType[];
|
|
64
|
-
extendsArguments?: RunType[];
|
|
65
|
-
implements?: RunType[];
|
|
66
|
-
extends?: RunType;
|
|
67
|
-
classType?: object;
|
|
68
|
-
readonly __rtType?: {
|
|
69
|
-
t: T;
|
|
70
|
-
};
|
|
71
|
-
[extra: string]: unknown;
|
|
72
|
-
}
|
|
73
|
-
export type RunTypesCache = Record<string, RunType>;
|
|
74
|
-
export type AnyFn = (...args: any[]) => any;
|
|
75
|
-
export type CompiledFnArgs = {
|
|
76
|
-
vλl: string;
|
|
77
|
-
[key: string]: string;
|
|
78
|
-
};
|
|
79
|
-
export interface CompiledFnData {
|
|
80
|
-
readonly typeName: string;
|
|
81
|
-
readonly fnID: string;
|
|
82
|
-
readonly familyTag?: string;
|
|
83
|
-
readonly rtFnHash: string;
|
|
84
|
-
readonly args: CompiledFnArgs;
|
|
85
|
-
readonly defaultParamValues: CompiledFnArgs;
|
|
86
|
-
readonly isNoop?: boolean;
|
|
87
|
-
readonly code?: string;
|
|
88
|
-
readonly rtDependencies?: Array<string>;
|
|
89
|
-
readonly pureFnDependencies?: Array<string>;
|
|
90
|
-
paramNames?: string[];
|
|
91
|
-
readonly alwaysThrowMessage?: string;
|
|
92
|
-
}
|
|
93
|
-
export interface CompiledTypeFn<Fn extends AnyFn = AnyFn> extends CompiledFnData {
|
|
94
|
-
readonly createRTFn?: (utl: RTUtils) => Fn;
|
|
95
|
-
readonly fn?: Fn;
|
|
96
|
-
}
|
|
97
|
-
export type InitializedTypeFn<Fn extends AnyFn = AnyFn> = CompiledTypeFn<Fn> & Required<Pick<CompiledTypeFn<Fn>, 'createRTFn' | 'fn'>>;
|
|
98
|
-
export type ValidateRTFn = CompiledTypeFn<ValidateFn>;
|
|
99
|
-
export type GetValidationErrorsRTFn = CompiledTypeFn<GetValidationErrorsFn>;
|
|
100
|
-
export type RemoveUnknownKeysRTFn = CompiledTypeFn<RemoveUnknownKeysFn>;
|
|
101
|
-
export type PrepareForJsonRTFn = CompiledTypeFn<PrepareForJsonFn>;
|
|
102
|
-
export type PrepareForJsonSafeRTFn = CompiledTypeFn<PrepareForJsonFn>;
|
|
103
|
-
export type RestoreFromJsonRTFn = CompiledTypeFn<RestoreFromJsonFn>;
|
|
104
|
-
export type TypesFunctionsCache = Record<string, CompiledTypeFn>;
|
|
105
|
-
export type PureFunctionsCache = Record<string, CompiledPureFunction>;
|
|
106
|
-
export type Mutable<T> = {
|
|
107
|
-
-readonly [K in keyof T]: T[K];
|
|
108
|
-
};
|
|
109
|
-
export type DeepRequired<T> = T extends object ? {
|
|
110
|
-
[P in keyof T]?: DeepRequired<T[P]>;
|
|
111
|
-
} : T;
|
|
112
|
-
export type DeepPartial<T> = T extends object ? {
|
|
113
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
114
|
-
} : T;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { RunType } from '../runtypes/types.ts';
|
|
2
|
-
import type { InjectTypeFnArgs } from '../markers.ts';
|
|
3
|
-
import type { StandardJSONSchemaOptions } from './spec.ts';
|
|
4
|
-
import type { JsonSchemaDocFn } from './jsonSchemaDoc.ts';
|
|
5
|
-
export type JsonSchemaFn = (options?: StandardJSONSchemaOptions) => Record<string, unknown>;
|
|
6
|
-
export declare const jsonSchemaDocFallback: JsonSchemaDocFn;
|
|
7
|
-
export declare function createJsonSchemaFn<T>(runType: RunType<T>, ids?: InjectTypeFnArgs<T, 'jsonSchema'>): JsonSchemaFn;
|
|
8
|
-
export declare function createJsonSchemaFn<T>(val?: T, ids?: InjectTypeFnArgs<T, 'jsonSchema'>): JsonSchemaFn;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsonSchemaDocFallback = void 0;
|
|
4
|
-
exports.createJsonSchemaFn = createJsonSchemaFn;
|
|
5
|
-
const rtUtils_ts_1 = require("../runtypes/rtUtils.js");
|
|
6
|
-
const entryTuple_ts_1 = require("../runtypes/entryTuple.js");
|
|
7
|
-
const jsonSchemaDoc_ts_1 = require("./jsonSchemaDoc.js");
|
|
8
|
-
const jsonSchemaDocFallback = () => {
|
|
9
|
-
throw new Error('createJsonSchemaFn(): no compiled schema document. @mionjs/devtools must be active for the jsonSchema cache entry to exist.');
|
|
10
|
-
};
|
|
11
|
-
exports.jsonSchemaDocFallback = jsonSchemaDocFallback;
|
|
12
|
-
function createJsonSchemaFn(valOrSchema, ids) {
|
|
13
|
-
const runTypeId = (0, rtUtils_ts_1.isRunTypeValue)(valOrSchema) ? valOrSchema.id : undefined;
|
|
14
|
-
const docFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createJsonSchemaFn', exports.jsonSchemaDocFallback, runTypeId, ids);
|
|
15
|
-
return (0, jsonSchemaDoc_ts_1.buildJsonSchemaConverter)(docFn).input;
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { RunType } from '../runtypes/types.ts';
|
|
2
|
-
import type { DataOnly } from '../runtypes/dataOnly.ts';
|
|
3
|
-
import type { ValidateOptions } from '../createRTFunctions.ts';
|
|
4
|
-
import type { CompTimeFnArgs, InjectTypeFnArgs } from '../markers.ts';
|
|
5
|
-
import type { RTValidationIssue } from './issueMapping.ts';
|
|
6
|
-
import type { StandardSchemaSuccessResult, StandardSchemaProps, StandardJSONSchemaConverter } from './spec.ts';
|
|
7
|
-
export interface RTValidationFailureResult {
|
|
8
|
-
readonly issues: ReadonlyArray<RTValidationIssue>;
|
|
9
|
-
}
|
|
10
|
-
export type RTValidationResult<Output> = StandardSchemaSuccessResult<Output> | RTValidationFailureResult;
|
|
11
|
-
export interface RTStandardSchemaV1<Input = unknown, Output = Input> {
|
|
12
|
-
readonly '~standard': Omit<StandardSchemaProps<Input, Output>, 'validate'> & {
|
|
13
|
-
readonly validate: (value: unknown) => RTValidationResult<Output> | Promise<RTValidationResult<Output>>;
|
|
14
|
-
readonly jsonSchema: StandardJSONSchemaConverter;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export declare function createStandardSchema<T>(runType: RunType<T>, options?: CompTimeFnArgs<ValidateOptions>, ids?: InjectTypeFnArgs<T, 'validate', 'validationErrors', 'jsonSchema'>): RTStandardSchemaV1<DataOnly<T>>;
|
|
18
|
-
export declare function createStandardSchema<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, ids?: InjectTypeFnArgs<T, 'validate', 'validationErrors', 'jsonSchema'>): RTStandardSchemaV1<DataOnly<T>>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createStandardSchema = createStandardSchema;
|
|
4
|
-
const rtUtils_ts_1 = require("../runtypes/rtUtils.js");
|
|
5
|
-
const entryTuple_ts_1 = require("../runtypes/entryTuple.js");
|
|
6
|
-
const issueMapping_ts_1 = require("./issueMapping.js");
|
|
7
|
-
const jsonSchemaDoc_ts_1 = require("./jsonSchemaDoc.js");
|
|
8
|
-
const createJsonSchemaFn_ts_1 = require("./createJsonSchemaFn.js");
|
|
9
|
-
const validateFallback = (() => true);
|
|
10
|
-
const errorsFallback = () => [];
|
|
11
|
-
function createStandardSchema(valOrSchema, options, ids) {
|
|
12
|
-
const runTypeId = (0, rtUtils_ts_1.isRunTypeValue)(valOrSchema) ? valOrSchema.id : undefined;
|
|
13
|
-
const valInjected = (0, entryTuple_ts_1.entryTupleAt)(ids, 0);
|
|
14
|
-
const verrInjected = (0, entryTuple_ts_1.entryTupleAt)(ids, 1);
|
|
15
|
-
const jscInjected = (0, entryTuple_ts_1.entryTupleAt)(ids, 2);
|
|
16
|
-
const validate = (0, entryTuple_ts_1.resolveEntryTupleFn)('createValidateFn', validateFallback, runTypeId, valInjected);
|
|
17
|
-
const getErrors = (0, entryTuple_ts_1.resolveEntryTupleFn)('createGetValidationErrorsFn', errorsFallback, runTypeId, verrInjected);
|
|
18
|
-
const docFn = (0, entryTuple_ts_1.resolveEntryTupleFn)('createJsonSchemaFn', createJsonSchemaFn_ts_1.jsonSchemaDocFallback, runTypeId, jscInjected);
|
|
19
|
-
const props = {
|
|
20
|
-
version: 1,
|
|
21
|
-
vendor: 'mion',
|
|
22
|
-
jsonSchema: (0, jsonSchemaDoc_ts_1.buildJsonSchemaConverter)(docFn),
|
|
23
|
-
validate(value) {
|
|
24
|
-
if (validate(value))
|
|
25
|
-
return { value: value };
|
|
26
|
-
return { issues: (0, issueMapping_ts_1.runTypeErrorsToIssues)(getErrors(value)) };
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
return { '~standard': props };
|
|
30
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RTValidationError, RTPathSegment, TypeFormatError } from '../createRTFunctions.ts';
|
|
2
|
-
import type { StandardSchemaIssue } from './spec.ts';
|
|
3
|
-
export interface RTValidationIssue<Format extends TypeFormatError = TypeFormatError> extends StandardSchemaIssue {
|
|
4
|
-
readonly message: string;
|
|
5
|
-
readonly path: ReadonlyArray<PropertyKey | RTPathSegment>;
|
|
6
|
-
readonly expected: string;
|
|
7
|
-
readonly format?: Format;
|
|
8
|
-
}
|
|
9
|
-
export interface IssueMappingOptions {
|
|
10
|
-
message?: (err: RTValidationError) => string;
|
|
11
|
-
}
|
|
12
|
-
export declare function runTypeErrorsToIssues<Format extends TypeFormatError>(errs: RTValidationError<Format>[], options?: IssueMappingOptions): RTValidationIssue<Format>[];
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runTypeErrorsToIssues = runTypeErrorsToIssues;
|
|
4
|
-
function constraintName(format) {
|
|
5
|
-
if (!format)
|
|
6
|
-
return 'type';
|
|
7
|
-
const tail = format.formatPath[format.formatPath.length - 1];
|
|
8
|
-
return tail !== undefined ? String(tail) : format.name;
|
|
9
|
-
}
|
|
10
|
-
function primitiveBound(val) {
|
|
11
|
-
return typeof val === 'string' || typeof val === 'number' || typeof val === 'bigint' || typeof val === 'boolean'
|
|
12
|
-
? val
|
|
13
|
-
: undefined;
|
|
14
|
-
}
|
|
15
|
-
function defaultMessage(err) {
|
|
16
|
-
if (err.expected === 'circular')
|
|
17
|
-
return 'Circular reference';
|
|
18
|
-
if (!err.format)
|
|
19
|
-
return `Expected ${err.expected}`;
|
|
20
|
-
const constraint = constraintName(err.format);
|
|
21
|
-
const bound = primitiveBound(err.format.val);
|
|
22
|
-
if (bound === 'any')
|
|
23
|
-
return `Failed ${err.format.name} constraint`;
|
|
24
|
-
if (bound === undefined || String(bound) === constraint)
|
|
25
|
-
return `Failed ${constraint} constraint`;
|
|
26
|
-
return `Failed ${constraint} constraint (${String(bound)})`;
|
|
27
|
-
}
|
|
28
|
-
function runTypeErrorsToIssues(errs, options) {
|
|
29
|
-
const render = options?.message ?? defaultMessage;
|
|
30
|
-
return errs.map((err) => ({
|
|
31
|
-
message: render(err),
|
|
32
|
-
path: err.path,
|
|
33
|
-
expected: err.expected,
|
|
34
|
-
...(err.format ? { format: err.format } : {}),
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { StandardJSONSchemaConverter } from './spec.ts';
|
|
2
|
-
export type JsonSchemaDocFn = () => Record<string, unknown>;
|
|
3
|
-
export declare const JSON_SCHEMA_TARGET = "draft-2020-12";
|
|
4
|
-
export declare const JSON_SCHEMA_DIALECT_KEYWORDS: readonly ["jsType", "jsResolved", "rtFormat", "rtFormatParams", "tsIndexes", "tsFunction", "tsTemplate", "tsLabels", "tsReadonly", "tsMeta"];
|
|
5
|
-
export declare function closeDeclaredObjects(value: unknown): unknown;
|
|
6
|
-
export declare function stripDialect(value: unknown): unknown;
|
|
7
|
-
export declare function buildJsonSchemaConverter(docFn: JsonSchemaDocFn): StandardJSONSchemaConverter;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JSON_SCHEMA_DIALECT_KEYWORDS = exports.JSON_SCHEMA_TARGET = void 0;
|
|
4
|
-
exports.closeDeclaredObjects = closeDeclaredObjects;
|
|
5
|
-
exports.stripDialect = stripDialect;
|
|
6
|
-
exports.buildJsonSchemaConverter = buildJsonSchemaConverter;
|
|
7
|
-
exports.JSON_SCHEMA_TARGET = 'draft-2020-12';
|
|
8
|
-
exports.JSON_SCHEMA_DIALECT_KEYWORDS = [
|
|
9
|
-
'jsType',
|
|
10
|
-
'jsResolved',
|
|
11
|
-
'rtFormat',
|
|
12
|
-
'rtFormatParams',
|
|
13
|
-
'tsIndexes',
|
|
14
|
-
'tsFunction',
|
|
15
|
-
'tsTemplate',
|
|
16
|
-
'tsLabels',
|
|
17
|
-
'tsReadonly',
|
|
18
|
-
'tsMeta',
|
|
19
|
-
];
|
|
20
|
-
const DIALECT_KEY_SET = new Set(exports.JSON_SCHEMA_DIALECT_KEYWORDS);
|
|
21
|
-
function assertTarget(options) {
|
|
22
|
-
const target = options?.target;
|
|
23
|
-
if (target !== undefined && target !== exports.JSON_SCHEMA_TARGET) {
|
|
24
|
-
throw new RangeError(`mion emits '${exports.JSON_SCHEMA_TARGET}' JSON Schema documents; target '${target}' is not supported`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function isPortable(options) {
|
|
28
|
-
return options?.libraryOptions?.portable === true;
|
|
29
|
-
}
|
|
30
|
-
const ENCODER_STRATEGIES = new Set(['clone', 'mutate', 'compact']);
|
|
31
|
-
function encoderStrategyOf(options) {
|
|
32
|
-
const raw = options?.libraryOptions?.encoderStrategy;
|
|
33
|
-
if (raw === undefined)
|
|
34
|
-
return undefined;
|
|
35
|
-
if (!ENCODER_STRATEGIES.has(raw)) {
|
|
36
|
-
const shown = typeof raw === 'string' ? `'${raw}'` : `a ${typeof raw}`;
|
|
37
|
-
throw new RangeError(`unknown encoderStrategy ${shown} (expected 'clone' | 'mutate')`);
|
|
38
|
-
}
|
|
39
|
-
if (raw === 'compact') {
|
|
40
|
-
throw new RangeError("the 'compact' wire is positional arrays, which this keyed document does not describe; no JSON Schema is emitted for it");
|
|
41
|
-
}
|
|
42
|
-
return raw;
|
|
43
|
-
}
|
|
44
|
-
const VALUE_POSITION_KEYS = new Set(['const', 'enum', 'default', 'examples', 'rtFormatParams']);
|
|
45
|
-
function closeDeclaredObjects(value) {
|
|
46
|
-
if (Array.isArray(value))
|
|
47
|
-
return value.map(closeDeclaredObjects);
|
|
48
|
-
if (value === null || typeof value !== 'object')
|
|
49
|
-
return value;
|
|
50
|
-
const node = value;
|
|
51
|
-
const out = {};
|
|
52
|
-
for (const [key, child] of Object.entries(node)) {
|
|
53
|
-
out[key] = VALUE_POSITION_KEYS.has(key) ? child : closeDeclaredObjects(child);
|
|
54
|
-
}
|
|
55
|
-
const declaredProperties = out.properties;
|
|
56
|
-
if (out.type === 'object' &&
|
|
57
|
-
declaredProperties !== null &&
|
|
58
|
-
typeof declaredProperties === 'object' &&
|
|
59
|
-
!('additionalProperties' in out)) {
|
|
60
|
-
out.additionalProperties = false;
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function stripDialect(value) {
|
|
65
|
-
if (Array.isArray(value))
|
|
66
|
-
return value.map(stripDialect);
|
|
67
|
-
if (value === null || typeof value !== 'object')
|
|
68
|
-
return value;
|
|
69
|
-
const node = value;
|
|
70
|
-
const meta = node.tsMeta;
|
|
71
|
-
if (meta !== null && typeof meta === 'object' && 'base' in meta) {
|
|
72
|
-
return stripDialect(meta.base);
|
|
73
|
-
}
|
|
74
|
-
const out = {};
|
|
75
|
-
for (const [key, child] of Object.entries(node)) {
|
|
76
|
-
if (DIALECT_KEY_SET.has(key))
|
|
77
|
-
continue;
|
|
78
|
-
out[key] = stripDialect(child);
|
|
79
|
-
}
|
|
80
|
-
return out;
|
|
81
|
-
}
|
|
82
|
-
function buildJsonSchemaConverter(docFn) {
|
|
83
|
-
const read = (options) => {
|
|
84
|
-
assertTarget(options);
|
|
85
|
-
let doc = docFn();
|
|
86
|
-
const strategy = encoderStrategyOf(options);
|
|
87
|
-
if (strategy === 'clone') {
|
|
88
|
-
doc = closeDeclaredObjects(doc);
|
|
89
|
-
}
|
|
90
|
-
if (isPortable(options))
|
|
91
|
-
doc = stripDialect(doc);
|
|
92
|
-
return doc;
|
|
93
|
-
};
|
|
94
|
-
return { input: read, output: read };
|
|
95
|
-
}
|