@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
package/README.md
CHANGED
|
@@ -14,10 +14,10 @@ The build-time half lives in
|
|
|
14
14
|
## Documentation
|
|
15
15
|
|
|
16
16
|
Install, guides, the factory reference, and benchmarks live at
|
|
17
|
-
**[mion.
|
|
17
|
+
**[mion.io/runtypes](https://mion.io/runtypes)**.
|
|
18
18
|
|
|
19
|
-
- [Quick start](https://mion.
|
|
20
|
-
- [Configuration](https://mion.
|
|
19
|
+
- [Quick start](https://mion.io/runtypes/introduction/quick-start)
|
|
20
|
+
- [Configuration](https://mion.io/runtypes/introduction/configuration)
|
|
21
21
|
- [Source and issues](https://github.com/MionKit/mion)
|
|
22
22
|
|
|
23
23
|
## Status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomic.js","sourceRoot":"","sources":["../../src/builders/atomic.ts"],"names":[],"mappings":"AAQA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAIzD,MAAM,UAAU,OAAO,CAAC,EAA6B;IACnD,OAAO,aAAa,CAAC,EAAE,EA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,EAAE,EAAC,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAC,CAAC,CAAC;AAChE,CAAC;AAGD,MAAM,UAAU,KAAK,CAAC,EAA2B;IAC/C,OAAO,aAAa,CAAC,EAAE,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAC,CAAC,CAAC;AAC9D,CAAC;AAGD,MAAM,UAAU,QAAQ,CAAC,EAA0B;IACjD,OAAO,aAAa,CAAC,EAAE,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,CAAC,CAAC;AAC7D,CAAC;AAID,MAAM,UAAU,SAAS,CACvB,IAA+C,EAC/C,EAA8B;IAE9B,OAAO,aAAa,CAAC,EAAE,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;AAClD,CAAC;AAKD,MAAM,UAAU,QAAQ,CACtB,UAAa,EACb,EAAgC;IAEhC,OAAO,aAAa,CAAC,EAAE,EAAE,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["// Value-first ATOMIC / NON-FORMAT builders — the kinds that carry no format params, each\n// returning `RunType<T>`. The Go scanner reflects the SAME kind off the builder's\n// `InjectRunTypeId<…>` brand as the type-first surface, so both converge on one structural id\n// and resolve the same precompiled factory. The FORMAT leaf builders live on the\n// `@mionjs/run-types/formats` surface, composition in compose.ts, the standard-library utility\n// builders in utility.ts; runtime-only here, the type helpers are in static.ts /\n// runtypes/builderTypes.ts.\n\nimport {builderResult} from '../runtypes/builderCore.ts';\nimport type {RunType} from '../runtypes/types.ts';\nimport type {InjectRunTypeId} from '../markers.ts';\n\nexport function boolean(id?: InjectRunTypeId<boolean>): RunType<boolean> {\n return builderResult(id, {type: 'boolean', formatParams: {}});\n}\n\n/** `const V` narrows the argument to its literal type, so `literal(true)` is `RunType<true>`, not `RunType<boolean>`. **/\nexport function literal<const V extends string | number | bigint | boolean | null | undefined>(\n value: V,\n id?: InjectRunTypeId<V>\n): RunType<V> {\n return builderResult(id, {type: 'literal', literal: value});\n}\n\n/** No source/flags form: TS has no regex-literal type, and the id would then depend on data absent from `T`.\n * To validate a STRING against a pattern, use `string({pattern: {source, flags, mockSamples}})`. **/\nexport function regexp(id?: InjectRunTypeId<RegExp>): RunType<RegExp> {\n return builderResult(id, {type: 'regexp', formatParams: {}});\n}\n\n/** Symbol identity is not round-trippable, so `createValidateFn(symbol())` throws like the type-first `symbol`. **/\nexport function symbol(id?: InjectRunTypeId<symbol>): RunType<symbol> {\n return builderResult(id, {type: 'symbol', formatParams: {}});\n}\n\n/** No-op validator: every value passes. **/\nexport function any(id?: InjectRunTypeId<any>): RunType<any> {\n return builderResult(id, {type: 'any', formatParams: {}});\n}\n\n/** Every value passes, same as `any`. **/\nexport function unknown(id?: InjectRunTypeId<unknown>): RunType<unknown> {\n return builderResult(id, {type: 'unknown', formatParams: {}});\n}\n\n/** No value passes: the validator returns `false` for every input. **/\nexport function never(id?: InjectRunTypeId<never>): RunType<never> {\n return builderResult(id, {type: 'never', formatParams: {}});\n}\n\n/** Accepts `undefined`, rejects `null`. Can't be named `void` (reserved word); re-exported as `void` by the index. **/\nexport function voidType(id?: InjectRunTypeId<void>): RunType<void> {\n return builderResult(id, {type: 'void', formatParams: {}});\n}\n\n/** Validate matches by SHAPE (data properties, methods skipped), NOT `instanceof`: a plain object of the right shape passes.\n * A GENERIC class needs its instance type pinned (`classType<Box<number>>(Box)`), else it infers the unparameterised one. **/\nexport function classType<Instance>(\n ctor: abstract new (...args: any[]) => Instance,\n id?: InjectRunTypeId<Instance>\n): RunType<Instance> {\n return builderResult(id, {type: 'class', ctor});\n}\n\n/** Takes a TS `enum` or an enum-like record, and carries the union of its VALUES; `const E` keeps a record's literals.\n * That value-union resolves as a UNION, not an enum, so the id diverges from the type-first enum BY DESIGN: a builder\n * can't reconstruct the member-NAME metadata (mocks / error messages). Can't be named `enum` (reserved word). **/\nexport function enumType<const E extends Record<string, string | number>>(\n enumObject: E,\n id?: InjectRunTypeId<E[keyof E]>\n): RunType<E[keyof E]> {\n return builderResult(id, {type: 'enum', members: enumObject});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../src/builders/compose.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAiBzD,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,UAAU,IAAI,GAAG,CAAC,CAAC;AACjI,CAAC;AACD,SAAS,cAAc,CAAC,GAAY;IAClC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAC/F,CAAC;AACD,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,OAAQ,GAA+B,CAAC,WAAW,KAAK,QAAQ,CAAC;AACrH,CAAC;AACD,SAAS,SAAS,CAAC,GAA0D;IAC3E,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAE,GAAe,CAAC;AACjE,CAAC;AA2BD,MAAM,UAAU,KAAK,CACnB,IAAa,EACb,IAAqE,EACrE,IAA+B;IAE/B,MAAM,IAAI,GAAG,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;IAC1C,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,OAA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I,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,aAAa,CAAC,IAA4C,EAAE,MAAM,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["// Children carry compile-time types and are discarded at runtime; dynamic schemas must raise marker-comptime-arg-* errors.\n// CompTimeArgs on a tuple spread collapses it to an array; const T plus MapTuple removes readonly without losing slots.\n// Type helpers live in static.ts; minimize infer per AGENTS.md.\n\nimport {builderResult} from '../runtypes/builderCore.ts';\nimport type {RunType} from '../runtypes/types.ts';\nimport type {ExactParams} from '../runtypes/builderTypes.ts';\nimport type {InjectRunTypeId, CompTimeArgs} from '../markers.ts';\nimport type {\n FormattedCollectionParamsValueFirst,\n FormattedMapParamsValueFirst,\n FormattedObjectParamsValueFirst,\n FormattedArrayFrom,\n FormattedObjectFrom,\n FormattedSetFrom,\n FormattedMapFrom,\n} from '../formats/structural.ts';\n\n// A trailing params bag is a PLAIN object: no RunType marker (`kind` / `type` / `__rtType`),\n// which is what tells it apart from a child schema in a slot that also accepts one\n// (`record`'s key/value), and from an injected id (a string or an entry-module Array).\nfunction isRunTypeLike(arg: unknown): boolean {\n return typeof arg === 'object' && arg !== null && !Array.isArray(arg) && ('kind' in arg || 'type' in arg || '__rtType' in arg);\n}\nfunction isFormatParams(arg: unknown): boolean {\n return typeof arg === 'object' && arg !== null && !Array.isArray(arg) && !isRunTypeLike(arg);\n}\nfunction isSlotCarrier(arg: unknown): arg is {__slotLabel: string; __slotValue: RunType} {\n return typeof arg === 'object' && arg !== null && typeof (arg as {__slotLabel?: unknown}).__slotLabel === 'string';\n}\nfunction slotChild(arg: RunType | {__slotLabel: string; __slotValue: RunType}): RunType {\n return isSlotCarrier(arg) ? arg.__slotValue : (arg as RunType);\n}\nimport type {\n InferType,\n UnionOf,\n IntersectionOf,\n TemplatePart,\n AssembleTemplate,\n ObjectType,\n PropModifiers,\n PropModCarrier,\n Self,\n Recursive,\n LabeledTuple,\n SlotCarrier,\n TupleFromGroups,\n LabeledTupleFromGroups,\n FuncFromParams,\n} from './static.ts';\n\n/** The trailing params bag is the value-first spelling of the JSON Schema collection keywords\n * (`minItems` / `maxItems` / `uniqueItems` / `contains` + `minContains` / `maxContains`), the same bag `set` and `map` take. **/\nexport function array<T>(item: CompTimeArgs<RunType<T>>, id?: InjectRunTypeId<T[]>): RunType<T[]>;\nexport function array<T, const P extends FormattedCollectionParamsValueFirst>(\n item: CompTimeArgs<RunType<T>>,\n params: CompTimeArgs<ExactParams<P, FormattedCollectionParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedArrayFrom<T[], P>>\n): RunType<FormattedArrayFrom<T[], P>>;\nexport function array(\n item: RunType,\n arg2?: FormattedCollectionParamsValueFirst | InjectRunTypeId<unknown>,\n arg3?: InjectRunTypeId<unknown>\n): RunType {\n const base = {type: 'array', child: item};\n if (isFormatParams(arg2)) {\n return builderResult(arg3, base);\n }\n return builderResult(arg2 as InjectRunTypeId<unknown> | undefined, base);\n}\n\n/** One labeled tuple slot / named function parameter, only meaningful inside `tuple(...)` / `func(...)`.\n * Labels are part of a type's structural identity, and they ride a per-slot carrier because a\n * slot-name-keyed spelling cannot work: the type system never observes object key order (see static.ts,\n * SlotCarrier). The group keys those builders take are a fixed set read by name, so no order rides them. **/\nexport function slot<const Label extends string, Value>(\n label: CompTimeArgs<Label>,\n value: CompTimeArgs<RunType<Value>>\n): SlotCarrier<Label, Value> {\n return {__slotLabel: label, __slotValue: value};\n}\n\n/** A tuple builder. The three slot GROUPS (`required` / `optional` / `rest`) are named and every\n * key is optional; the trailing optional elements are their own group, not an inline `optional()`\n * in one list, so the brand needs no recursive `infer`. Groups of PLAIN RunTypes author UNLABELED\n * tuples, groups of `slot(label, value)` carriers author LABELED ones under the same keys (the\n * `__rtLabels` sentinel; static.ts) — TS labels all slots or none, so slots and plain RunTypes\n * never mix and the rest element is a slot too. The keys name the GROUPS, never the slots: a\n * slot-name-keyed object cannot work (see `slot`), so order rides the array INSIDE each group. **/\nexport function tuple<const T extends readonly RunType[] = [], const O extends readonly RunType[] = [], RestValue = never>(\n parts: CompTimeArgs<{readonly required?: T; readonly optional?: O; readonly rest?: RunType<RestValue>}>,\n id?: InjectRunTypeId<TupleFromGroups<T, O, RestValue>>\n): RunType<TupleFromGroups<T, O, RestValue>>;\nexport function tuple<\n const T extends readonly SlotCarrier<string, unknown>[] = [],\n const O extends readonly SlotCarrier<string, unknown>[] = [],\n const RestLabel extends string = never,\n RestValue = never,\n>(\n parts: CompTimeArgs<{\n readonly required?: T;\n readonly optional?: O;\n readonly rest?: SlotCarrier<RestLabel, RestValue>;\n }>,\n id?: InjectRunTypeId<LabeledTupleFromGroups<T, O, RestLabel, RestValue>>\n): RunType<LabeledTupleFromGroups<T, O, RestLabel, RestValue>>;\nexport function tuple(\n parts: {\n readonly required?: readonly (RunType | SlotCarrier<string, unknown>)[];\n readonly optional?: readonly (RunType | SlotCarrier<string, unknown>)[];\n readonly rest?: RunType | SlotCarrier<string, unknown>;\n },\n id?: InjectRunTypeId<unknown>\n): RunType {\n // The groups are read by NAME, so there is no trailing-slot probing: the id always lands in\n // the one unfilled slot the overloads declare. The labels live on the brand only.\n return builderResult(id, {\n type: 'tuple',\n children: (parts.required ?? []).map(slotChild),\n optionalChildren: parts.optional?.map(slotChild),\n rest: parts.rest === undefined ? undefined : slotChild(parts.rest),\n });\n}\n\n/** A union builder. The brand must be a DIRECT union of the member types, NOT `MapTuple<T>[number]`:\n * mapping the whole tuple before indexing it materialises a mapped type the union never needs. The\n * cutoff for the fixed-arity overloads is 8, a measured outlier (`UNION.large_union_eight_arms`) where\n * the direct brand still wins; overload resolution stops at the first matching arity, so narrower\n * unions never pay for the wider overloads. **/\nexport function union<A, B>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>]>,\n id?: InjectRunTypeId<A | B>\n): RunType<A | B>;\nexport function union<A, B, C>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>, RunType<C>]>,\n id?: InjectRunTypeId<A | B | C>\n): RunType<A | B | C>;\nexport function union<A, B, C, D>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>, RunType<C>, RunType<D>]>,\n id?: InjectRunTypeId<A | B | C | D>\n): RunType<A | B | C | D>;\nexport function union<A, B, C, D, E>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>, RunType<C>, RunType<D>, RunType<E>]>,\n id?: InjectRunTypeId<A | B | C | D | E>\n): RunType<A | B | C | D | E>;\nexport function union<A, B, C, D, E, F>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>, RunType<C>, RunType<D>, RunType<E>, RunType<F>]>,\n id?: InjectRunTypeId<A | B | C | D | E | F>\n): RunType<A | B | C | D | E | F>;\nexport function union<A, B, C, D, E, F, G>(\n members: CompTimeArgs<readonly [RunType<A>, RunType<B>, RunType<C>, RunType<D>, RunType<E>, RunType<F>, RunType<G>]>,\n id?: InjectRunTypeId<A | B | C | D | E | F | G>\n): RunType<A | B | C | D | E | F | G>;\nexport function union<A, B, C, D, E, F, G, H>(\n members: CompTimeArgs<\n readonly [RunType<A>, RunType<B>, RunType<C>, RunType<D>, RunType<E>, RunType<F>, RunType<G>, RunType<H>]\n >,\n id?: InjectRunTypeId<A | B | C | D | E | F | G | H>\n): RunType<A | B | C | D | E | F | G | H>;\n// Variable-arity fallback (9+ members). `const T` (not a `readonly [...T]` spread, which the\n// CompTimeArgs brand collapses to an array) keeps the per-member precision UnionOf distributes over.\nexport function union<const T extends readonly RunType[]>(\n members: CompTimeArgs<T>,\n id?: InjectRunTypeId<UnionOf<T>>\n): RunType<UnionOf<T>>;\nexport function union(members: readonly RunType[], id?: InjectRunTypeId<unknown>): RunType {\n return builderResult(id, {type: 'union', children: members});\n}\n\n/** JSON Schema `anyOf` name parity. A union already IS at-least-one, so this IS the union builder. **/\nexport const anyOf = union;\n\n/** An intersection builder, two call shapes. Positional (1–4 members): omitted slots default to\n * `unknown` and vanish (`X & unknown = X`), and the plugin pads them with `undefined` so the\n * injected id lands on the trailing `InjectRunTypeId` parameter. Array (5+): a positional builder\n * plus a TRAILING injected id can't go variadic (JS rest params must be last), so wider\n * intersections take an array — the one place the recursive `infer` of `IntersectionOf` runs. **/\nexport function intersection<A, B = unknown, C = unknown, D = unknown>(\n a: CompTimeArgs<RunType<A>>,\n b?: CompTimeArgs<RunType<B>>,\n c?: CompTimeArgs<RunType<C>>,\n d?: CompTimeArgs<RunType<D>>,\n id?: InjectRunTypeId<A & B & C & D>\n): RunType<A & B & C & D>;\nexport function intersection<const T extends readonly RunType[]>(\n members: CompTimeArgs<T>,\n id?: InjectRunTypeId<IntersectionOf<T>>\n): RunType<IntersectionOf<T>>;\nexport function intersection(\n arg1: RunType | readonly RunType[],\n arg2?: RunType | InjectRunTypeId<unknown>,\n arg3?: RunType,\n arg4?: RunType,\n arg5?: InjectRunTypeId<unknown>\n): RunType {\n // Array form: members in arg1, the injected id in arg2.\n if (Array.isArray(arg1)) {\n return builderResult(arg2 as InjectRunTypeId<unknown> | undefined, {type: 'intersection', children: arg1});\n }\n // Positional form: unused member slots are `undefined`, the injected id is padded to arg5.\n return builderResult(arg5, {\n type: 'intersection',\n children: [arg1, arg2, arg3, arg4] as readonly RunType[],\n });\n}\n\n/** A record / index-signature builder. With one schema the key defaults to `string`; with two, the\n * key schema's type `K` (any `string | number` subtype, a template-literal pattern included) becomes\n * the index-signature key. **/\nexport function record<V>(\n valueSchema: CompTimeArgs<RunType<V>>,\n id?: InjectRunTypeId<Record<string, V>>\n): RunType<Record<string, V>>;\nexport function record<V, const P extends FormattedObjectParamsValueFirst>(\n valueSchema: CompTimeArgs<RunType<V>>,\n params: CompTimeArgs<ExactParams<P, FormattedObjectParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedObjectFrom<Record<string, V>, P>>\n): RunType<FormattedObjectFrom<Record<string, V>, P>>;\nexport function record<K extends string | number, V>(\n keySchema: CompTimeArgs<RunType<K>>,\n valueSchema: CompTimeArgs<RunType<V>>,\n id?: InjectRunTypeId<Record<K, V>>\n): RunType<Record<K, V>>;\nexport function record<K extends string | number, V, const P extends FormattedObjectParamsValueFirst>(\n keySchema: CompTimeArgs<RunType<K>>,\n valueSchema: CompTimeArgs<RunType<V>>,\n params: CompTimeArgs<ExactParams<P, FormattedObjectParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedObjectFrom<Record<K, V>, P>>\n): RunType<FormattedObjectFrom<Record<K, V>, P>>;\nexport function record(\n arg1: RunType,\n arg2?: RunType | FormattedObjectParamsValueFirst | InjectRunTypeId<unknown>,\n arg3?: FormattedObjectParamsValueFirst | InjectRunTypeId<unknown>,\n arg4?: InjectRunTypeId<unknown>\n): RunType {\n // arg2 is a child RunType → (key, value) form; a params bag → (value, params);\n // else (string / tuple / undefined) → value-only, key defaults to string.\n if (isRunTypeLike(arg2)) {\n const base = {type: 'record', index: arg1, child: arg2 as RunType};\n if (isFormatParams(arg3)) {\n return builderResult(arg4, base);\n }\n return builderResult(arg3 as InjectRunTypeId<unknown> | undefined, base);\n }\n const base = {type: 'record', child: arg1};\n if (isFormatParams(arg2)) {\n return builderResult(arg3 as InjectRunTypeId<unknown> | undefined, base);\n }\n return builderResult(arg2 as InjectRunTypeId<unknown> | undefined, base);\n}\n\n/** A `Map` builder; key and value schemas are both validated per entry. A Map's entry is its\n * `[key, value]` pair, so the trailing collection bag's `contains` takes a TUPLE schema and its\n * `uniqueItems` compares pairs by value. Two overloads, like `array`: a single signature with an\n * optional bag was measured and rejected (test/types/builderCost.compile.test.ts) — the bare call\n * must keep its plain id at its plain type cost. **/\nexport function map<K, V>(\n keySchema: CompTimeArgs<RunType<K>>,\n valueSchema: CompTimeArgs<RunType<V>>,\n id?: InjectRunTypeId<Map<K, V>>\n): RunType<Map<K, V>>;\nexport function map<K, V, const P extends FormattedMapParamsValueFirst>(\n keySchema: CompTimeArgs<RunType<K>>,\n valueSchema: CompTimeArgs<RunType<V>>,\n params: CompTimeArgs<ExactParams<P, FormattedMapParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedMapFrom<Map<K, V>, P>>\n): RunType<FormattedMapFrom<Map<K, V>, P>>;\nexport function map(\n keySchema: RunType,\n valueSchema: RunType,\n arg3?: FormattedMapParamsValueFirst | InjectRunTypeId<unknown>,\n arg4?: InjectRunTypeId<unknown>\n): RunType {\n const base = {type: 'map', index: keySchema, child: valueSchema};\n if (isFormatParams(arg3)) return builderResult(arg4, base);\n return builderResult(arg3 as InjectRunTypeId<unknown> | undefined, base);\n}\n\n/** A `Set` builder — each member is validated against the value schema; the trailing bag is the collection bag. **/\nexport function set<V>(valueSchema: CompTimeArgs<RunType<V>>, id?: InjectRunTypeId<Set<V>>): RunType<Set<V>>;\nexport function set<V, const P extends FormattedCollectionParamsValueFirst>(\n valueSchema: CompTimeArgs<RunType<V>>,\n params: CompTimeArgs<ExactParams<P, FormattedCollectionParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedSetFrom<Set<V>, P>>\n): RunType<FormattedSetFrom<Set<V>, P>>;\nexport function set(\n valueSchema: RunType,\n arg2?: FormattedCollectionParamsValueFirst | InjectRunTypeId<unknown>,\n arg3?: InjectRunTypeId<unknown>\n): RunType {\n const base = {type: 'set', child: valueSchema};\n if (isFormatParams(arg2)) return builderResult(arg3, base);\n return builderResult(arg2 as InjectRunTypeId<unknown> | undefined, base);\n}\n\n/** The self-reference placeholder, only meaningful inside a `circular(...)` body. **/\nexport function self(id?: InjectRunTypeId<Self>): RunType<Self> {\n return builderResult(id, {type: 'self'});\n}\n\n/** A recursive schema with NO hand-written type: the body is passed DIRECTLY (no enclosing closure)\n * and points back to itself with the compile-time `self()` marker. Brands the resolved\n * `Recursive<Body>`, so the scanner reflects an ordinary recursive type. Under mutual recursion only\n * a type's OWN back-edge uses `self()`; another already-declared run-type is a plain const reference. **/\nexport function circular<Body>(\n body: CompTimeArgs<RunType<Body>>,\n id?: InjectRunTypeId<Recursive<Body>>\n): RunType<Recursive<Body>> {\n return builderResult(id, {type: 'circular', child: body});\n}\n\n/** A promise is not data: validate refuses it at the root (validate-non-data-root) and drops it at a property. **/\nexport function promise<V>(valueSchema: CompTimeArgs<RunType<V>>, id?: InjectRunTypeId<Promise<V>>): RunType<Promise<V>> {\n return builderResult(id, {type: 'promise', child: valueSchema});\n}\n\n/** A function builder; `ret` defaults to `void` and both keys are optional. The `params` group takes\n * three forms: an ARRAY of positional param RunTypes, an array of `slot(name, …)` carriers (parameter\n * names fold into the structural id; all-required only), or a single params-TUPLE RunType, which is how\n * optional / rest params are authored. An empty or omitted `params` brands a bare `() => InferType<R>`\n * (see `FuncFromParams`, static.ts). Function values aren't serialisable, so the validator depends on\n * POSITION: an object property is skipped, a tuple slot must be `undefined`, a top-level function passes\n * a `typeof === 'function'` gate. **/\nexport function func<const P extends readonly RunType[] = [], R extends RunType = RunType<void>>(\n parts?: CompTimeArgs<{readonly params?: P; readonly ret?: R}>,\n id?: InjectRunTypeId<FuncFromParams<P, InferType<R>>>\n): RunType<FuncFromParams<P, InferType<R>>>;\nexport function func<const P extends readonly SlotCarrier<string, unknown>[], R extends RunType = RunType<void>>(\n parts: CompTimeArgs<{readonly params: P; readonly ret?: R}>,\n id?: InjectRunTypeId<(...args: LabeledTuple<P>) => InferType<R>>\n): RunType<(...args: LabeledTuple<P>) => InferType<R>>;\nexport function func<T extends readonly unknown[], R extends RunType = RunType<void>>(\n parts: CompTimeArgs<{readonly params: RunType<T>; readonly ret?: R}>,\n id?: InjectRunTypeId<(...args: T) => InferType<R>>\n): RunType<(...args: T) => InferType<R>>;\nexport function func(\n parts?: {\n readonly params?: readonly (RunType | SlotCarrier<string, unknown>)[] | RunType;\n readonly ret?: RunType;\n },\n id?: InjectRunTypeId<unknown>\n): RunType {\n // An ARRAY `params` is the array/slots form; a RunType OBJECT is the tuple form (its carried T\n // is the param tuple). The carrier `parameters` is not walked for root function schemas.\n const params = parts?.params;\n const parameters = Array.isArray(params) ? params.map(slotChild) : (params ?? []);\n return builderResult(id, {type: 'function', parameters, return: parts?.ret});\n}\n\n/** InferType is `Fn & Props`: TS can't write a call signature plus mapped props in one object literal.\n * The scanner projects it as one, like the type-first callable interface; validate refuses it at the root (validate-function-root). **/\nexport function callable<Fn, Props>(\n fn: CompTimeArgs<RunType<Fn>>,\n iface: CompTimeArgs<RunType<Props>>,\n id?: InjectRunTypeId<Fn & Props>\n): RunType<Fn & Props> {\n return builderResult(id, {type: 'intersection', children: [fn, iface]});\n}\n\n/** Builds a TS template-literal type from a parts array mixing string segments and `RunType`\n * placeholders: `templateLiteral(['api/user/', number()])` → `` RunType<`api/user/${number}`> ``.\n * The result is a real template-literal TYPE, so it nests anywhere; the `const` type parameter is\n * what keeps a segment a string literal instead of `string`. **/\nexport function templateLiteral<const P extends readonly TemplatePart[]>(\n parts: CompTimeArgs<P>,\n id?: InjectRunTypeId<AssembleTemplate<P>>\n): RunType<AssembleTemplate<P>> {\n return builderResult(id, {type: 'templateLiteral', children: parts});\n}\n\n// ─────────────────── Object assembler + property modifiers ───────────\n//\n// The modifiers `propMod` / `optional` carry are a property-POSITION concern, NOT part of a field's\n// identity, so they ride a DISTINCT carrier `object` unwraps: a brand intersection would corrupt the\n// `__rtFormatName` / `__rtFormatParams` sentinels. `object`'s mapped type (`ObjectType<C>`) applies them.\n\n/** Applies property modifiers to a field; only meaningful as a field inside `object(...)`. **/\nexport function propMod<const M extends PropModifiers, const F>(\n modifiers: CompTimeArgs<ExactParams<M, PropModifiers>>,\n field: CompTimeArgs<F>\n): PropModCarrier<M, F> {\n return {__propMod: modifiers, __field: field};\n}\n\n/** Shortcut for the common modifier; use `propMod` for `readonly` or combinations. **/\nexport function optional<const F>(field: CompTimeArgs<F>): PropModCarrier<{optional: true}, F> {\n return propMod({optional: true}, field);\n}\n\n/** Assembles an object run-type from named field builders via `ObjectType<C>`: a bare field is a\n * required + mutable property, a `propMod(...)` wrapper places the key (`key?:` / `readonly key:`).\n * Strips the `const`-capture `readonly` from un-modified keys. The nested field builders are skipped\n * by the scanner — the enclosing `object` marker reflects the whole shape. **/\nexport function object<const C extends Record<string, unknown>>(\n config: CompTimeArgs<C>,\n id?: InjectRunTypeId<ObjectType<C>>\n): RunType<ObjectType<C>>;\nexport function object<const C extends Record<string, unknown>, const P extends FormattedObjectParamsValueFirst>(\n config: CompTimeArgs<C>,\n params: CompTimeArgs<ExactParams<P, FormattedObjectParamsValueFirst>>,\n id?: InjectRunTypeId<FormattedObjectFrom<ObjectType<C>, P>>\n): RunType<FormattedObjectFrom<ObjectType<C>, P>>;\nexport function object(\n config: Record<string, unknown>,\n arg2?: FormattedObjectParamsValueFirst | InjectRunTypeId<unknown>,\n arg3?: InjectRunTypeId<unknown>\n): RunType {\n if (isFormatParams(arg2)) {\n return builderResult(arg3, config);\n }\n return builderResult(arg2 as InjectRunTypeId<unknown> | undefined, config);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builders/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,GAAG,EACH,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,IAAI,IAAI,EAChB,SAAS,EACT,QAAQ,EACR,QAAQ,IAAI,IAAI,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,GAAG,EACH,GAAG,EACH,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,OAAO,EACP,QAAQ,GACT,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAY,IAAI,QAAQ,EACxB,UAAU,EACV,UAAU,GACX,MAAM,cAAc,CAAC;AAOtB,OAAO,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builders/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,GAAG,EACH,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,IAAI,IAAI,EAChB,SAAS,EACT,QAAQ,EACR,QAAQ,IAAI,IAAI,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,MAAM,EACN,GAAG,EACH,GAAG,EACH,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,OAAO,EACP,QAAQ,GACT,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,WAAW,EACX,YAAY,EACZ,YAAY,IAAI,QAAQ,EACxB,UAAU,EACV,UAAU,GACX,MAAM,cAAc,CAAC;AAOtB,OAAO,+BAA+B,CAAC","sourcesContent":["// The value-first authoring surface, never imported by a type-first consumer. Format builders live beside\n// their types on `@mionjs/run-types/formats` (and `/formats/temporal`).\n\n// The STRUCTURAL array/object keywords are not separate builders: each rides a trailing params\n// bag on `array` / `object` / `record`, and the wrapper TYPES live on the `/formats` surface.\n\nexport {\n boolean,\n literal,\n regexp,\n symbol,\n any,\n unknown,\n never,\n voidType,\n voidType as void,\n classType,\n enumType,\n enumType as enum,\n} from './atomic.ts';\n\n// Composer builders — child schemas nest freely; the outer composer's marker reflects the whole shape.\nexport {\n object,\n array,\n tuple,\n slot,\n union,\n anyOf,\n intersection,\n record,\n map,\n set,\n promise,\n circular,\n self,\n func,\n callable,\n templateLiteral,\n propMod,\n optional,\n} from './compose.ts';\n\n// Utility-type builders — each brands the RESOLVED stdlib utility type, so `partial(model)`\n// converges with `createValidateFn<Partial<T>>()`.\nexport {\n partial,\n required,\n pick,\n omit,\n exclude,\n extract,\n nonNullable,\n readonlyType,\n readonlyType as readonly,\n returnType,\n parameters,\n} from './utility.ts';\n\n// The format-builder type helpers live in runtypes/builderTypes.ts; `InferType` is re-exported from the package root.\nexport type {PropModifiers, MapTuple, TemplatePart, AssembleTemplate, AnyOf} from './static.ts';\n\n// Side-effect import: materialised validators call the built-in pure fns (newRunTypeErr et al.),\n// which register themselves from this file. Run-types themselves register per entry, on first use.\nimport '../runtypes/pure-fns-utils.ts';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/builders/static.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/builders/static.ts"],"names":[],"mappings":"","sourcesContent":["// Shared format helpers live in runtypes/builderTypes.ts to avoid coupling authoring surfaces.\n// Keep inference minimal (AGENTS.md).\n\nimport type {\n __rtFormatName,\n __rtFormatParams,\n __rtFormatBrand,\n __rtContains,\n __rtPatternProps,\n __rtPropNames,\n __rtLabels,\n} from '../runtypes/sentinelKeys.ts';\nimport type {RunType} from '../runtypes/types.ts';\nimport type {InferType} from '../runtypes/builderTypes.ts';\n\nexport type {\n InferType,\n LeafType,\n LeafTypeByFormatName,\n LeafFormatName,\n BrandArg,\n TemporalFormatByTag,\n TemporalBaseByTag,\n TemporalBuilderFn,\n} from '../runtypes/builderTypes.ts';\n\n// ───────────────────────── Property modifiers ───────────────────────\n\n/** Property-POSITION concerns `object`'s mapped type applies, NOT part of a field's identity. **/\nexport interface PropModifiers {\n optional?: true;\n readonly?: true;\n}\n\n/** The carrier `propMod(...)` produces; it never leaks past `object`'s mapped type. **/\nexport interface PropModCarrier<M extends PropModifiers, F> {\n readonly __propMod: M;\n readonly __field: F;\n}\n\n// object's per-field readers — all INDEXED ACCESS / structural guards, no `infer`.\n/** Unwraps a field, inside a `propMod` carrier or bare, to the format type the property holds. **/\nexport type FieldOf<V> = V extends {__propMod: PropModifiers; __field: unknown} ? InferType<V['__field']> : InferType<V>;\nexport type IsOptional<V> = V extends {__propMod: {optional: true}} ? true : false;\nexport type IsReadonly<V> = V extends {__propMod: {readonly: true}} ? true : false;\n\n/** Collapses a split-group object type back into ONE object literal: the identity map preserves each\n * key's `?` / `readonly` exactly, so DON'T write `-readonly` here. The tiers below must build a group\n * intersection (TS can't apply `?` / `readonly` per-key in one map), and left as-is that intersection\n * is what `InferType` shows and it RE-forms at every nesting level. Also measured ~4–9% cheaper to\n * instantiate than the raw intersection. **/\ntype Flatten<T> = {[K in keyof T]: T[K]};\n\n/** The object type `object(C)` produces. The general 4-group (optional × readonly) split pays all four\n * mapped-type passes on EVERY object and compounds at every nesting level (the dominant value-first\n * type-check cost), so two cheap key-probes dispatch on the modifier PROFILE and emit the leanest map\n * that is still exact. Every arm recovers the IDENTICAL type to the 4-way for its profile (proven in\n * container/benchmarks/typecost/isolated-experiment.mjs), so the id still converges with the type-first\n * object. Shared by `object`'s return type and its `InjectRunTypeId<…>` marker param. **/\ntype AnyOptional<C> = true extends {[K in keyof C]: IsOptional<C[K]>}[keyof C] ? true : false;\ntype AnyReadonly<C> = true extends {[K in keyof C]: IsReadonly<C[K]>}[keyof C] ? true : false;\n/** Optional present, no readonly. **/\ntype ObjectOptionalOnly<C> = Flatten<\n {\n -readonly [K in keyof C as IsOptional<C[K]> extends true ? never : K]: FieldOf<C[K]>;\n } & {\n -readonly [K in keyof C as IsOptional<C[K]> extends true ? K : never]?: FieldOf<C[K]>;\n }\n>;\n/** Readonly present, no optional. **/\ntype ObjectReadonlyOnly<C> = Flatten<\n {\n -readonly [K in keyof C as IsReadonly<C[K]> extends true ? never : K]: FieldOf<C[K]>;\n } & {\n readonly [K in keyof C as IsReadonly<C[K]> extends true ? K : never]: FieldOf<C[K]>;\n }\n>;\n/** Both optional AND readonly present — the full 4-way split. **/\ntype ObjectMixed<C> = Flatten<\n {\n -readonly [K in keyof C as IsOptional<C[K]> extends true ? never : IsReadonly<C[K]> extends true ? never : K]: FieldOf<C[K]>;\n } & {\n readonly [K in keyof C as IsOptional<C[K]> extends true ? never : IsReadonly<C[K]> extends true ? K : never]: FieldOf<C[K]>;\n } & {\n -readonly [K in keyof C as IsOptional<C[K]> extends true ? (IsReadonly<C[K]> extends true ? never : K) : never]?: FieldOf<\n C[K]\n >;\n } & {\n readonly [K in keyof C as IsOptional<C[K]> extends true ? (IsReadonly<C[K]> extends true ? K : never) : never]?: FieldOf<\n C[K]\n >;\n }\n>;\nexport type ObjectType<C> =\n AnyOptional<C> extends false\n ? AnyReadonly<C> extends false\n ? {-readonly [K in keyof C]: FieldOf<C[K]>}\n : ObjectReadonlyOnly<C>\n : AnyReadonly<C> extends false\n ? ObjectOptionalOnly<C>\n : ObjectMixed<C>;\n\n// ─────────────────────────── Composer types ─────────────────────────\n\n/** Homomorphic, so it preserves tuple length / order with no `infer`. The `-readonly` strips what\n * `const T` inference adds at the `tuple` / `func` call sites, so the result converges with the type-first tuple. **/\nexport type MapTuple<T extends readonly RunType[]> = {-readonly [K in keyof T]: InferType<T[K]>};\n\n// ───────────────────── Labeled tuples (slot form) ────────────────────\n//\n// The labels ride an ARRAY of slot carriers because tuples are the ONE order-preserving container in\n// the type system: an object literal's key order is NOT observable (the checker keeps `keyof` unions\n// sorted by internal type id), so a record-shaped API would scramble slot order. The builders' own\n// object keys name the GROUPS, a fixed set read by name, so order never rides a key set. TypeScript\n// cannot CONSTRUCT a labeled tuple with a mapped type, so the carried type is the values tuple\n// intersected with the `__rtLabels` sentinel; the Go side lifts that sentinel into the structural id\n// and the projected parameter names, so the slot form converges with the type-first labeled tuple.\n\n/** The carrier `slot(label, value)` produces. Deliberately NOT a RunType (the PropModCarrier discipline):\n * the labeled overloads require EVERY element to be a slot, so TS's all-or-nothing tuple-labeling rule\n * falls out of overload resolution instead of a runtime check. **/\nexport interface SlotCarrier<Label extends string, Value> {\n readonly __slotLabel: Label;\n readonly __slotValue: RunType<Value>;\n}\n\n/** Homomorphic, so slot order is the written order and the result is the MUTABLE values tuple. **/\nexport type SlotValues<Slots extends readonly SlotCarrier<string, unknown>[]> = {\n -readonly [K in keyof Slots]: InferType<Slots[K]['__slotValue']>;\n};\n\n/** The label literals of a slots tuple, same order. **/\nexport type SlotLabels<Slots extends readonly SlotCarrier<string, unknown>[]> = {\n -readonly [K in keyof Slots]: Slots[K]['__slotLabel'];\n};\n\n/** Optional slots keep their `?` on the VALUES tuple; the labels tuple always covers every slot. **/\nexport type LabeledTuple<\n Slots extends readonly SlotCarrier<string, unknown>[],\n OptionalSlots extends readonly SlotCarrier<string, unknown>[] = [],\n> = [...SlotValues<Slots>, ...Partial<SlotValues<OptionalSlots>>] & {\n readonly [__rtLabels]?: readonly [...SlotLabels<Slots>, ...SlotLabels<OptionalSlots>];\n};\n\n/** The rest slot is a labeled slot too (TS tuples label all slots or none), so any rest label is expressible. **/\nexport type LabeledRestTuple<\n Slots extends readonly SlotCarrier<string, unknown>[],\n OptionalSlots extends readonly SlotCarrier<string, unknown>[],\n RestLabel extends string,\n Rest,\n> = [...SlotValues<Slots>, ...Partial<SlotValues<OptionalSlots>>, ...Rest[]] & {\n readonly [__rtLabels]?: readonly [...SlotLabels<Slots>, ...SlotLabels<OptionalSlots>, RestLabel];\n};\n\n// ─────────────────── Group form (the tuple/func options bag) ──────────────────\n//\n// One overload per FAMILY (plain RunTypes, slot carriers) rather than one per shape: an absent `rest`\n// group leaves its type parameter with no inference site, so it lands on the `never` default and a\n// single non-distributive `[Rest] extends [never]` picks the shape. Folding the family check into\n// conditionals too was measured at ~58% more instantiations AND stops rejecting mixed / unknown keys.\n\n/** The type the unlabeled group form carries. `Rest` is `never` when the group\n * is absent, which is the presence check. **/\nexport type TupleFromGroups<Items extends readonly RunType[], OptionalItems extends readonly RunType[], Rest> = [Rest] extends [\n never,\n]\n ? [...MapTuple<Items>, ...Partial<MapTuple<OptionalItems>>]\n : [...MapTuple<Items>, ...Partial<MapTuple<OptionalItems>>, ...Rest[]];\n\n/** The labeled twin, keyed off the rest LABEL's presence — a rest slot always\n * carries one, so the label is the reliable sentinel. **/\nexport type LabeledTupleFromGroups<\n Slots extends readonly SlotCarrier<string, unknown>[],\n OptionalSlots extends readonly SlotCarrier<string, unknown>[],\n RestLabel extends string,\n Rest,\n> = [RestLabel] extends [never] ? LabeledTuple<Slots, OptionalSlots> : LabeledRestTuple<Slots, OptionalSlots, RestLabel, Rest>;\n\n/** An empty / absent params group brands a bare `() => Return`, NOT `(...args: []) => …`: tsgo reflects\n * the empty-tuple rest-spread as a spurious rest parameter, diverging from the written `() => R`. **/\nexport type FuncFromParams<Params extends readonly RunType[], Return> = Params extends readonly []\n ? () => Return\n : (...args: MapTuple<Params>) => Return;\n\n/** `InferType` is a conditional on a naked type parameter, so it DISTRIBUTES over `T[number]` — one arm\n * per member, no recursion. The old `infer Head` / `infer Tail` form guarded against a subtype\n * REDUCTION that no longer happens (the two are proven type-identical across subset+superset, disjoint,\n * literal-widening, duplicate and `any` arms) and cost ~70 instantiations per member against 12 here.\n * NOT `MapTuple<T>[number]`: mapping materialises the whole mapped tuple before indexing it. **/\nexport type UnionOf<T extends readonly RunType[]> = InferType<T[number]>;\n\n/** JSON Schema `anyOf` name parity. Pure sugar: no sentinel, and it converges on the plain union's id. **/\nexport type AnyOf<Branches extends readonly [unknown, ...unknown[]]> = Branches[number];\n\n/** Recursive, terminating at `unknown`, the identity of `&`. Only the array-form `intersection` brands\n * this (the positional overloads can't carry a trailing injected id past a rest), so the recursive-`infer`\n * cost `UnionOf` documents is paid only there. **/\nexport type IntersectionOf<T extends readonly RunType[]> = T extends readonly [\n infer Head extends RunType,\n ...infer Tail extends readonly RunType[],\n]\n ? InferType<Head> & IntersectionOf<Tail>\n : unknown;\n\n/** A template-literal part: a string-literal segment or a `RunType` placeholder. **/\nexport type TemplatePart = string | RunType;\n\n/** The TS template-literal interpolation domain — what a `${…}` placeholder may hold. **/\ntype Interpolatable = string | number | bigint | boolean | null | undefined;\n\n/** Strips a leaf's FORMAT tag back to its base primitive, so a placeholder converges with the type-first\n * plain `${number}` / `${string}`; otherwise the tag leaks in and the scanner reflects a permissive shape.\n * Detection is by KEY PRESENCE, not a required-property `extends` check: the sentinels are optional on\n * `TypeFormat`, and an optional prop does not satisfy a required-prop constraint. **/\ntype Unbrand<X> = typeof __rtFormatName extends keyof X\n ? X extends string\n ? string\n : X extends number\n ? number\n : X extends bigint\n ? bigint\n : X & Interpolatable\n : X & Interpolatable;\ntype PartText<Part extends TemplatePart> = Part extends RunType ? Unbrand<InferType<Part>> : Part & Interpolatable;\n\n/** Folds a parts tuple into the template-literal type it denotes. The `infer` head/tail split is\n * unavoidable here: a mapped type can't JOIN into a template string, and the parts tuple is bounded by\n * the call site so there is no deep-instantiation tax. **/\nexport type AssembleTemplate<P extends readonly TemplatePart[]> = P extends readonly [\n infer Head extends TemplatePart,\n ...infer Tail extends readonly TemplatePart[],\n]\n ? `${PartText<Head>}${AssembleTemplate<Tail>}`\n : '';\n\n// ─────────────────────── Recursive schemas (self / circular) ─────────\n//\n// `Recursive<Body>` ties the knot, substituting every `Self` the body carries with the recursive type\n// itself. The reference is a compile-time marker, so no enclosing callback is needed to capture it.\n// `circular` brands the FULLY-RESOLVED `Recursive<Body>`, so the Go scanner reflects an ordinary\n// recursive type and (with the structural cycle-token anchor in typeid.go) converges with type-first.\n\n// #region substituteself-extract — Self / SubstituteSelf / Recursive machinery;\n// sliced verbatim between these markers by test/types/substituteSelfHarness.ts to\n// build the recursive-schema budget test. Keep self-contained (only `lib` types).\n\n/** The self-reference placeholder `self()` carries — a unique brand so nothing\n * structural can collide with it. **/\ndeclare const SelfBrand: unique symbol;\nexport type Self = {readonly [SelfBrand]: true};\n\n/** Every sentinel key a CONTAINER can carry. A carrier is always `Base & {readonly [key]?: payload}`, and\n * the substitution below must take that apart and put it back: rebuilding the base alone drops the\n * payload, mapping over the whole intersection folds the sentinel INTO the base, and both move the\n * structural id away from the type-first spelling. `CarriedKeyExhaustive` in\n * test/types/sentinelCarry.test-d.ts fails the build if a new sentinel ships without a row here. **/\nexport type CarriedKey =\n | typeof __rtFormatName\n | typeof __rtFormatParams\n | typeof __rtFormatBrand\n | typeof __rtContains\n | typeof __rtPatternProps\n | typeof __rtPropNames\n | typeof __rtLabels;\n\n/** True when `T` carries at least one sentinel: the gate each container arm gets, so a sentinel-free\n * node keeps its ORIGINAL rebuild verbatim (no shape and no id may move for shapes that already work).\n *\n * Deliberately a `keyof` LOOKUP. The two cheaper probes both fail here: an\n * assignability check against `never`-typed slots, and reading each slot by\n * `infer`, each FORCE the deferred `Recursive<Body>` while TypeScript is\n * relating two instances of the recursive type, and the unrolling trips the\n * instantiation-depth limit (TS2589) on every recursive schema. A `keyof`\n * lookup stays structural and lazy. It costs: `keyof` an array instantiates\n * the whole `Array<T>` interface, which is why the budget suite's tree branch\n * moved most. Only a node the cycle actually runs THROUGH ever gets here —\n * everything else short-circuits above — so that cost is bounded by the\n * handful of containers on the cycle, not by the schema's size. **/\ntype HasCarried<T> = [Extract<keyof T, CarriedKey>] extends [never] ? false : true;\n\n/** The sentinel slots of `T`, re-emitted in carrier shape with the\n * substitution run INSIDE each payload — `contains` / `patternProps` /\n * `propertyNames` payloads can themselves reference `Self`. **/\ntype CarrySlots<T, P extends [unknown]> = {\n readonly [K in Extract<keyof T, CarriedKey>]?: SubstituteSelf<NonNullable<T[K]>, P>;\n};\n\n/** `Date` and `RegExp` are a FAST PATH, not a correctness mechanism: they are the builtins a schema\n * carries most often. Nothing may be ADDED here that a real `Map` / `Set` is structurally assignable to,\n * since this arm is tested BEFORE the Map / Set arms: such an entry would swallow `map(string(), self())`\n * and leak the `Self`. That rules out the weak collections, so this list is not a place to fix a walk problem. **/\n\n/** Does `T` reference `Self` anywhere? Walks the same structure as the substitution (Map/Set gated before\n * the object arm), reading each composite's members as one union: the conditional is naked, so it\n * distributes and `AnyTrue` folds the result. Bodies are finite trees (the knot is tied by `Recursive`,\n * never inside a body), so this terminates. **/\ntype ContainsSelf<T, Depth extends unknown[] = []> = AnyTrue<ContainsSelfIn<T, Depth>>;\n\n/** Folds a distributed boolean union: `never` (no members) and all-`false` mean \"no Self\". **/\ntype AnyTrue<B> = [B] extends [never] ? false : [B] extends [false] ? false : true;\n\ntype ContainsSelfIn<T, Depth extends unknown[]> = Depth['length'] extends 24\n ? // Still going at 24 levels means a class, a builtin or a resolved `Recursive<…>`: none can hold a `Self`.\n // `true` was measured: every such node reaches the rebuild, the resolver grows past 10 GB and is killed.\n // Price: a `Self` nested 24 or more levels under a probed node stays un-substituted.\n false\n : 0 extends 1 & T\n ? false\n : T extends Self\n ? true\n : T extends string | number | boolean | bigint | symbol | null | undefined\n ? false\n : T extends Date | RegExp\n ? false\n : T extends Map<any, any>\n ? T extends Map<infer K, infer V>\n ? AnyTrue<ContainsSelfIn<K, Next<Depth>> | ContainsSelfIn<V, Next<Depth>>>\n : false\n : T extends Set<any>\n ? T extends Set<infer E>\n ? ContainsSelf<E, Next<Depth>>\n : false\n : T extends Promise<infer E>\n ? ContainsSelf<E, Next<Depth>>\n : T extends (...args: infer A extends readonly unknown[]) => infer R\n ? AnyTrue<ContainsSelfIn<A[number], Next<Depth>> | ContainsSelfIn<R, Next<Depth>>>\n : T extends readonly unknown[]\n ? number extends T['length']\n ? ContainsSelf<T[number], Next<Depth>>\n : AnyTrue<MembersContainSelf<MemberBoxes<T>[number], Depth>>\n : T extends object\n ? AnyTrue<MembersContainSelf<MemberBoxes<T>[keyof T], Depth>>\n : false;\n\ntype Next<Depth extends unknown[]> = [...Depth, unknown];\n\n/** Each member wrapped in a 1-tuple: read as ONE bare union, an `unknown`-valued member would absorb the\n * union and hide a `Self` beside it (`Self | unknown` IS `unknown`). The box map never calls\n * `ContainsSelf` itself, since a mapped type whose VALUES recurse references itself (TS2615). **/\ntype MemberBoxes<T> = {[K in keyof T]: [T[K]]};\n\ntype MembersContainSelf<Boxed, Depth extends unknown[]> = Boxed extends [infer Member]\n ? ContainsSelf<Member, Next<Depth>>\n : false;\n\n/** Replaces every `Self` with the recursion fixpoint `P[0]`. `P` is a 1-tuple, and threading it rather\n * than a bare type is what lets `Recursive` defer the self-reference. `T extends Self` distributes, so\n * union members substitute individually. A node that does NOT reference `Self` is returned VERBATIM:\n * every container rebuild below either drops a sentinel intersection (Map/Set/array rebuild from\n * inferred pieces) or folds it into the base (the homomorphic maps), which moves the structural id away\n * from the type-first spelling. It is also cheaper, since whole subtrees short-circuit. **/\ntype SubstituteSelf<T, P extends [unknown]> = T extends Self\n ? P[0]\n : T extends string | number | boolean | bigint | symbol | null | undefined\n ? T\n : T extends Date | RegExp\n ? T\n : // Leaves are settled above, so only composites pay for the walk.\n ContainsSelf<T> extends false\n ? T\n : SubstituteInto<T, P>;\n\n/** The rebuild proper — reached only for a composite that really does recurse. **/\ntype SubstituteInto<T, P extends [unknown]> =\n // Gate Map/Set behind cheap non-`infer` checks so non-collection nodes skip the inference machinery.\n T extends Map<any, any>\n ? T extends Map<infer K, infer V>\n ? CarryOnto<Map<SubstituteSelf<K, P>, SubstituteSelf<V, P>>, T, P>\n : never // unreachable — gate guarantees a Map\n : T extends Set<any>\n ? T extends Set<infer E>\n ? CarryOnto<Set<SubstituteSelf<E, P>>, T, P>\n : never // unreachable — gate guarantees a Set\n : T extends Promise<infer E>\n ? Promise<SubstituteSelf<E, P>>\n : T extends (...args: infer A extends readonly unknown[]) => infer R\n ? // Parameter lists are tuples, and the slot form of `RT.func` rides its\n // labels on the same `__rtLabels` carrier a labeled tuple uses.\n (...args: SubstituteTuple<A, P>) => SubstituteSelf<R, P>\n : T extends readonly unknown[]\n ? number extends T['length']\n ? T extends readonly (infer E)[]\n ? CarryOnto<T extends unknown[] ? SubstituteSelf<E, P>[] : readonly SubstituteSelf<E, P>[], T, P>\n : never\n : // The rebuild is mutable; a readonly source wraps back, readonly being part of the id.\n T extends unknown[]\n ? SubstituteTuple<T, P>\n : Readonly<SubstituteTuple<T, P>>\n : T extends object\n ? HasCarried<T> extends true\n ? {[K in keyof T as K extends CarriedKey ? never : K]: SubstituteSelf<T[K], P>} & CarrySlots<T, P>\n : {[K in keyof T]: SubstituteSelf<T[K], P>}\n : T;\n\n/** Re-attaches `Source`'s sentinel slots onto a rebuilt `Base`: the Map / Set / array rebuilds infer\n * their pieces and would otherwise drop the intersection. Only reached for a node the cycle runs\n * THROUGH, so `keyof` on an array (which instantiates the whole `Array<T>` interface) is paid only there. **/\ntype CarryOnto<Base, Source, P extends [unknown]> = HasCarried<Source> extends true ? Base & CarrySlots<Source, P> : Base;\n\n/** Tuples the cycle runs through. The homomorphic map folds a sentinel INTO the tuple, and TypeScript\n * cannot decompose `tuple & object` back into its tuple half (a variadic `infer` yields `unknown[]`, a\n * spread widens to an array, a head/tail `infer` scrambles the slots, a rest-parameter `infer` hands back\n * the whole intersection — all four measured). So a carrier is rebuilt from its INDEXES, which the\n * intersection exposes unchanged, with the labels re-attached. **/\ntype SubstituteTuple<T extends readonly unknown[], P extends [unknown]> =\n HasCarried<T> extends true\n ? IsFixedArity<T> extends true\n ? TupleFromIndexes<T, P, RequiredArity<T>> & CarrySlots<T, P>\n : [\n ...TupleFromIndexes<T, P, RequiredArity<T>>,\n ...Partial<OptionalSlots<T, P> extends infer Slots extends unknown[] ? Slots : []>,\n ] &\n CarrySlots<T, P>\n : {-readonly [K in keyof T]: SubstituteSelf<T[K], P>};\n\n/** A tuple whose `length` is ONE numeric literal: an optional slot makes `length` a union of the legal\n * arities, and a REST element makes it plain `number`, which is the array arm. **/\ntype IsFixedArity<T extends readonly unknown[]> = IsUnion<T['length']> extends true ? false : true;\n\ntype IsUnion<X, All = X> = X extends unknown ? ([All] extends [X] ? false : true) : never;\n\n/** The accumulator whose length is the tuple's REQUIRED arity, the smallest member of the `length` union. **/\ntype RequiredArity<T extends readonly unknown[], Acc extends unknown[] = []> = Acc['length'] extends T['length']\n ? Acc\n : RequiredArity<T, [...Acc, unknown]>;\n\n/** The accumulator whose length is the tuple's TOTAL arity: legal arities are contiguous, so counting\n * stops at the first length the union no longer admits. **/\ntype TotalArity<T extends readonly unknown[], Acc extends unknown[] = RequiredArity<T>> = [\n ...Acc,\n unknown,\n]['length'] extends T['length']\n ? TotalArity<T, [...Acc, unknown]>\n : Acc;\n\n/** Rebuilds a tuple slot by slot up to `Stop`: the intersection's element slots ARE the tuple's, so\n * indexing reaches them without needing the base type back. **/\ntype TupleFromIndexes<\n T,\n P extends [unknown],\n Stop extends unknown[],\n Acc extends unknown[] = [],\n> = Acc['length'] extends Stop['length']\n ? Acc\n : TupleFromIndexes<T, P, Stop, [...Acc, SubstituteSelf<T[Acc['length'] & keyof T], P>]>;\n\n/** The slots PAST the required arity, stripped of the `undefined` their optionality adds. **/\ntype OptionalSlots<T extends readonly unknown[], P extends [unknown]> = DropRequired<\n OptionalCandidates<T, P, TotalArity<T>>,\n RequiredArity<T>\n>;\n\ntype OptionalCandidates<\n T,\n P extends [unknown],\n Stop extends unknown[],\n Acc extends unknown[] = [],\n> = Acc['length'] extends Stop['length']\n ? Acc\n : OptionalCandidates<T, P, Stop, [...Acc, SubstituteSelf<NonNullable<T[Acc['length'] & keyof T]>, P>]>;\n\ntype DropRequired<All extends unknown[], Skip extends unknown[]> = Skip['length'] extends 0\n ? All\n : All extends [unknown, ...infer Rest]\n ? Skip extends [unknown, ...infer SkipRest]\n ? DropRequired<Rest, SkipRest extends unknown[] ? SkipRest : []>\n : All\n : [];\n\n/** Ties a recursive body into the type it denotes: `Recursive<{next?: Self}>` ≡ `type Node = {next?: Node}`.\n * The tuple-wrapped `[Recursive<Body>]` + `P[0]` read defers the self-reference so the alias is legal (a\n * direct substitution errors TS2456). Root-level recursive TUPLES can't be built this way (TS2589). **/\nexport type Recursive<Body> = SubstituteSelf<Body, [Recursive<Body>]>;\n// #endregion substituteself-extract\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.js","sourceRoot":"","sources":["../../src/builders/utility.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AASzD,MAAM,UAAU,OAAO,CA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first authoring of the standard-library utility generics. tsgo\n// resolves the branded `InjectRunTypeId<UtilityType<…>>` to a concrete shape BEFORE the Go scanner\n// computes the structural id, so `createValidateFn(partial(model))` converges with the type-first\n// `createValidateFn<Partial<T>>()` on one id, with no Go-side change.\n\nimport {builderResult} from '../runtypes/builderCore.ts';\nimport type {RunType} from '../runtypes/types.ts';\nimport type {InjectRunTypeId, CompTimeArgs} from '../markers.ts';\n\n// The `CompTimeArgs<…>` brand: children ride the carrier and are discarded at runtime, so the\n// scanner requires each be a static builder call (or a `const` bound to one) and a dynamic schema\n// raises a `marker-comptime-arg-*` diagnostic. Every param here is a single `RunType<…>` (or, for pick/omit, a\n// `const` key array), so the plain wrap preserves inference — no spread juggling like the composers.\n\nexport function partial<T>(model: CompTimeArgs<RunType<T>>, id?: InjectRunTypeId<Partial<T>>): RunType<Partial<T>> {\n return builderResult(id, {type: 'partial', child: model});\n}\n\nexport function required<T>(model: CompTimeArgs<RunType<T>>, id?: InjectRunTypeId<Required<T>>): RunType<Required<T>> {\n return builderResult(id, {type: 'required', child: model});\n}\n\n/** The readonly bit is erased at runtime. Can't be named `readonly` (reserved word); re-exported as `readonly`. **/\nexport function readonlyType<T>(model: CompTimeArgs<RunType<T>>, id?: InjectRunTypeId<Readonly<T>>): RunType<Readonly<T>> {\n return builderResult(id, {type: 'readonly', child: model});\n}\n\nexport function nonNullable<T>(rt: CompTimeArgs<RunType<T>>, id?: InjectRunTypeId<NonNullable<T>>): RunType<NonNullable<T>> {\n return builderResult(id, {type: 'nonNullable', child: rt});\n}\n\nexport function returnType<F extends (...args: any[]) => any>(\n fnRt: CompTimeArgs<RunType<F>>,\n id?: InjectRunTypeId<ReturnType<F>>\n): RunType<ReturnType<F>> {\n return builderResult(id, {type: 'returnType', child: fnRt});\n}\n\n/** `const K` captures the keys as a literal tuple; the `keyof T` bound rejects a misspelled key at the call site. **/\nexport function pick<T, const K extends readonly (keyof T)[]>(\n model: CompTimeArgs<RunType<T>>,\n keys: CompTimeArgs<K>,\n id?: InjectRunTypeId<Pick<T, K[number]>>\n): RunType<Pick<T, K[number]>> {\n return builderResult(id, {type: 'pick', child: model, keys});\n}\n\n/** Drops the listed keys; the optionality of the rest is preserved. **/\nexport function omit<T, const K extends readonly (keyof T)[]>(\n model: CompTimeArgs<RunType<T>>,\n keys: CompTimeArgs<K>,\n id?: InjectRunTypeId<Omit<T, K[number]>>\n): RunType<Omit<T, K[number]>> {\n return builderResult(id, {type: 'omit', child: model, keys});\n}\n\n/** Removes union members assignable to `X`. The removed type rides as a RunType so it can be any shape. **/\nexport function exclude<U, X>(\n union: CompTimeArgs<RunType<U>>,\n removed: CompTimeArgs<RunType<X>>,\n id?: InjectRunTypeId<Exclude<U, X>>\n): RunType<Exclude<U, X>> {\n return builderResult(id, {type: 'exclude', child: union, excluded: removed});\n}\n\nexport function extract<U, X>(\n union: CompTimeArgs<RunType<U>>,\n extracted: CompTimeArgs<RunType<X>>,\n id?: InjectRunTypeId<Extract<U, X>>\n): RunType<Extract<U, X>> {\n return builderResult(id, {type: 'extract', child: union, extracted});\n}\n\n/** Yields a function's parameter tuple, so those parameters can be validated as a first-class tuple. **/\nexport function parameters<F extends (...args: any[]) => any>(\n fnRt: CompTimeArgs<RunType<F>>,\n id?: InjectRunTypeId<Parameters<F>>\n): RunType<Parameters<F>> {\n return builderResult(id, {type: 'parameters', child: fnRt});\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRTFunctions.js","sourceRoot":"","sources":["../src/createRTFunctions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,mBAAmB,EAAC,MAAM,0BAA0B,CAAC;AA2L7D,SAAS,iBAAiB,CAAkB,MAAc,EAAE,UAAa,EAAE,GAAY,EAAE,IAAa;IACpG,MAAM,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAA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AAC;AAiB9D,MAAM,UAAU,mBAAmB,CACjC,WAA4B,EAC5B,QAA6C,EAC7C,EAAuC;IAIvC,OAAO,iBAAiB,CAAgB,qBAAqB,EAAE,qBAAqB,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;AACzG,CAAC;AAaD,MAAM,UAAU,mBAAmB,CACjC,WAA4B,EAC5B,OAA4C,EAC5C,EAAuC;IAIvC,OAAO,iBAAiB,CACtB,qBAAqB,EACrB,iBAA+C,EAC/C,WAAW,EACX,EAAE,CACH,CAAC;AACJ,CAAC;AA6CD,MAAM,UAAU,aAAa,CAA0B,QAAiB,EAAE,QAA6B;IACrG,MAAM,UAAU,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC,CAAU,CAAC;IACtE,OAAO,mBAAmB,CAAC,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAuB,CAAC;AACrG,CAAC","sourcesContent":["// Home for every RT-backed factory exported by this package. Each `createXxx<T>()` is a thin wrapper\n// over the private `createRTFunction` generic; only the identity fallback and return type vary per\n// family. The rtUtils singleton is the only cache; entries arrive as per-entry virtual module tuples\n// injected at each call site (see runtypes/entryTuple.ts).\n\nimport {isRunTypeValue} from './runtypes/rtUtils.ts';\nimport {resolveEntryTupleFn} from './runtypes/entryTuple.ts';\nimport type {AnyFn, RunType} from './runtypes/types.ts';\nimport type {DataOnly} from './runtypes/dataOnly.ts';\nimport type {JSONShape} from './runtypes/jsonShape.ts';\n// One-way (erased) type edge: formatErrors.ts imports TypeFormatError back\n// from here, and both sides are `import type`.\nimport type {FormatErrorsOf} from './runtypes/formatErrors.ts';\nimport type {CompTimeFnArgs, InjectTypeFnArgs} from './index.ts';\n\n// =============================================================================\n// Type definitions\n// =============================================================================\n\n/** Subset of the RunTypeOptions that parameterises the generated `validate` / `getValidationErrors`\n * validators (NOT a property of the type itself). Pass an OBJECT LITERAL at the call site: the\n * Go-side marker scanner reads the values at build time and routes the call to a per-option variant\n * of the validator factory (same structural type id, distinct function id). **/\nexport interface ValidateOptions {\n /** A value with a reference cycle fails: `createValidateFn` returns false, `createGetValidationErrorsFn`\n * records `{expected: 'circular'}`. COMPILE-TIME: forks the fnHash into a distinct entry with the check baked in. **/\n rejectCircularRefs?: boolean;\n /** Folds the unknown-key check INTO the validator: one walk answers \"matches `T`, no undeclared keys\".\n * The key check runs after each object's property checks, so all-required shapes use a key COUNT at any depth.\n * The errors form adds one `{expected: 'never'}` per undeclared key, interleaved per node with the type errors.\n * Index-signature shapes (every key is declared) and arrays take no check; `createRemoveUnknownKeysFn` strips instead.\n * Unions answer PER MATCHED BRANCH: a cat carrying a dog's `barks` fails, reported as `{path: [], expected: 'union'}`.\n * COMPILE-TIME, and a different FAMILY: its cache key is `getFnHash('validateStrict')` / `'validationErrorsStrict'`.\n * **/\n checkUnknowns?: boolean;\n /** The narrow half of `checkUnknowns`: checks keys on UNION MEMBER ARMS only. Default `false`.\n *\n * A stripping decoder cannot clean a union: `prepareForJsonClone` / `compactForJson` never\n * validate, so they pool every member's property names into one allowlist, and emit nothing at all\n * once ANY member carries an index signature. So `{a: string} | Record<string, number>` accepts\n * `{a: 'x', evil: 'garbage'}`, a value matching NEITHER member, and this option rejects it.\n *\n * PER MATCHED BRANCH, not \"reject anything extra\": with `Record<string, string>` that same value\n * IS a valid record and stays accepted. The check runs ONLY on a union with two or more members\n * carrying properties by name (object literals, interfaces, records, named classes), so\n * `{a: string} | number` answers exactly as plain `validate` does; arrays, tuples, `Date`, `Map`,\n * `Set` and atomics do not count.\n *\n * NOT a weaker `checkUnknowns`: a plain object nested INSIDE a member is not a union node, so its\n * own undeclared keys go unchecked. Setting both is allowed and `checkUnknowns` wins.\n *\n * COMPILE-TIME, and like `checkUnknowns` it selects a different compiled FAMILY rather than a\n * variant, so resolve `getFnHash('validateUnionKeys')`, or `'validationErrorsUnionKeys'` for the\n * errors form. **/\n checkUnionUnknowns?: boolean;\n /** How a `number` is checked, to match other libraries: `'isFinite'` (default) rejects `NaN` / `±Infinity`,\n * `'typeof'` accepts them (as ajv / typia / JSON Schema do), `'notNaN'` rejects only `NaN`.\n * COMPILE-TIME: forks the fnHash; the `validate.numberMode` plugin / tsconfig option sets the project default, a per-call value overrides it. **/\n numberMode?: 'isFinite' | 'typeof' | 'notNaN';\n}\n\n/** Non-data members are excluded (AGENTS.md validate contract); unknown defaults keep untyped cache guards boolean-shaped. **/\nexport type ValidateFn<T = unknown> = (value: unknown) => value is DataOnly<T>;\n\n/** Path segment for a Map / Set entry. `key` is the entry's iteration index: a Map/Set entry has no\n * serialisable address of its own (keys/items can be objects, symbols or null), so the position is\n * the only universal pointer, and a number is what Standard Schema's `getDotPath` can read.\n * `failed` marks which side of the entry tripped. A valid Standard Schema `PathSegment` (it has\n * `key: PropertyKey`); the extra `failed` is ignored by spec consumers. **/\nexport interface RTPathSegment {\n key: number;\n failed?: 'mapKey' | 'mapValue' | 'setKey';\n}\n\n/** One segment of a RTValidationError path: an object key (`string`), an array\n * / tuple index (`number`), or a Map / Set entry (`RTPathSegment`). Every form\n * is `PropertyKey | {key: PropertyKey}`, so a path is already a valid Standard\n * Schema `path` with no transformation. **/\nexport type RTValidationErrorPathSegment = string | number | RTPathSegment;\n\n/** Format-specific error detail attached to a RTValidationError when a TypeFormat constraint\n * (pattern, length, version, …) fails. `name` is the format name (e.g. 'stringFormat', 'uuid');\n * `formatPath` locates the failing param; `val` is the param value/marker.\n *\n * `createGetValidationErrorsFn<T>()` returns the narrowed union for `T` (see `FormatErrorsOf`), so\n * `switch (format.name)` narrows `errorType` per format; the bare `TypeFormatError` is the wide\n * shape every consumer accepts. **/\nexport interface TypeFormatError<Name extends string = string, Mode extends string = string> {\n name: Name;\n val: RTValidationErrorPathSegment | boolean | bigint | (RTValidationErrorPathSegment | boolean | bigint)[];\n formatPath: (string | number)[];\n /** WHICH way the format failed, for a format with more than one (a card number can be the wrong\n * shape, carry a broken checksum, or belong to a network the field does not take). Formats with a\n * single failure mode leave it unset. Always a stable string the format documents\n * (`CreditCardErrorType`, `EmailErrorType`, `DomainErrorType`, `IpErrorType`), so a consumer can\n * switch on it: `formatPath` locates the failing param, this names the mode. */\n errorType?: Mode;\n /** Echoed by the emitter when the field's number format sets the\n * `isCurrency` param — pure presentation metadata: `createFriendlyTextI18n`\n * renders the violated bound as money in the active locale. */\n isCurrency?: boolean;\n}\n\n/** One validation error. `Format` is the typed format detail (see\n * `FormatErrorsOf<T>`); the bare `RTValidationError` is the wide shape, which\n * every narrowed one assigns to. **/\nexport interface RTValidationError<Format extends TypeFormatError = TypeFormatError> {\n path: RTValidationErrorPathSegment[];\n expected: string;\n /** Present when a TypeFormat constraint failed (emitted via formatErr). */\n format?: Format;\n}\n\n/** Validator returned by `createGetValidationErrorsFn<T>()`. The optional `path` and `errors` slots\n * let it be chained or pre-seeded, and the pre-seed slot stays wide so a chain across types keeps\n * compiling. `Format` is the typed format detail the returned errors carry: the factory hands back\n * `GetValidationErrorsFn<FormatErrorsOf<T>>`, and the bare `GetValidationErrorsFn` is the wide\n * shape every narrowed one assigns to. (Parameterized over the error rather than over `T` so the\n * parameter stays measurably covariant.) **/\nexport type GetValidationErrorsFn<Format extends TypeFormatError = TypeFormatError> = (\n value: unknown,\n path?: RTValidationErrorPathSegment[],\n errors?: RTValidationError[]\n) => RTValidationError<Format>[];\n\n/** Deep copy of the declared shape; a value it cannot rebuild (function, Promise, RegExp) follows `sharedValues`.\n * `overrideRemoveUnknownKeys<T>()` is the escape hatch for custom copying. **/\nexport type RemoveUnknownKeysFn<T = unknown> = (value: T) => T;\n/** For a value the copy cannot rebuild: absent shares and warns, `'share'` shares quietly (the unknown-keys-*-shared codes).\n * `'refuse'` makes the function always throw (unknown-keys-shared-value-refused). Compile-time: each value is its own family. **/\nexport interface RemoveUnknownKeysOptions {\n sharedValues?: 'share' | 'refuse';\n}\n\n/** Reduces a type to the plain runtime value the format transform operates on: TypeFormat brands\n * collapse to their base (string formats → `string`), nested objects / arrays recurse. The brand is\n * erased at runtime, so callers pass and receive plain data — `createFormatTransformFn<Lowercase>()`\n * is `(value: string) => string`, not a branded-in/branded-out fn. **/\nexport type FormatTransformValue<T> = T extends string\n ? string\n : T extends number\n ? number\n : T extends boolean\n ? boolean\n : T extends readonly (infer E)[]\n ? FormatTransformValue<E>[]\n : T extends object\n ? {[K in keyof T]: FormatTransformValue<T[K]>}\n : T;\n\n/** Applies `T`'s format `transform` rewrites (identity when it declares none); mion runs it on route params via `sanitizeParams`.\n * Never a step inside validate / encode / decode. **/\nexport type FormatTransformFn<T> = (value: FormatTransformValue<T>) => FormatTransformValue<T>;\n\n// `T` defaults to `unknown`, where `JSONShape` and `DataOnly` collapse to `unknown`, so the\n// bare alias is the shape `getRTFunction` hands back.\nexport type PrepareForJsonFn<T = unknown> = (value: T) => JSONShape<T>;\nexport type RestoreFromJsonFn<T = unknown> = (value: unknown) => DataOnly<T>;\n\n/** Stringifier returned by `createJsonEncoderFn<T>()`. Returns the JSON string,\n * OR `undefined` for top-level `undefined` inputs (matches `JSON.stringify`). **/\nexport type JsonEncoderFn = (value: unknown) => string | undefined;\n\n/** Parse function returned by `createJsonDecoderFn<T>()`. **/\nexport type JsonDecoderFn<T = unknown> = (serialized: string) => T;\n\n/** JSON `strategy` for every JSON entry point; an encode / decode pair must name the SAME word.\n * `'clone'` (default) builds a new value from the declared shape, dropping undeclared keys; `'mutate'` works in\n * place and keeps them; `'compact'` writes objects as positional arrays. An unrecognised word compiles as `'clone'`. **/\nexport type JsonValueStrategy = 'clone' | 'mutate' | 'compact';\nexport type PrepareForJsonOptions = {strategy?: JsonValueStrategy};\nexport type RestoreFromJsonOptions = {strategy?: JsonValueStrategy};\n\n/** `'compact'` cannot tell a present `null` from absent on an `any` / `unknown`-like optional. **/\nexport type JsonEncoderStrategy = JsonValueStrategy;\n// Both options are COMPILE-TIME (see ValidateOptions.rejectCircularRefs): `strategy`\n// selects the composite, and `rejectCircularRefs` forks it into an armed variant\n// whose body throws a CircularReferenceError on a reference cycle.\nexport type JsonEncoderOptions = {strategy?: JsonEncoderStrategy; rejectCircularRefs?: boolean};\n\nexport type JsonDecoderStrategy = JsonValueStrategy;\nexport type JsonDecoderOptions = {strategy?: JsonDecoderStrategy};\n\n// =============================================================================\n// Private generic factories\n// =============================================================================\n\n/** Resolves the compiled closure for a createX factory routed through the InjectTypeFnArgs marker.\n * The plugin injects the entry-module tuple at the trailing slot; `resolveEntryTupleFn` registers\n * its dep closure and resolves the exact cache key (`<fnHash>_<typeId>`, variants pre-baked at\n * build time). Slot 0 (`val`) may be a value-first schema whose runtime `.id` overrides the\n * injected typeId (correct even for recursive schemas); the family fnHash still comes from the\n * injected tuple's key. **/\nfunction resolveTupleEntry<F extends AnyFn>(fnName: string, identityFn: F, val: unknown, args: unknown): F {\n const runTypeId = isRunTypeValue(val) ? val.id : undefined;\n return resolveEntryTupleFn(fnName, identityFn, runTypeId, args);\n}\n\n/** Returns the compiled closure for an option-carrying createX factory (3-arg\n * `(val, options, args)`). The injected entry tuple sits at the trailing slot; options @slot1\n * (`rejectCircularRefs` included) are compile-time, baked into the tuple's key, so the runtime\n * ignores them. **/\nfunction createTypeFnArgsFunction<F extends AnyFn>(\n fnName: string,\n identityFn: F\n): (val?: unknown, options?: unknown, args?: unknown) => F {\n return (val, _options, args) => resolveTupleEntry(fnName, identityFn, val, args);\n}\n\n/** Option-less family: the entry tuple sits at slot 1; a value-first schema at slot 0 overrides its typeId. **/\nfunction createRTFunction<F extends AnyFn>(fnName: string, identityFn: F): (val?: unknown, args?: unknown) => F {\n return (val, args) => resolveTupleEntry(fnName, identityFn, val, args);\n}\n\n// =============================================================================\n// Standard family wrappers.\n//\n// The trailing `as unknown as <T>(...) => Fn` cast restores the generic <T>\n// signature the Go-side marker scanner reads to identify call sites. <T>\n// only exists at the type-checker layer and is erased before execution.\n// =============================================================================\n\nconst identityValueFn = (v: unknown) => v;\nconst getValidationErrorsIdentity: GetValidationErrorsFn<never> = () => [];\n\n// Two overloads, run-type form FIRST: TS resolves intersected call signatures top-to-bottom, and a\n// `RunType<T>` arg must be tried before the `val?: T` reflection form, which would otherwise absorb\n// it as `T = RunType<…>`. In the run-type form `createValidateFn(rt)` the call IS the injection site\n// — `T` comes off `rt: RunType<T>` and is reflected through the trailing marker, with no `runType.id`\n// read and no ref-tracing. Both overloads share the runtime impl (slot0 ignored, options @slot1,\n// injected id @slot2).\nexport const createValidateFn = createTypeFnArgsFunction<ValidateFn>(\n 'createValidateFn',\n // Cast through `unknown` because `ValidateFn` is a type guard: a direct cast of a boolean fn is\n // rejected, the two do not structurally overlap.\n (() => true) as unknown as ValidateFn\n) as unknown as (<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<ValidateOptions>,\n id?: InjectTypeFnArgs<T, 'validate'>\n) => ValidateFn<T>) &\n (<T>(val?: T, options?: CompTimeFnArgs<ValidateOptions>, id?: InjectTypeFnArgs<T, 'validate'>) => ValidateFn<T>);\n\nexport const createGetValidationErrorsFn = createTypeFnArgsFunction<GetValidationErrorsFn>(\n 'createGetValidationErrorsFn',\n getValidationErrorsIdentity\n) as unknown as (<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<ValidateOptions>,\n id?: InjectTypeFnArgs<T, 'validationErrors'>\n) => GetValidationErrorsFn<FormatErrorsOf<T>>) &\n (<T>(\n val?: T,\n options?: CompTimeFnArgs<ValidateOptions>,\n id?: InjectTypeFnArgs<T, 'validationErrors'>\n ) => GetValidationErrorsFn<FormatErrorsOf<T>>);\n\n// Leaf families take no options: a slot would let callers pass values the Go emitter silently ignores.\n\n/** Returns a new value with only the declared keys (Dates, Maps, Sets, prototypes kept); never mutates the input.\n * `options` is read by the scanner to pick the family, never at runtime. **/\nexport const createRemoveUnknownKeysFn = createTypeFnArgsFunction<RemoveUnknownKeysFn>(\n 'createRemoveUnknownKeysFn',\n identityValueFn\n) as unknown as (<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<RemoveUnknownKeysOptions>,\n id?: InjectTypeFnArgs<T, 'removeUnknownKeys'>\n) => RemoveUnknownKeysFn<T>) &\n (<T>(\n val?: T,\n options?: CompTimeFnArgs<RemoveUnknownKeysOptions>,\n id?: InjectTypeFnArgs<T, 'removeUnknownKeys'>\n ) => RemoveUnknownKeysFn<T>);\n\n// =============================================================================\n// The VALUE-level JSON transforms, no string step: for a framework that parses ONE envelope per\n// request and transforms many values inside it. Root `undefined` / `void` never throw (prepare\n// passes the value through, restore returns `undefined`); the string encoder's `[value]` array\n// envelope is a JSON-document concern the caller's own envelope replaces.\n// =============================================================================\n\n/** Typed value in, JSON-safe value out (bigint to string, Date preserved, Map/Set to arrays).\n * Pair it with `createRestoreFromJsonFn<T>()` on the SAME strategy; the caller owns the\n * `JSON.stringify`, so one stringify can cover many values. **/\nexport const createPrepareForJsonFn = createTypeFnArgsFunction<PrepareForJsonFn>(\n 'createPrepareForJsonFn',\n identityValueFn\n) as unknown as (<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<PrepareForJsonOptions>,\n id?: InjectTypeFnArgs<T, 'prepareForJsonClone'>\n) => PrepareForJsonFn<T>) &\n (<T>(\n val?: T,\n options?: CompTimeFnArgs<PrepareForJsonOptions>,\n id?: InjectTypeFnArgs<T, 'prepareForJsonClone'>\n ) => PrepareForJsonFn<T>);\n\n/** `JSON.parse` output in, typed value out; it does NOT check the value, so validate untrusted data. **/\nexport const createRestoreFromJsonFn = createTypeFnArgsFunction<RestoreFromJsonFn>(\n 'createRestoreFromJsonFn',\n identityValueFn\n) as unknown as (<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<RestoreFromJsonOptions>,\n id?: InjectTypeFnArgs<T, 'restoreFromJsonClone'>\n) => RestoreFromJsonFn<T>) &\n (<T>(\n val?: T,\n options?: CompTimeFnArgs<RestoreFromJsonOptions>,\n id?: InjectTypeFnArgs<T, 'restoreFromJsonClone'>\n ) => RestoreFromJsonFn<T>);\n\n// createFormatTransformFn returns a `(value) => transformedValue` for `T`. Identity\n// fallback covers both noop-format types and the no-plugin case.\nexport const createFormatTransformFn = createRTFunction<FormatTransformFn<unknown>>(\n 'createFormatTransformFn',\n identityValueFn\n) as unknown as (<T>(runType: RunType<T>, id?: InjectTypeFnArgs<T, 'formatTransform'>) => FormatTransformFn<T>) &\n (<T>(val?: T, id?: InjectTypeFnArgs<T, 'formatTransform'>) => FormatTransformFn<T>);\n\n// =============================================================================\n// JSON encode / decode: Go emits one composite entry per (typeId, strategy), so nothing branches on strategy at runtime.\n// =============================================================================\n\nconst jsonStringifyFallback: JsonEncoderFn = (v) => JSON.stringify(v);\nconst jsonParseFallback: JsonDecoderFn = (s) => JSON.parse(s);\n\n/** Returns a JSON encoder for `T`. Default `strategy: 'clone'`; see `JsonValueStrategy` for the\n * full matrix. Accepts a value-first schema (`createJsonEncoderFn(rt)`) or the value/static form.\n * The plugin injects a `[typeId, fnId]` tuple at the trailing marker slot where `fnId` IS the\n * composite fnHash the backend computed from the comptime-resolved `strategy`, and the runtime\n * resolves that composite entry directly. The `JSON.stringify` fallback covers the no-plugin case. **/\nexport function createJsonEncoderFn<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<JsonEncoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonEncoder'>\n): JsonEncoderFn;\nexport function createJsonEncoderFn<T>(\n val?: T,\n options?: CompTimeFnArgs<JsonEncoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonEncoder'>\n): JsonEncoderFn;\nexport function createJsonEncoderFn<T>(\n valOrSchema?: T | RunType<T>,\n _options?: CompTimeFnArgs<JsonEncoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonEncoder'>\n): JsonEncoderFn {\n // `strategy` + `rejectCircularRefs` are compile-time — the plugin baked both\n // into `id`'s fnHash, so the runtime just resolves the injected tuple.\n return resolveTupleEntry<JsonEncoderFn>('createJsonEncoderFn', jsonStringifyFallback, valOrSchema, id);\n}\n\n/** Returns a JSON decoder for `T`; the default `'clone'` rebuilds the declared shape, dropping undeclared keys. **/\nexport function createJsonDecoderFn<T>(\n runType: RunType<T>,\n options?: CompTimeFnArgs<JsonDecoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonDecoder'>\n): JsonDecoderFn<DataOnly<T>>;\nexport function createJsonDecoderFn<T>(\n val?: T,\n options?: CompTimeFnArgs<JsonDecoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonDecoder'>\n): JsonDecoderFn<DataOnly<T>>;\nexport function createJsonDecoderFn<T>(\n valOrSchema?: T | RunType<T>,\n options?: CompTimeFnArgs<JsonDecoderOptions>,\n id?: InjectTypeFnArgs<T, 'jsonDecoder'>\n): JsonDecoderFn<DataOnly<T>> {\n // A decoded value is reconstructed from JSON, so it only ever holds serialisable data — hence the\n // `DataOnly<T>` projection (identity on clean DTOs). Runtime is unchanged; this is the boundary.\n return resolveTupleEntry<JsonDecoderFn<DataOnly<T>>>(\n 'createJsonDecoderFn',\n jsonParseFallback as JsonDecoderFn<DataOnly<T>>,\n valOrSchema,\n id\n );\n}\n\n// =============================================================================\n// getRTFunction — recover ANY family's compiled fn from an injected marker tuple\n// =============================================================================\n\n/** Fn shape per `InjectTypeFnArgs` fnKey, so a wrapper resolves a family by the fnKey it put in the marker.\n * Generic families (`validate` / `jsonDecoder` / `formatTransform`) get `T = unknown`; `createX<T>()` keeps `T`. **/\nexport interface RTFunctionByKey {\n // Validators.\n validate: ValidateFn;\n validationErrors: GetValidationErrorsFn;\n // The `{checkUnknowns: true}` fused twins — same call shapes, and additionally\n // reject (or report) undeclared properties.\n validateStrict: ValidateFn;\n validationErrorsStrict: GetValidationErrorsFn;\n // The `{checkUnionUnknowns: true}` twins: same shapes, rejecting a key the matched union member leaves undeclared.\n validateUnionKeys: ValidateFn;\n validationErrorsUnionKeys: GetValidationErrorsFn;\n // Unknown-keys group.\n removeUnknownKeys: RemoveUnknownKeysFn;\n // The `sharedValues` twins: same call shape.\n removeUnknownKeysShared: RemoveUnknownKeysFn;\n removeUnknownKeysRefuse: RemoveUnknownKeysFn;\n // Format transform.\n formatTransform: FormatTransformFn<unknown>;\n // JSON string I/O.\n jsonEncoder: JsonEncoderFn;\n jsonDecoder: JsonDecoderFn;\n // JSON value-level primitives, also reachable through their own createX factories above.\n prepareForJsonMutate: PrepareForJsonFn; // transforms in place, keeps undeclared keys\n prepareForJsonClone: PrepareForJsonFn; // builds a new value from the declared shape\n restoreFromJsonMutate: RestoreFromJsonFn; // restores in place, keeps undeclared keys\n restoreFromJsonClone: RestoreFromJsonFn; // rebuilds the declared shape, so undeclared keys are dropped\n compactForJson: PrepareForJsonFn; // compact encode (positional wire)\n compactFromJson: RestoreFromJsonFn; // compact decode\n}\n\n/** Every fnKey nameable in an `InjectTypeFnArgs<T, Fn>` marker and recoverable\n * via `getRTFunction`. **/\nexport type RTFunctionKey = keyof RTFunctionByKey;\n\n/** Recovers any family's compiled fn from an injected `InjectTypeFnArgs` tuple, keyed by the fnKey the marker names.\n * A key miss returns `fallback` (identity by default, right for every value-shaped primitive); no tuple throws.\n * Never applies the circular-reference guard, which stays with the encoder and validator factories. **/\nexport function getRTFunction<K extends RTFunctionKey>(injected: unknown, fallback?: RTFunctionByKey[K]): RTFunctionByKey[K] {\n const identityFn = (fallback ?? ((value: unknown) => value)) as AnyFn;\n return resolveEntryTupleFn('getRTFunction', identityFn, undefined, injected) as RTFunctionByKey[K];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFriendlyText.js","sourceRoot":"","sources":["../../src/enrich/createFriendlyText.ts"],"names":[],"mappings":"AA+CA,MAAM,WAAW,GAAG,cAAc,CAAC;AAInC,MAAM,cAAc,GAAG,IAAI,CAAC;AAI5B,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA4B,CAAC;AAC7D,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAA6B,CAAC;AACpE,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAA+B,CAAC;AAEpE,SAAS,iBAAiB,CAAC,MAAc;IACvC,IAAI,KAAK,GAAG,gBAAgB,CAA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AAyB,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/G,OAAO;YACL,IAAI,EAAE,WAAW,IAAI,UAAU;YAC/B,UAAU,EAAE,WAAW,CAAC,CAAC,CAAE,OAAkB,CAAC,CAAC,CAAC,YAAY;YAC5D,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;YAC5C,YAAY;YACZ,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ;SAC3F,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC;QAC3C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["// `createFriendlyText<T>(map)` — renders `getValidationErrors` output into human-readable messages\n// against a `FriendlyText<T>` map (see docs/AI_ENRICHMENT.md). Pure data over (map, errors), with NO\n// type-id injection and NO rtUtils: error rendering needs only the map. Aggregation matches the\n// validator, which accumulates, so a field yields ONE message per failed constraint — or one message\n// for the whole field when the node uses the exclusive `rt$default` mode. `createFriendlyTextI18n<T>`\n// is the locale-selecting wrapper over the SAME walk, and a plural leaf falls through to the source\n// as a WHOLE unit. Always lenient: a partial translation renders, it never throws.\n\nimport type {RTValidationError, RTValidationErrorPathSegment, TypeFormatError} from '../createRTFunctions.ts';\nimport type {FriendlyText, PluralTemplate, TemplateLeaf} from './friendlyText.ts';\n\n/** A rendered, human-readable validation message for one failure. */\nexport interface FriendlyMessage {\n /** Dotted path to the field (`profile.email`); `''` for the root. */\n path: string;\n /** The field's friendly label, or its raw last path segment as fallback. */\n label: string;\n /** The interpolated message. */\n message: string;\n}\n\n/** What `createFriendlyText` returns. */\nexport interface FriendlyRenderer {\n /** The friendly label for a path (dotted string or a raw segment array). */\n label(path: string | RTValidationErrorPathSegment[]): string;\n /** Render a `getValidationErrors` result into friendly messages. */\n errors(errs: RTValidationError[]): FriendlyMessage[];\n}\n\n// Loose runtime view of a node's templates: the precise per-param typing lives on the AUTHORED map\n// (ErrorTemplates<F>), and the walk only reads keys.\ntype ErrorTemplatesRuntime = {[key: string]: TemplateLeaf | undefined};\n\n// Runtime view of a node: `rt$items` holds arrays and rest-tuple elements, `rt$slots` fixed-tuple\n// positions, `rt$keys` / `rt$values` maps and sets.\ntype FriendlyNodeRuntime = {\n rt$label?: string;\n rt$errors?: ErrorTemplatesRuntime;\n rt$items?: FriendlyNodeRuntime;\n rt$slots?: FriendlyNodeRuntime[];\n rt$keys?: FriendlyNodeRuntime;\n rt$values?: FriendlyNodeRuntime;\n [field: string]: unknown;\n};\n\n// `$[name]` — the closed token set (`label` / `val` / `path` / `index`). The required bracket-close\n// keeps prose punctuation untouched, and an unknown token stays verbatim.\nconst PLACEHOLDER = /\\$\\[(\\w+)\\]/g;\n\n// Matches the tsconfig `i18n.sourceLocale` default, so an unconfigured runtime and an unconfigured\n// build agree. Deterministic: never the host locale.\nconst DEFAULT_LOCALE = 'en';\n\n// Building an Intl instance is expensive, so each is built once and reused across renders. Module-scope\n// singletons BESIDE the pure walk, which caches nothing itself.\nconst pluralRulesCache = new Map<string, Intl.PluralRules>();\nconst boundNumberFormatCache = new Map<string, Intl.NumberFormat>();\nconst boundDateFormatCache = new Map<string, Intl.DateTimeFormat>();\n\nfunction cachedPluralRules(locale: string): Intl.PluralRules {\n let rules = pluralRulesCache.get(locale);\n if (!rules) {\n rules = new Intl.PluralRules(locale, {type: 'cardinal'});\n pluralRulesCache.set(locale, rules);\n }\n return rules;\n}\n\n/** Currency style when the app supplied a code, plain localized decimal otherwise. An invalid code\n * falls back to the plain decimal formatter, so the renderer never throws. */\nfunction cachedBoundNumberFormat(locale: string, currency: string | undefined): Intl.NumberFormat {\n const key = locale + '\\0' + (currency ?? '');\n let format = boundNumberFormatCache.get(key);\n if (!format) {\n try {\n format = currency ? new Intl.NumberFormat(locale, {style: 'currency', currency}) : new Intl.NumberFormat(locale);\n } catch {\n format = new Intl.NumberFormat(locale);\n }\n boundNumberFormatCache.set(key, format);\n }\n return format;\n}\n\n// Keyed by TypeFormatError.name: the type says what the value is, the reader's locale says how to write it.\nconst DATE_BOUND_OPTIONS: Record<string, Intl.DateTimeFormatOptions> = {\n date: {dateStyle: 'medium'},\n temporalPlainDate: {dateStyle: 'medium'},\n temporalPlainYearMonth: {year: 'numeric', month: 'long'},\n dateTime: {dateStyle: 'medium', timeStyle: 'short'},\n nativeDate: {dateStyle: 'medium', timeStyle: 'short'},\n temporalInstant: {dateStyle: 'medium', timeStyle: 'short'},\n temporalZonedDateTime: {dateStyle: 'medium', timeStyle: 'short'},\n temporalPlainDateTime: {dateStyle: 'medium', timeStyle: 'short'},\n time: {timeStyle: 'short'},\n temporalPlainTime: {timeStyle: 'short'},\n};\n\nfunction cachedBoundDateFormat(locale: string, formatName: string): Intl.DateTimeFormat {\n const key = locale + '\\0' + formatName;\n let format = boundDateFormatCache.get(key);\n if (!format) {\n format = new Intl.DateTimeFormat(locale, DATE_BOUND_OPTIONS[formatName]);\n boundDateFormatCache.set(key, format);\n }\n return format;\n}\n\n/** Selects a plural arm by the file-locale's CLDR category, with `other` as the in-leaf backstop. A\n * non-finite bound selects `other` directly, since `select(NaN)` throws RangeError. A blank (`''` @todo)\n * arm falls to `other` too, so a half-filled plural degrades inside its own leaf. */\nfunction selectPlural(leaf: PluralTemplate, bound: string | number | boolean | bigint | undefined, locale: string): string {\n const count = Number(bound);\n if (!Number.isFinite(count)) return leaf.other;\n const category = cachedPluralRules(locale).select(count);\n return leaf[category] || leaf.other;\n}\n\n/** A segment's dotted-path key: a field name, an array / tuple index, or a Map / Set entry's index. */\nfunction segmentKey(seg: RTValidationErrorPathSegment): string | number {\n if (typeof seg === 'string' || typeof seg === 'number') return seg;\n return seg.key;\n}\n\n/** Descends one segment. A fixed tuple has positional `rt$slots`; an array (and a rest tuple, whose\n * `length` is the broad `number`) has `rt$items`. A Map / Set entry is routed by its `failed` role:\n * `rt$keys` for a `mapKey` failure, `rt$values` for a `mapValue` / `setKey` one. */\nfunction descend(node: FriendlyNodeRuntime | undefined, seg: RTValidationErrorPathSegment): FriendlyNodeRuntime | undefined {\n if (!node) return undefined;\n if (typeof seg === 'string') return node[seg] as FriendlyNodeRuntime | undefined;\n if (typeof seg === 'number') return node.rt$slots ? node.rt$slots[seg] : node.rt$items;\n return seg.failed === 'mapKey' ? node.rt$keys : node.rt$values;\n}\n\nfunction nodeAt(root: FriendlyNodeRuntime, path: RTValidationErrorPathSegment[]): FriendlyNodeRuntime | undefined {\n let node: FriendlyNodeRuntime | undefined = root;\n for (const seg of path) node = descend(node, seg);\n return node;\n}\n\n/** Fallback label when a node has no `rt$label`: the last STRING segment, else the last one stringified. */\nfunction rawLabel(path: RTValidationErrorPathSegment[]): string {\n for (let i = path.length - 1; i >= 0; i--) {\n if (typeof path[i] === 'string') return path[i] as string;\n }\n const tail = path.length ? segmentKey(path[path.length - 1]) : undefined;\n return tail === undefined ? '' : String(tail);\n}\n\nfunction pathToString(path: RTValidationErrorPathSegment[]): string {\n return path.map((seg) => String(segmentKey(seg))).join('.');\n}\n\n/** The template key: the format sub-constraint, else the format name, else `type` for a type-shape failure. */\nfunction constraintKey(format: TypeFormatError | undefined): string {\n if (!format) return 'type';\n const tail = format.formatPath[format.formatPath.length - 1];\n return tail !== undefined ? String(tail) : format.name;\n}\n\n/** Keeps only primitive constraint values. */\nfunction primitiveVal(val: TypeFormatError['val'] | undefined): string | number | boolean | bigint | undefined {\n const kind = typeof val;\n if (kind === 'string' || kind === 'number' || kind === 'boolean' || kind === 'bigint') {\n return val as string | number | boolean | bigint;\n }\n return undefined;\n}\n\n/** The last numeric path segment, for `$[index]`. */\nfunction numericIndex(path: RTValidationErrorPathSegment[]): number | undefined {\n for (let i = path.length - 1; i >= 0; i--) {\n const key = segmentKey(path[i]);\n if (typeof key === 'number') return key;\n }\n return undefined;\n}\n\ninterface InterpolateCtx {\n label: string;\n /** The already-rendered `$[val]` text; undefined when the error carries no bound. */\n valText?: string;\n path: string;\n index?: number;\n}\n\nfunction interpolate(template: string, ctx: InterpolateCtx): string {\n return template.replace(PLACEHOLDER, (whole: string, name: string) => {\n if (name === 'label') return ctx.label;\n if (name === 'val') return ctx.valText ?? '';\n if (name === 'path') return ctx.path;\n if (name === 'index') return ctx.index === undefined ? '' : String(ctx.index);\n return whole;\n });\n}\n\ninterface PathGroup {\n path: RTValidationErrorPathSegment[];\n pathStr: string;\n errors: RTValidationError[];\n}\n\n/** The dotted path, with a Map / Set entry also encoding its `failed` role so a key-failure and a\n * value-failure at the SAME entry index resolve to their own node instead of colliding. */\nfunction groupSignature(path: RTValidationErrorPathSegment[]): string {\n return path.map((seg) => (typeof seg === 'object' ? `${seg.key} ${seg.failed ?? ''}` : String(seg))).join('.');\n}\n\n/** Group errors by path (role-aware for Map / Set), preserving first-seen order. */\nfunction groupByPath(errs: RTValidationError[]): PathGroup[] {\n const groups: PathGroup[] = [];\n const bySignature = new Map<string, PathGroup>();\n for (const err of errs) {\n const signature = groupSignature(err.path);\n let group = bySignature.get(signature);\n if (!group) {\n group = {path: err.path, pathStr: pathToString(err.path), errors: []};\n bySignature.set(signature, group);\n groups.push(group);\n }\n group.errors.push(err);\n }\n return groups;\n}\n\n// One render pass's resolved inputs. `source` is the terminal-fallback map, absent on the\n// single-locale path. Built fresh per label() / errors() call by the i18n wrapper (the reactive\n// `{value}` seam), once by `createFriendlyText`.\ninterface RenderState {\n root: FriendlyNodeRuntime;\n rootLocale: string;\n source?: FriendlyNodeRuntime;\n sourceLocale: string;\n /** True on the i18n path: `$[val]` renders by the bound's type format, where plain\n * `createFriendlyText` stays byte-stable (`String(val)`). */\n i18n?: boolean;\n /** ISO 4217 code for `currency`-branded bounds; absent renders a plain number. */\n currency?: string;\n}\n\n/** Renders a violated bound to its `$[val]` text. On the i18n path the error's format payload says what\n * the bound IS, so there is no per-template format syntax; an unparseable date bound (a relative\n * `now-P1D`) stays verbatim. */\nfunction renderBoundText(\n state: RenderState,\n format: TypeFormatError | undefined,\n val: string | number | boolean | bigint | undefined\n): string | undefined {\n if (val === undefined) return undefined;\n if (!state.i18n || !format) return String(val);\n if (format.isCurrency) {\n const numeric = Number(val);\n if (!Number.isFinite(numeric)) return String(val);\n return cachedBoundNumberFormat(state.rootLocale, state.currency).format(numeric);\n }\n if (DATE_BOUND_OPTIONS[format.name] && (typeof val === 'string' || typeof val === 'number')) {\n const date = new Date(val);\n if (Number.isNaN(date.getTime())) return String(val);\n return cachedBoundDateFormat(state.rootLocale, format.name).format(date);\n }\n return String(val);\n}\n\nconst labelFor = (node: FriendlyNodeRuntime | undefined, path: RTValidationErrorPathSegment[]): string =>\n node?.rt$label || rawLabel(path);\n\n// resolveTemplate picks one map-node's template for a constraint key. The per-constraint and\n// `rt$default` modes never coexist, so this single lookup serves both, and a plural leaf selects its arm\n// with the MAP's own locale (plural leaves are atomic per map). Undefined — a missing node, a missing\n// key, or a blank `''` @todo template — is the caller's cross-map fallback signal.\nfunction resolveTemplate(\n node: FriendlyNodeRuntime | undefined,\n key: string,\n val: string | number | boolean | bigint | undefined,\n mapLocale: string\n): string | undefined {\n const errorTemplates = node?.rt$errors;\n if (!errorTemplates) return undefined;\n return leafTemplate(errorTemplates[key], val, mapLocale) ?? leafTemplate(errorTemplates.rt$default, val, mapLocale);\n}\n\n// leafTemplate renders one leaf to a non-blank string; a blank `''` (an unfilled @todo) counts as\n// absent so fallback can proceed.\nfunction leafTemplate(\n leaf: string | PluralTemplate | undefined,\n val: string | number | boolean | bigint | undefined,\n mapLocale: string\n): string | undefined {\n if (leaf === undefined) return undefined;\n const template = typeof leaf === 'string' ? leaf : selectPlural(leaf, val, mapLocale);\n return template || undefined;\n}\n\nfunction renderLabel(state: RenderState, path: string | RTValidationErrorPathSegment[]): string {\n const segs = typeof path === 'string' ? (path === '' ? [] : path.split('.')) : path;\n const node = nodeAt(state.root, segs);\n if (node?.rt$label) return node.rt$label;\n const sourceNode = state.source ? nodeAt(state.source, segs) : undefined;\n return labelFor(sourceNode, segs);\n}\n\nfunction renderErrors(state: RenderState, errs: RTValidationError[]): FriendlyMessage[] {\n const out: FriendlyMessage[] = [];\n for (const group of groupByPath(errs)) {\n const node = nodeAt(state.root, group.path);\n const sourceNode = state.source ? nodeAt(state.source, group.path) : undefined;\n const label = node?.rt$label || sourceNode?.rt$label || rawLabel(group.path);\n\n const index = numericIndex(group.path);\n\n // rt$default mode → ONE message for the whole field. The node that supplies this group's text is\n // found with the FIRST error (root/translation first, else source, resolveTemplate's precedence)\n // and rendered once with that error's bound. enrich-text-default-and-messages makes rt$default mutually exclusive with\n // per-constraint keys, so otherwise every failed constraint would render identical text.\n const first = group.errors[0];\n const firstVal = primitiveVal(first.format?.val);\n const rootProvides = resolveTemplate(node, constraintKey(first.format), firstVal, state.rootLocale) !== undefined;\n const defaultNode = rootProvides ? node : sourceNode;\n const defaultLocale = rootProvides ? state.rootLocale : state.sourceLocale;\n const catchAll = leafTemplate(defaultNode?.rt$errors?.rt$default, firstVal, defaultLocale);\n if (catchAll !== undefined) {\n out.push({\n path: group.pathStr,\n label,\n message: interpolate(catchAll, {\n label,\n valText: renderBoundText(state, first.format, firstVal),\n path: group.pathStr,\n index,\n }),\n });\n continue;\n }\n\n // Per-constraint mode: one message per failed constraint.\n for (const err of group.errors) {\n const key = constraintKey(err.format);\n const val = primitiveVal(err.format?.val);\n // Leaf-granular fallback: the translation's leaf, else the source's. Each map selects plural arms\n // with ITS OWN locale's rules, so a translated plural is never mixed with a source arm mid-message.\n const template =\n resolveTemplate(node, key, val, state.rootLocale) ?? resolveTemplate(sourceNode, key, val, state.sourceLocale);\n const message = template\n ? interpolate(template, {\n label,\n valText: renderBoundText(state, err.format, val),\n path: group.pathStr,\n index,\n })\n : `${label || 'value'} is invalid`;\n out.push({path: group.pathStr, label, message});\n }\n }\n return out;\n}\n\nexport function createFriendlyText<T>(map: FriendlyText<T>): FriendlyRenderer {\n const state: RenderState = {\n root: map as FriendlyNodeRuntime,\n rootLocale: DEFAULT_LOCALE,\n sourceLocale: DEFAULT_LOCALE,\n };\n return {\n label: (path) => renderLabel(state, path),\n errors: (errs) => renderErrors(state, errs),\n };\n}\n\n/** Options for `createFriendlyTextI18n`. */\nexport interface FriendlyI18nOptions<T> {\n /** The active locale: a plain tag, or any `{value}` ref read structurally on EVERY render. The\n * renderer itself is not reactivity-tracked: call it inside a `computed()` / re-invoke per render. */\n locale: string | {readonly value: string};\n /** Committed translation consts by locale tag; each is a same-tree `FriendlyText<T>` map. */\n translations: Partial<Record<string, FriendlyText<T>>>;\n /** ISO 4217 code for `Currency`-branded bounds, a plain string or a `{value}` ref re-read every\n * render. WHICH currency a value is in is app data, so it is supplied here, never in the type.\n * Omitted, a currency bound renders as a plain localized number; a symbol is never guessed. */\n currency?: string | {readonly value: string};\n /** The language the SOURCE map is authored in (default 'en'), used to select its plural arms. */\n sourceLocale?: string;\n /** Reserved: the runtime is ALWAYS lenient; strictness lives in `mion enrich --i18n --no-emit`. */\n strict?: boolean;\n}\n\n/** Picks a translation tag by BCP-47 truncation: the exact tag, then subtags dropped right-to-left\n * (`pt-BR` → `pt`), then any available tag sharing the base language (`zh-Hant` matches `zh-Hans`,\n * naive by design). Undefined when nothing shares it, and the caller falls back to the source. */\nexport function resolveLocale<T>(locale: string, translations: Partial<Record<string, FriendlyText<T>>>): string | undefined {\n if (!locale) return undefined;\n const have = (tag: string) => translations[tag] !== undefined;\n // Exact, then right-to-left truncation of the requested tag.\n const parts = locale.split('-');\n for (let keep = parts.length; keep >= 1; keep--) {\n const candidate = parts.slice(0, keep).join('-');\n if (have(candidate)) return candidate;\n }\n // Base-language match against the AVAILABLE tags (zh-Hant → zh-Hans).\n const baseLanguage = parts[0].toLowerCase();\n for (const tag of Object.keys(translations)) {\n if (translations[tag] !== undefined && tag.split('-')[0].toLowerCase() === baseLanguage) return tag;\n }\n return undefined;\n}\n\n/** The `source` map is the source language and the terminal fallback: every leaf falls through to it\n * when the active translation leaves it blank. Never throws on a partial translation. */\nexport function createFriendlyTextI18n<T>(source: FriendlyText<T>, options: FriendlyI18nOptions<T>): FriendlyRenderer {\n const sourceRoot = source as FriendlyNodeRuntime;\n const sourceLocale = options.sourceLocale ?? DEFAULT_LOCALE;\n\n // Resolved fresh on EVERY render: the reactive `{value}` locale / currency seam.\n const state = (): RenderState => {\n const active = typeof options.locale === 'object' ? options.locale.value : options.locale;\n const matched = resolveLocale<T>(active, options.translations);\n const translation = matched !== undefined ? (options.translations[matched] as FriendlyNodeRuntime) : undefined;\n return {\n root: translation ?? sourceRoot,\n rootLocale: translation ? (matched as string) : sourceLocale,\n source: translation ? sourceRoot : undefined,\n sourceLocale,\n i18n: true,\n currency: typeof options.currency === 'object' ? options.currency.value : options.currency,\n };\n };\n\n return {\n label: (path) => renderLabel(state(), path),\n errors: (errs) => renderErrors(state(), errs),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"friendlyText.js","sourceRoot":"","sources":["../../src/enrich/friendlyText.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"friendlyText.js","sourceRoot":"","sources":["../../src/enrich/friendlyText.ts"],"names":[],"mappings":"","sourcesContent":["// `FriendlyText<T>` — the per-field LABEL + ERROR-MESSAGE map for a type, authored once and committed\n// (see docs/AI_ENRICHMENT.md); `createFriendlyText` renders validation errors against it at runtime.\n// The recursive `FriendlyNode` follows the `DataOnly<T>` construction (src/runtypes/dataOnly.ts):\n// depth-bounded via a tuple-decrement budget, NO `infer` on the hot path, scalar-before-object gates,\n// homomorphic child map. The `#region friendlytext-extract` block is sliced VERBATIM by\n// test/types/enrichHarness.ts, so it may reference only `lib` types, sentinel keys, `FormatErrorKeys` and own decls.\n\nimport type {__rtFormatName} from '../runtypes/sentinelKeys.ts';\nimport type {FormatErrorKeys} from '../go-generated/formatErrorKeys.generated.ts';\n\n// #region friendlytext-extract — FriendlyText machinery; sliced verbatim between\n// these markers by test/types/enrichHarness.ts, which also inlines the sentinel keys and `FormatErrorKeys`.\n\n/** A template string with the `$[…]` placeholders the renderer substitutes: `$[label]` (the field's\n * label, or its raw name), `$[val]` (the failed constraint's bound), `$[path]`, `$[index]`. */\nexport type FriendlyTemplate = string;\n\n/** The CLDR plural categories. A LOCAL union, not `Intl.LDMLPluralRule`, because the sliced `#region`\n * must stay self-contained; runtime code outside the region may use `Intl.LDMLPluralRule` directly. */\nexport type PluralCategory = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';\n\n/** One arm per CLDR category the map's language uses. `other` is mandatory: CLDR guarantees it and it is\n * the in-leaf backstop. LANGUAGE-AGNOSTIC — the same type for every locale, only the arms present differ.\n * The renderer selects an arm via `Intl.PluralRules` on the violated bound. */\nexport type PluralTemplate = {other: FriendlyTemplate} & Partial<Record<PluralCategory, FriendlyTemplate>>;\n\n/** Which kind appears at a constraint is decided by the CONSTRAINT, not the author: count-bearing\n * constraints carry a plural object, everything else a plain string. The generator emits the right kind\n * and the Go checker enforces it, so the kind is locale-invariant. */\nexport type TemplateLeaf = FriendlyTemplate | PluralTemplate;\n\n/** The count-bearing constraint keys — the only ones whose template may be a\n * plural object. Mirror of Go's `CountBearing` (internal/enrichment/classify.go). */\ntype CountBearingKeys = 'minLength' | 'maxLength' | 'min' | 'max' | 'lt' | 'gt';\n\n/** Keys are optional because the compiler warns about a missing one (enrich-text-missing-message).\n * No index signature, so an unknown key is an excess-property error in the IDE (enrich-text-unknown-error-key). */\ntype ConstraintTemplates<Name extends keyof FormatErrorKeys> = {type: FriendlyTemplate} & {\n [K in FormatErrorKeys[Name]]?: K extends CountBearingKeys ? TemplateLeaf : FriendlyTemplate;\n} & {rt$default?: never};\n\n/** `rt$default` mode: ONE message for the whole field, whatever failed. MUTUALLY EXCLUSIVE with\n * per-constraint messages. `mion enrich` scaffolds per-constraint first; after that the node's authored\n * mode is owned by the author and the reconcile follows it. */\ntype DefaultOnlyTemplates = {rt$default: FriendlyTemplate; type?: never};\n\n/** Unbranded fields (plain `string` / `number` / …) can only fail as `type`. */\ntype BareTemplates = DefaultOnlyTemplates | ({type: FriendlyTemplate} & {rt$default?: never});\n\n/** Pure data: an inline-function form would be opaque to translation, reconcile and the checker. */\nexport type ErrorTemplates<F = never> = [F] extends [never]\n ? BareTemplates\n : F extends {readonly [__rtFormatName]?: infer Name}\n ? [NonNullable<Name>] extends [keyof FormatErrorKeys]\n ? DefaultOnlyTemplates | ConstraintTemplates<NonNullable<Name>>\n : BareTemplates\n : BareTemplates;\n\n/** Blank values are caught by the `@todo` / diagnostic layer, not TS; `rt$typeName` defaults to the reflected name.\n * The `rt$` prefix is reserved (`mion enrich` refuses, enrich-text-reserved-prefix flags it), so the child map can't shadow it. */\nexport interface FriendlyMeta<F = never> {\n rt$label: string;\n rt$errors: ErrorTemplates<F>;\n rt$typeName?: string;\n}\n\n/** Scalar / native kinds that carry only meta (no child fields). */\ntype FriendlyLeaf = string | number | boolean | bigint | null | undefined | Date | RegExp | FriendlyUrl;\n\n/** The platform `URL` instance, `never` without `dom` or `@types/node`. */\ntype FriendlyUrl = typeof globalThis extends {URL: {prototype: infer I}} ? I : never;\n\n/** Recursion-budget decrement (`[0]` is `never`, unreachable — the `Depth extends 0` guard stops first),\n * bounding circular / mutually-recursive types to a finite instantiation (no TS2589). */\ntype _FriendlyDepth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8];\n\n/** Recursive friendly node — structural per solution A (docs/AI_ENRICHMENT.md): composite kinds reflect\n * their structure, NOT an opaque leaf. Branch order is most-specific-first, and the `Map` / `Set` gates\n * run BEFORE the array check to keep `infer` off the hot path (mirroring `DataOnly`). Index signatures\n * and object-member unions are OUT OF SCOPE: an index-sig object falls through to the object map. */\nexport type FriendlyNode<T, Depth extends number = 8> = Depth extends 0\n ? FriendlyMeta // budget spent — keep as a leaf\n : T extends FriendlyLeaf\n ? FriendlyMeta<T> // scalar / native — no children; F drives the rt$errors keys\n : // Map BEFORE the array check: cheap `ReadonlyMap<any, any>` gate filters\n // non-Maps so the `infer K, V` never runs off the hot path (per DataOnly).\n T extends ReadonlyMap<any, any>\n ? T extends ReadonlyMap<infer K, infer V>\n ? FriendlyMeta & {rt$keys: FriendlyNode<K, _FriendlyDepth[Depth]>; rt$values: FriendlyNode<V, _FriendlyDepth[Depth]>}\n : FriendlyMeta // unreachable — gate guarantees a Map\n : T extends ReadonlySet<any>\n ? T extends ReadonlySet<infer U>\n ? FriendlyMeta & {rt$values: FriendlyNode<U, _FriendlyDepth[Depth]>}\n : FriendlyMeta // unreachable — gate guarantees a Set\n : T extends readonly unknown[]\n ? // tuple vs array: a tuple has a literal `length`, an array's `length`\n // is the broad `number`. Tuple → per-slot homomorphic `rt$slots`\n // (`{[K in keyof tuple]}` yields a tuple type — the intended\n // `rt$slots: [node, node]`); array → `rt$items` element node.\n number extends T['length']\n ? FriendlyMeta & {rt$items: FriendlyNode<T[number], _FriendlyDepth[Depth]>}\n : FriendlyMeta & {rt$slots: {[K in keyof T]: FriendlyNode<T[K], _FriendlyDepth[Depth]>}}\n : T extends object\n ? FriendlyMeta & {[K in keyof T]-?: FriendlyNode<T[K], _FriendlyDepth[Depth]>}\n : FriendlyMeta;\n\n/** The friendly map for `T`, validated against `T` at scan time (the `ShapeCheckedArgs<T>` axis). */\nexport type FriendlyText<T> = FriendlyNode<T>;\n\n// #endregion friendlytext-extract\n// One type annotates every friendly-family file: a translation const is `FriendlyText<T>` at\n// `i18n/<locale>/<rel>.ts` with a `<locale>_friendly*` name, so the path and prefix carry the locale.\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../src/enrich/mockData.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"mockData.js","sourceRoot":"","sources":["../../src/enrich/mockData.ts"],"names":[],"mappings":"","sourcesContent":["// `MockData<T>` — the per-field pools / ranges / lengths that feed `createMockDataFn<T>()` (see\n// docs/AI_ENRICHMENT.md): the AI supplies realistic values, the generator stays deterministic. Same\n// construction as `FriendlyNode` and `DataOnly<T>` (src/runtypes/dataOnly.ts): depth-bounded tuple\n// decrement, NO `infer` on the hot path, scalar-before-object gates, homomorphic child map. The\n// `#region mockdata-extract` block is sliced VERBATIM by test/types/enrichHarness.ts, so it must\n// reference only `lib` types + its own declarations.\n\n// #region mockdata-extract — MockData machinery; sliced verbatim between these\n// markers by test/types/enrichHarness.ts. Self-contained: `lib` + own decls only.\n\n/** Recursion-budget decrement, bounding circular / mutually-recursive types to a finite instantiation. */\ntype _MockDepth = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8];\n\n/** The platform `URL` instance, `never` without `dom` or `@types/node`. */\ntype MockDataUrl = typeof globalThis extends {URL: {prototype: infer I}} ? I : never;\n\n/** Recursive mock-data node — structural per solution A (docs/AI_ENRICHMENT.md): composite kinds reflect\n * their structure. An object's `rt$optional` is the present-probability for its optional members. The\n * `Map` / `Set` gates run BEFORE the array check, fronted by a cheap test so `infer` stays off the hot\n * path (mirroring `DataOnly`). Index signatures and object-member unions are OUT OF SCOPE: an index-sig\n * object falls through to the object map. */\nexport type MockNode<T, Depth extends number = 8> = Depth extends 0\n ? {pool: T[]} // budget spent — keep as a leaf pool\n : // Map BEFORE the array check: cheap `ReadonlyMap<any, any>` gate filters\n // non-Maps so the `infer K, V` never runs off the hot path (per DataOnly).\n T extends ReadonlyMap<any, any>\n ? T extends ReadonlyMap<infer K, infer V>\n ? {rt$keys: MockNode<K, _MockDepth[Depth]>; rt$values: MockNode<V, _MockDepth[Depth]>; rt$size?: number | [number, number]}\n : {pool: T[]} // unreachable — gate guarantees a Map\n : T extends ReadonlySet<any>\n ? T extends ReadonlySet<infer U>\n ? {rt$values: MockNode<U, _MockDepth[Depth]>; rt$size?: number | [number, number]}\n : {pool: T[]} // unreachable — gate guarantees a Set\n : T extends readonly unknown[]\n ? // tuple vs array: a tuple has a literal `length`, an array's `length` is\n // the broad `number`. Tuple → per-slot homomorphic `rt$slots` (fixed\n // length, no `rt$length`); array → `rt$items` element node + `rt$length`.\n number extends T['length']\n ? {rt$items: MockNode<T[number], _MockDepth[Depth]>; rt$length?: number | [number, number]}\n : {rt$slots: {[K in keyof T]: MockNode<T[K], _MockDepth[Depth]>}}\n : T extends number\n ? {pool: number[]; min?: number; max?: number}\n : T extends string\n ? {pool: string[]}\n : T extends Date\n ? {pool: Date[]; min?: Date; max?: Date}\n : T extends MockDataUrl\n ? {pool: MockDataUrl[]}\n : T extends RegExp\n ? {pool: RegExp[]}\n : // boolean / bigint BEFORE the object branch and BEFORE the fallback:\n // `{pool: T[]}` would split `boolean` into `{pool: true[]} | {pool: false[]}`; a fixed element type stays one node.\n T extends boolean\n ? {pool: boolean[]}\n : T extends bigint\n ? {pool: bigint[]}\n : T extends object\n ? {[K in keyof T]-?: MockNode<T[K], _MockDepth[Depth]>} & {rt$optional?: number}\n : {pool: T[]};\n\n/** The mock-data map for `T`: every pool / range value is checked against the field's type and format\n * at scan time (the enrich-mock-invalid-pool rule). */\nexport type MockData<T> = MockNode<T>;\n// #endregion mockdata-extract\n"]}
|
package/dist/fnHash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fnHash.js","sourceRoot":"","sources":["../src/fnHash.ts"],"names":[],"mappings":"AAUA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAmB,MAAM,sCAAsC,CAAC;AAkB1G,SAAS,oBAAoB,CAAC,IAAwB;IACpD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,cAAc,CAAC;IAC7C,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,cAAc,CAAC;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAGD,SAAS,oBAAoB,CAAC,OAAkC;IAC9D,IAAI,CAAC,OA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AAC,CAAC;SACvE,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc;QAAE,KAAK,GAAG,OAAO,EAAE,QAAQ,IAAI,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC;IAEhG,IAAI,KAAK,CAAC,eAAe,IAAI,OAAO,EAAE,kBAAkB;QAAE,KAAK,IAAI,GAAG,CAAC;IACvE,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7H,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// getFnHash — the fnHash half of the `<fnHash>_<typeId>` runtime cache key every createX call site\n// resolves, derived WITHOUT the plugin-injected function tuple. The typeId half always comes from\n// the plugin (it needs the type-checker, so read it from getRunTypeId / an InjectRunTypeId marker),\n// but the fnHash is a pure function of the family + its compile-time options and is STABLE across\n// mion releases, since its salt no longer folds the binary version (see\n// internal/cachegen/operations/fnhash.go). So a framework holding an injected typeId can rebuild the\n// key itself (`getFnHash('validate') + '_' + typeId`) instead of hand-pinning a `family → prefix`\n// map that used to churn on every version bump. Values come from the Go-generated fnHashes table\n// (source of truth: operations.FnHashFor); nothing is hashed at runtime.\n\nimport {FN_HASHES, VALIDATE_OPTION_LETTERS, type FnHashEntry} from './go-generated/fnHashes.generated.ts';\n\n/** The InjectTypeFnArgs Fn keys of every createX factory and JSON value-level primitive (`val`, `ruk`, `pjs`, …). */\nexport type FnHashKey = keyof typeof FN_HASHES;\n\n/** The createX factory's own compile-time bag; `strategy` picks a JSON variant, options foreign to the family are ignored. */\nexport interface FnHashOptions {\n /** Selects the base `number` kind check (validate / validationErrors):\n * 'isFinite' (default) / 'typeof' / 'notNaN'. The two non-default values ride\n * as canonical option names (numberTypeof / numberNotNaN) in the variant token. */\n numberMode?: string;\n strategy?: string;\n /** Adds the 'C' fnHash token on CircularGuarded families (validate / validationErrors / jsonEncoder) only. */\n rejectCircularRefs?: boolean;\n}\n\n// Mirror of Go constants.NumberModeOptionName: the two non-default numberMode values ride as\n// canonical option names in VALIDATE_OPTION_LETTERS; isFinite and anything unrecognized add none.\nfunction numberModeOptionName(mode: string | undefined): string {\n if (mode === 'typeof') return 'numberTypeof';\n if (mode === 'notNaN') return 'numberNotNaN';\n return '';\n}\n\n// Mirror of Go constants.ValidateVariantSuffix; only this assembly is hand-written, getFnHash.test.ts pins it.\nfunction validateVariantToken(options: FnHashOptions | undefined): string {\n if (!options) return '';\n const numberModeName = numberModeOptionName(options.numberMode);\n let suffix = 'N';\n let hit = false;\n for (const [name, letter] of VALIDATE_OPTION_LETTERS) {\n if (name === numberModeName) {\n suffix += letter;\n hit = true;\n }\n }\n return hit ? suffix : '';\n}\n\n/** Resolve the version-independent fnHash for a function family (+ options).\n * Throws on an unknown fnKey or an option combination with no matching variant\n * (e.g. an unknown JSON `strategy`). Accepts any string so a framework can pass\n * a dynamic key; known keys get autocomplete via FnHashKey. */\nexport function getFnHash(fnKey: FnHashKey | (string & {}), options?: FnHashOptions): string {\n const entry = FN_HASHES[fnKey as FnHashKey] as FnHashEntry | undefined;\n if (!entry) throw new Error(`getFnHash: unknown fnKey ${JSON.stringify(fnKey)}`);\n let token = '';\n if (entry.axis === 'validateOptions') token = validateVariantToken(options);\n else if (entry.axis === 'jsonStrategy') token = options?.strategy ?? entry.defaultVariant ?? '';\n // Mirror of Go's circularCanonicalSuffix: the armed variant's token is the base token plus 'C'.\n if (entry.circularGuarded && options?.rejectCircularRefs) token += 'C';\n const hash = entry.variants[token];\n if (hash === undefined) throw new Error(`getFnHash: fnKey ${JSON.stringify(fnKey)} has no ${JSON.stringify(token)} variant`);\n return hash;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bigintFormats.js","sourceRoot":"","sources":["../../src/formats/bigintFormats.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AA4CzD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,QAAQ,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,QAAQ,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiB,QAAQ,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiB,QAAQ,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAW,QAAQ,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAY,QAAQ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"bigintFormats.js","sourceRoot":"","sources":["../../src/formats/bigintFormats.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AA4CzD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,QAAQ,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAc,QAAQ,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiB,QAAQ,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiB,QAAQ,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAW,QAAQ,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAY,QAAQ,CAAC,CAAC","sourcesContent":["// TYPE aliases only, their functions are emitted elsewhere. `TypeFormat` is a value import (not `import type`)\n// so each brand alias's reflection metadata stays reachable for tsgo.\n\nimport {TypeFormat} from '../runtypes/typeFormat.ts';\nimport {presetBuilder} from '../runtypes/builderCore.ts';\n\n// ─────────────────────────── BigIntFormat ───────────────────────────\n\n// Cross-param invariants (min⊕gt, max⊕lt, multipleOf>0) are validated build-time in Go: a bound is\n// inclusive OR exclusive, never both. No integer/float distinction, bigints are integers.\nexport interface BigIntParams {\n min?: bigint;\n max?: bigint;\n lt?: bigint;\n gt?: bigint;\n multipleOf?: bigint;\n /** JSON Schema alias of `min` (inclusive lower bound). Normalised to `min`. */\n minimum?: bigint;\n /** JSON Schema alias of `max` (inclusive upper bound). Normalised to `max`. */\n maximum?: bigint;\n /** JSON Schema alias of `gt` (exclusive lower bound). Normalised to `gt`. */\n exclusiveMinimum?: bigint;\n /** JSON Schema alias of `lt` (exclusive upper bound). Normalised to `lt`. */\n exclusiveMaximum?: bigint;\n}\n\n// The branded bigint alias users annotate with, e.g. `BigInt<{min: 0n}>`.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type BigInt<P extends BigIntParams = {}, BrandName extends string = never> = TypeFormat<\n bigint,\n 'bigintFormat',\n P,\n BrandName\n>;\n\nexport type BigPositive = BigInt<{min: 0n}>;\nexport type BigNegative = BigInt<{max: 0n}>;\nexport type BigPositiveInt = BigInt<{min: 0n; multipleOf: 1n}>;\nexport type BigNegativeInt = BigInt<{max: 0n; multipleOf: 1n}>;\nexport type BigInt64 = BigInt<{min: -9223372036854775808n; max: 9223372036854775807n}>;\nexport type BigUInt64 = BigInt<{min: 0n; max: 18446744073709551615n}>;\n\n// ───────────────────── Predefined bigint builders ───────────────────\n//\n// Each builder carries the CONCRETE alias above, so the value-first id converges with the type-first\n// `createValidateFn<BigInt64>()`. For ad-hoc constraints use `TF.bigInt({min, max, …})`.\n\n/** ≥ 0n (`BigPositive`). **/\nexport const bigPositive = presetBuilder<BigPositive>('bigint');\n/** ≤ 0n (`BigNegative`). **/\nexport const bigNegative = presetBuilder<BigNegative>('bigint');\n/** ≥ 0n, whole (`BigPositiveInt`). **/\nexport const bigPositiveInt = presetBuilder<BigPositiveInt>('bigint');\n/** ≤ 0n, whole (`BigNegativeInt`). **/\nexport const bigNegativeInt = presetBuilder<BigNegativeInt>('bigint');\n/** Signed 64-bit bigint (`BigInt64`). **/\nexport const bigInt64 = presetBuilder<BigInt64>('bigint');\n/** Unsigned 64-bit bigint (`BigUInt64`). **/\nexport const bigUInt64 = presetBuilder<BigUInt64>('bigint');\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFormats.js","sourceRoot":"","sources":["../../../src/formats/datetime/dateFormats.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"dateFormats.js","sourceRoot":"","sources":["../../../src/formats/datetime/dateFormats.ts"],"names":[],"mappings":"","sourcesContent":["// `Date<P>` brands the JS `Date` OBJECT (not a string) with the string date/time formats' min/max params\n// (./dateTimeParams.ts). Validation is emitted in Go (internal/cachegen/typefunctions/formats/datetime/nativeDate.go);\n// the default JSON codec already handles Date. `TypeFormat` is a value import to keep reflection reachable for tsgo.\n\nimport {TypeFormat} from '../../runtypes/typeFormat.ts';\nimport type {MinMax, DateTimeBound} from './dateTimeParams.ts';\n\n// A bound is an absolute ISO datetime literal OR a relative now±P spec, with both date and time\n// duration components allowed (a Date carries both). An Invalid Date (NaN) is always rejected.\nexport type NativeDateParams = MinMax<DateTimeBound>;\n\n// The `Date` format alias users annotate with, e.g. `Date<{min: 'now'}>`. TRANSPARENT by default\n// like `String` / `Number` / `BigInt`; `BrandName` opts INTO a nominal type, matching the value-first\n// `date(P, brand('CreatedAt'))` builder. NEVER hardcode a brand arg here: TypeFormat honors\n// BrandName, so it would make every `Date<P>` spuriously nominal and split it from that builder.\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport type Date<P extends NativeDateParams = {}, BrandName extends string = never> = TypeFormat<\n globalThis.Date,\n 'nativeDate',\n P,\n BrandName\n>;\n\n// `now` is the current instant at validation time.\nexport type DateFuture = Date<{min: 'now'}>;\nexport type DatePast = Date<{max: 'now'}>;\n"]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export declare const isDateString: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
2
|
-
export declare const isDateString_YMD: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
3
|
-
export declare const isDateString_DMY: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
4
|
-
export declare const isDateString_MDY: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
5
|
-
export declare const isDateString_YM: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
6
|
-
export declare const isDateString_MD: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
7
|
-
export declare const isDateString_DM: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
8
|
-
export declare const isHours: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
9
|
-
export declare const isMinutes: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
10
|
-
export declare const isSeconds: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
11
|
-
export declare const isSecondsWithMs: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
12
|
-
export declare const isSecondsWithLeap: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
13
|
-
export declare const isTimeZone: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
14
|
-
export declare const isTimeString_ISO: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
15
|
-
export declare const isTimeString_ISO_TZ: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
16
|
-
export declare const isTimeString_HHmmss: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
17
|
-
export declare const isTimeString_HHmm: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
18
|
-
export declare const isTimeString_mmss: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
19
|
-
export declare const dateStrToMs: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
20
|
-
export declare const timeStrToMs: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
21
|
-
export declare const relativeNowKey: import("../../runtypes/pureFn.ts").PureFnId<"
|
|
1
|
+
export declare const isDateString: import("../../runtypes/pureFn.ts").PureFnId<"_rt:8AgZCCAhyw">;
|
|
2
|
+
export declare const isDateString_YMD: import("../../runtypes/pureFn.ts").PureFnId<"_rt:3RndhrueRD">;
|
|
3
|
+
export declare const isDateString_DMY: import("../../runtypes/pureFn.ts").PureFnId<"_rt:eupKgBrCGt">;
|
|
4
|
+
export declare const isDateString_MDY: import("../../runtypes/pureFn.ts").PureFnId<"_rt:T48n0wyjPx">;
|
|
5
|
+
export declare const isDateString_YM: import("../../runtypes/pureFn.ts").PureFnId<"_rt:oUfCfYMODo">;
|
|
6
|
+
export declare const isDateString_MD: import("../../runtypes/pureFn.ts").PureFnId<"_rt:AmEsDA-eXW">;
|
|
7
|
+
export declare const isDateString_DM: import("../../runtypes/pureFn.ts").PureFnId<"_rt:nLaf1XVvS4">;
|
|
8
|
+
export declare const isHours: import("../../runtypes/pureFn.ts").PureFnId<"_rt:d8U9HjmMsN">;
|
|
9
|
+
export declare const isMinutes: import("../../runtypes/pureFn.ts").PureFnId<"_rt:cgwpjq6rGs">;
|
|
10
|
+
export declare const isSeconds: import("../../runtypes/pureFn.ts").PureFnId<"_rt:n_ZOWff4X3">;
|
|
11
|
+
export declare const isSecondsWithMs: import("../../runtypes/pureFn.ts").PureFnId<"_rt:6E7qWsIwaF">;
|
|
12
|
+
export declare const isSecondsWithLeap: import("../../runtypes/pureFn.ts").PureFnId<"_rt:lFYcgG5ZSI">;
|
|
13
|
+
export declare const isTimeZone: import("../../runtypes/pureFn.ts").PureFnId<"_rt:vPNeWxcCkj">;
|
|
14
|
+
export declare const isTimeString_ISO: import("../../runtypes/pureFn.ts").PureFnId<"_rt:OCJ1B0-ZCA">;
|
|
15
|
+
export declare const isTimeString_ISO_TZ: import("../../runtypes/pureFn.ts").PureFnId<"_rt:OXVO2EpSFv">;
|
|
16
|
+
export declare const isTimeString_HHmmss: import("../../runtypes/pureFn.ts").PureFnId<"_rt:IyjvBbz0zS">;
|
|
17
|
+
export declare const isTimeString_HHmm: import("../../runtypes/pureFn.ts").PureFnId<"_rt:hiotRbfSKF">;
|
|
18
|
+
export declare const isTimeString_mmss: import("../../runtypes/pureFn.ts").PureFnId<"_rt:2xtQHAMu-y">;
|
|
19
|
+
export declare const dateStrToMs: import("../../runtypes/pureFn.ts").PureFnId<"_rt:eglb1lzTW9">;
|
|
20
|
+
export declare const timeStrToMs: import("../../runtypes/pureFn.ts").PureFnId<"_rt:jKlKNzqG2-">;
|
|
21
|
+
export declare const relativeNowKey: import("../../runtypes/pureFn.ts").PureFnId<"_rt:ZPLfUKoTJQ">;
|
|
22
22
|
//# sourceMappingURL=dateTime-pure-fns.d.ts.map
|
|
@@ -29,6 +29,9 @@ export const isDateString = registerPureFnFactory(null /** isDateStringId hollow
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
|
|
@@ -394,6 +397,10 @@ export const relativeNowKey = registerPureFnFactory(null /** relativeNowKeyId ho
|
|
|
394
397
|
|
|
395
398
|
|
|
396
399
|
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
|
|
397
404
|
|
|
398
405
|
|
|
399
406
|
|