@powerlines/plugin-content-collections 0.1.341 → 0.1.342
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 +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
- package/dist/_virtual/_rolldown/runtime.mjs +3 -0
- package/dist/helpers/create-emitter.cjs +2 -1
- package/dist/helpers/create-emitter.d.cts.map +1 -1
- package/dist/helpers/create-emitter.d.mts.map +1 -1
- package/dist/helpers/create-writer.cjs +9 -8
- package/dist/helpers/create-writer.d.cts +0 -1
- package/dist/helpers/create-writer.d.cts.map +1 -1
- package/dist/helpers/create-writer.d.mts +0 -1
- package/dist/helpers/create-writer.d.mts.map +1 -1
- package/dist/helpers/create-writer.mjs +2 -2
- package/dist/helpers/index.cjs +1 -0
- package/dist/index.cjs +15 -16
- package/dist/index.d.cts +0 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +30 -26
- package/dist/_virtual/rolldown_runtime.mjs +0 -32
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.cjs +0 -1946
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs +0 -1939
- package/dist/node_modules/.pnpm/@content-collections_core@0.12.0_patch_hash_bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.cjs +0 -9
- package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.mjs +0 -10
- package/dist/node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.cjs +0 -2124
- package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.mjs +0 -2120
- package/dist/node_modules/.pnpm/esbuild@0.25.12/node_modules/esbuild/lib/main.mjs.map +0 -1
- package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.cjs +0 -5342
- package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.mjs +0 -5340
- package/dist/node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.mjs.map +0 -1
- package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.cjs +0 -35
- package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.mjs +0 -31
- package/dist/node_modules/.pnpm/extend-shallow@2.0.1/node_modules/extend-shallow/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.cjs +0 -516
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs +0 -515
- package/dist/node_modules/.pnpm/fdir@6.5.0_@types_picomatch@4.0.2_picomatch@4.0.3/node_modules/fdir/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.cjs +0 -185
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.mjs +0 -181
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.cjs +0 -27
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.mjs +0 -23
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.cjs +0 -33
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.mjs +0 -29
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engine.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.cjs +0 -58
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.mjs +0 -54
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/engines.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.cjs +0 -28
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.mjs +0 -24
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/excerpt.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.cjs +0 -25
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.mjs +0 -21
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/parse.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.cjs +0 -53
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.mjs +0 -49
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.cjs +0 -41
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.mjs +0 -37
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/to-file.mjs.map +0 -1
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.cjs +0 -66
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.mjs +0 -62
- package/dist/node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.cjs +0 -24
- package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.mjs +0 -20
- package/dist/node_modules/.pnpm/is-extendable@0.1.1/node_modules/is-extendable/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.cjs +0 -18
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.mjs +0 -14
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.cjs +0 -51
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.mjs +0 -47
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/common.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.cjs +0 -452
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.mjs +0 -448
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/dumper.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.cjs +0 -33
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.mjs +0 -29
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/exception.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.cjs +0 -820
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.mjs +0 -816
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/loader.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.cjs +0 -63
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.mjs +0 -59
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/mark.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.cjs +0 -19
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.mjs +0 -15
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/core.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.cjs +0 -29
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.mjs +0 -25
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_full.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.cjs +0 -34
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.mjs +0 -30
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/default_safe.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.cjs +0 -25
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.mjs +0 -21
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/failsafe.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.cjs +0 -31
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.mjs +0 -27
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema/json.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.cjs +0 -88
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.mjs +0 -84
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/schema.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.cjs +0 -95
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.mjs +0 -91
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/binary.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.cjs +0 -46
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.mjs +0 -42
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/bool.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.cjs +0 -77
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.mjs +0 -73
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/float.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.cjs +0 -136
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.mjs +0 -132
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/int.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.cjs +0 -57
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.mjs +0 -53
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/function.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.cjs +0 -53
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.mjs +0 -49
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/regexp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.cjs +0 -34
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.mjs +0 -30
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/js/undefined.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.cjs +0 -23
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.mjs +0 -19
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/map.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.cjs +0 -24
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.mjs +0 -20
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/merge.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.cjs +0 -49
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.mjs +0 -45
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/null.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.cjs +0 -42
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.mjs +0 -38
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/omap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.cjs +0 -47
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.mjs +0 -43
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/pairs.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.cjs +0 -23
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.mjs +0 -19
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/seq.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.cjs +0 -34
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.mjs +0 -30
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/set.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.cjs +0 -23
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.mjs +0 -19
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/str.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.cjs +0 -62
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.mjs +0 -58
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type/timestamp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.cjs +0 -62
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.mjs +0 -58
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml/type.mjs.map +0 -1
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.cjs +0 -53
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.mjs +0 -49
- package/dist/node_modules/.pnpm/js-yaml@3.14.2/node_modules/js-yaml/lib/js-yaml.mjs.map +0 -1
- package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.cjs +0 -97
- package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.mjs +0 -95
- package/dist/node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.cjs +0 -62
- package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.mjs +0 -63
- package/dist/node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.cjs +0 -28
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs +0 -24
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.cjs +0 -175
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs +0 -171
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.cjs +0 -871
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs +0 -867
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.cjs +0 -307
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs +0 -303
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.cjs +0 -300
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs +0 -296
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs.map +0 -1
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.cjs +0 -60
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs +0 -56
- package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.cjs +0 -14
- package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.mjs +0 -12
- package/dist/node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.cjs +0 -117
- package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.mjs +0 -113
- package/dist/node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.cjs +0 -119
- package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs +0 -115
- package/dist/node_modules/.pnpm/serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.cjs +0 -25
- package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.mjs +0 -21
- package/dist/node_modules/.pnpm/strip-bom-string@1.0.0/node_modules/strip-bom-string/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.cjs +0 -294
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs +0 -293
- package/dist/node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.cjs +0 -70
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.mjs +0 -66
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.cjs +0 -57
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.mjs +0 -53
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-doc.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.cjs +0 -102
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.mjs +0 -98
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-node.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.cjs +0 -74
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.mjs +0 -70
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/compose-scalar.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.cjs +0 -215
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.mjs +0 -211
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/composer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.cjs +0 -101
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.mjs +0 -97
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-map.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.cjs +0 -187
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.mjs +0 -183
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-scalar.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.cjs +0 -56
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.mjs +0 -52
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-block-seq.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.cjs +0 -49
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.mjs +0 -45
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-end.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.cjs +0 -174
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.mjs +0 -170
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.cjs +0 -219
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs +0 -215
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-flow-scalar.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.cjs +0 -118
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.mjs +0 -114
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/resolve-props.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.cjs +0 -40
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.mjs +0 -36
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-contains-newline.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.cjs +0 -38
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs +0 -34
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-empty-scalar-position.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.cjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.mjs +0 -20
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-flow-indent-check.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.cjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.mjs +0 -20
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/compose/util-map-includes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.cjs +0 -303
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.mjs +0 -299
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/Document.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.cjs +0 -75
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/anchors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.cjs +0 -51
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.mjs +0 -47
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/applyReviver.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.cjs +0 -77
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.mjs +0 -73
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/createNode.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.cjs +0 -178
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.mjs +0 -174
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/doc/directives.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.cjs +0 -64
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.mjs +0 -60
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/errors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.cjs +0 -75
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.cjs +0 -25
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.mjs +0 -21
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/log.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.cjs +0 -109
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.mjs +0 -105
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Alias.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.cjs +0 -135
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.mjs +0 -131
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.cjs +0 -48
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.mjs +0 -44
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Node.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.cjs +0 -48
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.mjs +0 -44
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Pair.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.cjs +0 -41
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.mjs +0 -37
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/Scalar.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.cjs +0 -126
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.mjs +0 -122
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.cjs +0 -123
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.mjs +0 -119
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/YAMLSeq.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.cjs +0 -67
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.mjs +0 -63
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/addPairToJSMap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.cjs +0 -61
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.mjs +0 -57
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/identity.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.cjs +0 -49
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.mjs +0 -45
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/nodes/toJS.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.cjs +0 -282
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.mjs +0 -278
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-scalar.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.cjs +0 -62
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.mjs +0 -58
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-stringify.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.cjs +0 -102
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.mjs +0 -98
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst-visit.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.cjs +0 -93
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.mjs +0 -89
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/cst.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.cjs +0 -531
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.mjs +0 -527
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/lexer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.cjs +0 -58
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.mjs +0 -54
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/line-counter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.cjs +0 -871
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.mjs +0 -867
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/parse/parser.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.cjs +0 -105
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.mjs +0 -101
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/public-api.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.cjs +0 -45
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.mjs +0 -41
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/Schema.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.cjs +0 -31
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.mjs +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/map.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.cjs +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.mjs +0 -23
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/null.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.cjs +0 -31
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.mjs +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/seq.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.cjs +0 -28
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.mjs +0 -24
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/common/string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.cjs +0 -31
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.mjs +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/bool.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.cjs +0 -55
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.mjs +0 -51
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/float.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.cjs +0 -53
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.mjs +0 -49
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/int.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.cjs +0 -43
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.mjs +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/core/schema.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.cjs +0 -77
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.mjs +0 -73
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/json/schema.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.cjs +0 -111
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.mjs +0 -107
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/tags.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.cjs +0 -62
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs +0 -58
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/binary.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.cjs +0 -39
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs +0 -35
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/bool.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.cjs +0 -58
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.mjs +0 -54
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/float.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.cjs +0 -87
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.mjs +0 -83
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/int.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.cjs +0 -53
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs +0 -49
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/merge.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.cjs +0 -79
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs +0 -75
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/omap.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.cjs +0 -75
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/pairs.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.cjs +0 -65
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs +0 -61
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/schema.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.cjs +0 -82
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.mjs +0 -78
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/set.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.cjs +0 -95
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs +0 -91
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/schema/yaml-1.1/timestamp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.cjs +0 -127
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.mjs +0 -123
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/foldFlowLines.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.cjs +0 -122
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.mjs +0 -118
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringify.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.cjs +0 -128
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.mjs +0 -124
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyCollection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.cjs +0 -31
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.mjs +0 -27
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyComment.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.cjs +0 -75
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.mjs +0 -71
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyDocument.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.cjs +0 -32
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.mjs +0 -28
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyNumber.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.cjs +0 -112
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.mjs +0 -108
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyPair.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.cjs +0 -237
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.mjs +0 -233
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/stringify/stringifyString.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.cjs +0 -202
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.mjs +0 -198
- package/dist/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/dist/visit.mjs.map +0 -1
- package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.cjs +0 -61
- package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.mjs +0 -61
- package/dist/node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.mjs.map +0 -1
|
@@ -1,1939 +0,0 @@
|
|
|
1
|
-
import { __toESM } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_picomatch } from "../../../../../picomatch@4.0.3/node_modules/picomatch/index.mjs";
|
|
3
|
-
import { glob } from "../../../../../tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs";
|
|
4
|
-
import { require_gray_matter } from "../../../../../gray-matter@4.0.3/node_modules/gray-matter/index.mjs";
|
|
5
|
-
import { require_dist } from "../../../../../yaml@2.8.2/node_modules/yaml/dist/index.mjs";
|
|
6
|
-
import "../../../../../camelcase@8.0.0/node_modules/camelcase/index.mjs";
|
|
7
|
-
import pLimit from "../../../../../p-limit@6.2.0/node_modules/p-limit/index.mjs";
|
|
8
|
-
import { require_main } from "../../../../../esbuild@0.25.12/node_modules/esbuild/lib/main.mjs";
|
|
9
|
-
import { require_serialize_javascript } from "../../../../../serialize-javascript@6.0.2/node_modules/serialize-javascript/index.mjs";
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
|
-
import path, { basename, dirname, extname, join, resolve } from "node:path";
|
|
12
|
-
import { createHash } from "node:crypto";
|
|
13
|
-
import fs2, { existsSync } from "node:fs";
|
|
14
|
-
import fs, { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
15
|
-
import pluralize from "pluralize";
|
|
16
|
-
import os from "node:os";
|
|
17
|
-
import { EventEmitter } from "node:events";
|
|
18
|
-
|
|
19
|
-
//#region ../../node_modules/.pnpm/@content-collections+core@0.12.0_patch_hash=bceb89349da763f8c715d7b53875be4a1e5bc5161d7_3067b2e8f290866ec343d5ebc4494f7e/node_modules/@content-collections/core/dist/index.js
|
|
20
|
-
var import_gray_matter = /* @__PURE__ */ __toESM(require_gray_matter(), 1);
|
|
21
|
-
var import_dist = require_dist();
|
|
22
|
-
var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
|
|
23
|
-
var import_main = require_main();
|
|
24
|
-
var import_serialize_javascript = /* @__PURE__ */ __toESM(require_serialize_javascript(), 1);
|
|
25
|
-
function createKey(config$1, input, key) {
|
|
26
|
-
return createHash("sha256").update(config$1).update(JSON.stringify(input)).update(key).digest("hex");
|
|
27
|
-
}
|
|
28
|
-
async function createCacheDirectory(directory) {
|
|
29
|
-
const cacheDirectory = path.join(directory, ".content-collections", "cache");
|
|
30
|
-
if (!existsSync(cacheDirectory)) await mkdir(cacheDirectory, { recursive: true });
|
|
31
|
-
return cacheDirectory;
|
|
32
|
-
}
|
|
33
|
-
function fileName(input) {
|
|
34
|
-
return input.replace(/[^a-z0-9]/gi, "_").toLowerCase();
|
|
35
|
-
}
|
|
36
|
-
async function readMapping(mappingPath) {
|
|
37
|
-
if (existsSync(mappingPath)) try {
|
|
38
|
-
return JSON.parse(await readFile(mappingPath, "utf-8"));
|
|
39
|
-
} catch (e) {
|
|
40
|
-
console.error("Failed to parse the cache mapping. We will recreate the cache.");
|
|
41
|
-
}
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
async function createCacheManager(baseDirectory, configChecksum) {
|
|
45
|
-
const cacheDirectory = await createCacheDirectory(baseDirectory);
|
|
46
|
-
const mappingPath = join(cacheDirectory, "mapping.json");
|
|
47
|
-
const mapping = await readMapping(mappingPath);
|
|
48
|
-
async function flush() {
|
|
49
|
-
await writeFile(mappingPath, JSON.stringify(mapping));
|
|
50
|
-
}
|
|
51
|
-
function cache(collection, file) {
|
|
52
|
-
const directory = join(cacheDirectory, fileName(collection), fileName(file));
|
|
53
|
-
let collectionMapping = mapping[collection];
|
|
54
|
-
if (!collectionMapping) {
|
|
55
|
-
collectionMapping = {};
|
|
56
|
-
mapping[collection] = collectionMapping;
|
|
57
|
-
}
|
|
58
|
-
let fileMapping = collectionMapping[file];
|
|
59
|
-
if (!fileMapping) {
|
|
60
|
-
fileMapping = [];
|
|
61
|
-
collectionMapping[file] = fileMapping;
|
|
62
|
-
}
|
|
63
|
-
let newFileMapping = [];
|
|
64
|
-
const cacheFn = async (input, fn, options) => {
|
|
65
|
-
const key = createKey(configChecksum, input, options?.key || "");
|
|
66
|
-
newFileMapping.push(key);
|
|
67
|
-
const filePath = join(directory, `${key}.cache`);
|
|
68
|
-
if (fileMapping?.includes(key) || newFileMapping.includes(key)) {
|
|
69
|
-
if (existsSync(filePath)) try {
|
|
70
|
-
return JSON.parse(await readFile(filePath, "utf-8"));
|
|
71
|
-
} catch (e) {
|
|
72
|
-
console.error("Failed to parse the cache file. We will recompute the value.");
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const output = await fn(input);
|
|
76
|
-
if (!existsSync(directory)) await mkdir(directory, { recursive: true });
|
|
77
|
-
await writeFile(filePath, JSON.stringify(output));
|
|
78
|
-
return output;
|
|
79
|
-
};
|
|
80
|
-
const tidyUp = async () => {
|
|
81
|
-
const filesToDelete = fileMapping?.filter((key) => !newFileMapping.includes(key)) || [];
|
|
82
|
-
for (const key of filesToDelete) {
|
|
83
|
-
const filePath = join(directory, `${key}.cache`);
|
|
84
|
-
if (existsSync(filePath)) await unlink(filePath);
|
|
85
|
-
}
|
|
86
|
-
if (collectionMapping) collectionMapping[file] = newFileMapping;
|
|
87
|
-
};
|
|
88
|
-
return {
|
|
89
|
-
cacheFn,
|
|
90
|
-
tidyUp
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
cache,
|
|
95
|
-
flush
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function parseYaml(content) {
|
|
99
|
-
return (0, import_dist.parse)(content.trim());
|
|
100
|
-
}
|
|
101
|
-
function frontmatter(fileContent) {
|
|
102
|
-
return (0, import_gray_matter.default)(fileContent, { engines: { yaml: {
|
|
103
|
-
parse: parseYaml,
|
|
104
|
-
stringify: import_dist.stringify
|
|
105
|
-
} } });
|
|
106
|
-
}
|
|
107
|
-
function frontmatterParser(fileContent) {
|
|
108
|
-
const { data, content } = frontmatter(fileContent);
|
|
109
|
-
return {
|
|
110
|
-
...data,
|
|
111
|
-
content: content.trim()
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function frontmatterOnlyParser(fileContent) {
|
|
115
|
-
const { data } = frontmatter(fileContent);
|
|
116
|
-
return data;
|
|
117
|
-
}
|
|
118
|
-
const parsers = {
|
|
119
|
-
frontmatter: {
|
|
120
|
-
hasContent: true,
|
|
121
|
-
parse: frontmatterParser
|
|
122
|
-
},
|
|
123
|
-
["frontmatter-only"]: {
|
|
124
|
-
hasContent: false,
|
|
125
|
-
parse: frontmatterOnlyParser
|
|
126
|
-
},
|
|
127
|
-
json: {
|
|
128
|
-
hasContent: false,
|
|
129
|
-
parse: JSON.parse
|
|
130
|
-
},
|
|
131
|
-
yaml: {
|
|
132
|
-
hasContent: false,
|
|
133
|
-
parse: parseYaml
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
function getParser(configuredParser) {
|
|
137
|
-
if (typeof configuredParser === "string") return parsers[configuredParser];
|
|
138
|
-
return configuredParser;
|
|
139
|
-
}
|
|
140
|
-
function isDefined(value) {
|
|
141
|
-
return value !== void 0 && value !== null;
|
|
142
|
-
}
|
|
143
|
-
function orderByPath(a, b) {
|
|
144
|
-
return a.path.localeCompare(b.path);
|
|
145
|
-
}
|
|
146
|
-
function posixToNativePath(pathName) {
|
|
147
|
-
if (path.sep !== path.posix.sep) return pathName.replaceAll(path.posix.sep, path.sep);
|
|
148
|
-
return pathName;
|
|
149
|
-
}
|
|
150
|
-
var CollectError = class extends Error {
|
|
151
|
-
type;
|
|
152
|
-
constructor(type, message) {
|
|
153
|
-
super(message);
|
|
154
|
-
this.type = type;
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
function createCollector(emitter, baseDirectory = ".") {
|
|
158
|
-
async function read(filePath) {
|
|
159
|
-
try {
|
|
160
|
-
return await readFile(filePath, "utf-8");
|
|
161
|
-
} catch (error) {
|
|
162
|
-
emitter.emit("collector:read-error", {
|
|
163
|
-
filePath,
|
|
164
|
-
error: new CollectError("Read", String(error))
|
|
165
|
-
});
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
async function collectFile(collection, filePath) {
|
|
170
|
-
const file = await read(path.join(baseDirectory, collection.directory, filePath));
|
|
171
|
-
if (!file) return null;
|
|
172
|
-
try {
|
|
173
|
-
return {
|
|
174
|
-
data: await getParser(collection.parser).parse(file),
|
|
175
|
-
path: filePath
|
|
176
|
-
};
|
|
177
|
-
} catch (error) {
|
|
178
|
-
emitter.emit("collector:parse-error", {
|
|
179
|
-
filePath: path.join(collection.directory, filePath),
|
|
180
|
-
error: new CollectError("Parse", String(error))
|
|
181
|
-
});
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function createIgnorePattern(collection) {
|
|
186
|
-
if (collection.exclude) if (Array.isArray(collection.exclude)) return collection.exclude;
|
|
187
|
-
else return [collection.exclude];
|
|
188
|
-
}
|
|
189
|
-
async function resolveCollection(collection) {
|
|
190
|
-
const collectionDirectory = path.join(baseDirectory, collection.directory);
|
|
191
|
-
const promises = (await glob(Array.isArray(collection.include) ? collection.include : [collection.include], {
|
|
192
|
-
cwd: collectionDirectory,
|
|
193
|
-
onlyFiles: true,
|
|
194
|
-
absolute: false,
|
|
195
|
-
ignore: createIgnorePattern(collection)
|
|
196
|
-
})).map((filePath) => collectFile(collection, posixToNativePath(filePath)));
|
|
197
|
-
const files = await Promise.all(promises);
|
|
198
|
-
return {
|
|
199
|
-
...collection,
|
|
200
|
-
files: files.filter(isDefined).sort(orderByPath)
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
async function collect(unresolvedCollections) {
|
|
204
|
-
const promises = unresolvedCollections.map((collection) => resolveCollection(collection));
|
|
205
|
-
return await Promise.all(promises);
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
collect,
|
|
209
|
-
collectFile
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function createSynchronizer(readCollectionFile, collections, baseDirectory = ".") {
|
|
213
|
-
function findCollections(filePath) {
|
|
214
|
-
const resolvedFilePath = path.resolve(filePath);
|
|
215
|
-
return collections.filter((collection) => {
|
|
216
|
-
return resolvedFilePath.startsWith(path.resolve(baseDirectory, collection.directory));
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
function createRelativePath(collectionPath, filePath) {
|
|
220
|
-
const resolvedCollectionPath = path.resolve(baseDirectory, collectionPath);
|
|
221
|
-
let relativePath = path.resolve(filePath).slice(resolvedCollectionPath.length);
|
|
222
|
-
if (relativePath.startsWith(path.sep)) relativePath = relativePath.slice(path.sep.length);
|
|
223
|
-
return relativePath;
|
|
224
|
-
}
|
|
225
|
-
function resolve$1(filePath) {
|
|
226
|
-
return findCollections(filePath).map((collection) => {
|
|
227
|
-
return {
|
|
228
|
-
collection,
|
|
229
|
-
relativePath: createRelativePath(collection.directory, filePath)
|
|
230
|
-
};
|
|
231
|
-
}).filter(({ collection, relativePath }) => {
|
|
232
|
-
return import_picomatch.default.isMatch(relativePath, collection.include, {
|
|
233
|
-
windows: process.platform === "win32",
|
|
234
|
-
ignore: collection.exclude
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function deleted(filePath) {
|
|
239
|
-
const resolvedCollections = resolve$1(filePath);
|
|
240
|
-
if (resolvedCollections.length === 0) return false;
|
|
241
|
-
let changed$1 = false;
|
|
242
|
-
for (const { collection, relativePath } of resolvedCollections) {
|
|
243
|
-
const index = collection.files.findIndex((file) => file.path === relativePath);
|
|
244
|
-
if (collection.files.splice(index, 1).length > 0) changed$1 = true;
|
|
245
|
-
}
|
|
246
|
-
return changed$1;
|
|
247
|
-
}
|
|
248
|
-
async function changed(filePath) {
|
|
249
|
-
const resolvedCollections = resolve$1(filePath);
|
|
250
|
-
if (resolvedCollections.length === 0) return false;
|
|
251
|
-
let changed$1 = false;
|
|
252
|
-
for (const { collection, relativePath } of resolvedCollections) {
|
|
253
|
-
const index = collection.files.findIndex((file$1) => file$1.path === relativePath);
|
|
254
|
-
const file = await readCollectionFile(collection, relativePath);
|
|
255
|
-
if (file) {
|
|
256
|
-
changed$1 = true;
|
|
257
|
-
if (index === -1) {
|
|
258
|
-
collection.files.push(file);
|
|
259
|
-
collection.files.sort(orderByPath);
|
|
260
|
-
} else collection.files[index] = file;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return changed$1;
|
|
264
|
-
}
|
|
265
|
-
return {
|
|
266
|
-
deleted,
|
|
267
|
-
changed
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
var singleComment = Symbol("singleComment");
|
|
271
|
-
var multiComment = Symbol("multiComment");
|
|
272
|
-
var stripWithoutWhitespace = () => "";
|
|
273
|
-
var stripWithWhitespace = (string$2, start, end) => string$2.slice(start, end).replace(/\S/g, " ");
|
|
274
|
-
var isEscaped = (jsonString, quotePosition) => {
|
|
275
|
-
let index = quotePosition - 1;
|
|
276
|
-
let backslashCount = 0;
|
|
277
|
-
while (jsonString[index] === "\\") {
|
|
278
|
-
index -= 1;
|
|
279
|
-
backslashCount += 1;
|
|
280
|
-
}
|
|
281
|
-
return Boolean(backslashCount % 2);
|
|
282
|
-
};
|
|
283
|
-
function stripJsonComments(jsonString, { whitespace = true, trailingCommas = false } = {}) {
|
|
284
|
-
if (typeof jsonString !== "string") throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
|
|
285
|
-
const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
|
|
286
|
-
let isInsideString = false;
|
|
287
|
-
let isInsideComment = false;
|
|
288
|
-
let offset = 0;
|
|
289
|
-
let buffer = "";
|
|
290
|
-
let result = "";
|
|
291
|
-
let commaIndex = -1;
|
|
292
|
-
for (let index = 0; index < jsonString.length; index++) {
|
|
293
|
-
const currentCharacter = jsonString[index];
|
|
294
|
-
const nextCharacter = jsonString[index + 1];
|
|
295
|
-
if (!isInsideComment && currentCharacter === "\"") {
|
|
296
|
-
if (!isEscaped(jsonString, index)) isInsideString = !isInsideString;
|
|
297
|
-
}
|
|
298
|
-
if (isInsideString) continue;
|
|
299
|
-
if (!isInsideComment && currentCharacter + nextCharacter === "//") {
|
|
300
|
-
buffer += jsonString.slice(offset, index);
|
|
301
|
-
offset = index;
|
|
302
|
-
isInsideComment = singleComment;
|
|
303
|
-
index++;
|
|
304
|
-
} else if (isInsideComment === singleComment && currentCharacter + nextCharacter === "\r\n") {
|
|
305
|
-
index++;
|
|
306
|
-
isInsideComment = false;
|
|
307
|
-
buffer += strip(jsonString, offset, index);
|
|
308
|
-
offset = index;
|
|
309
|
-
continue;
|
|
310
|
-
} else if (isInsideComment === singleComment && currentCharacter === "\n") {
|
|
311
|
-
isInsideComment = false;
|
|
312
|
-
buffer += strip(jsonString, offset, index);
|
|
313
|
-
offset = index;
|
|
314
|
-
} else if (!isInsideComment && currentCharacter + nextCharacter === "/*") {
|
|
315
|
-
buffer += jsonString.slice(offset, index);
|
|
316
|
-
offset = index;
|
|
317
|
-
isInsideComment = multiComment;
|
|
318
|
-
index++;
|
|
319
|
-
continue;
|
|
320
|
-
} else if (isInsideComment === multiComment && currentCharacter + nextCharacter === "*/") {
|
|
321
|
-
index++;
|
|
322
|
-
isInsideComment = false;
|
|
323
|
-
buffer += strip(jsonString, offset, index + 1);
|
|
324
|
-
offset = index + 1;
|
|
325
|
-
continue;
|
|
326
|
-
} else if (trailingCommas && !isInsideComment) {
|
|
327
|
-
if (commaIndex !== -1) {
|
|
328
|
-
if (currentCharacter === "}" || currentCharacter === "]") {
|
|
329
|
-
buffer += jsonString.slice(offset, index);
|
|
330
|
-
result += strip(buffer, 0, 1) + buffer.slice(1);
|
|
331
|
-
buffer = "";
|
|
332
|
-
offset = index;
|
|
333
|
-
commaIndex = -1;
|
|
334
|
-
} else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
|
|
335
|
-
buffer += jsonString.slice(offset, index);
|
|
336
|
-
offset = index;
|
|
337
|
-
commaIndex = -1;
|
|
338
|
-
}
|
|
339
|
-
} else if (currentCharacter === ",") {
|
|
340
|
-
result += buffer + jsonString.slice(offset, index);
|
|
341
|
-
buffer = "";
|
|
342
|
-
offset = index;
|
|
343
|
-
commaIndex = index;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return result + buffer + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
|
|
348
|
-
}
|
|
349
|
-
function jsoncParse(data) {
|
|
350
|
-
try {
|
|
351
|
-
return new Function("return " + stripJsonComments(data).trim())();
|
|
352
|
-
} catch (_) {
|
|
353
|
-
return {};
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
var req = createRequire(import.meta.url);
|
|
357
|
-
var findUp = (name, startDir, stopDir = path.parse(startDir).root) => {
|
|
358
|
-
let dir = startDir;
|
|
359
|
-
while (dir !== stopDir) {
|
|
360
|
-
const file = path.join(dir, name);
|
|
361
|
-
if (fs2.existsSync(file)) return file;
|
|
362
|
-
if (!file.endsWith(".json")) {
|
|
363
|
-
const fileWithExt = file + ".json";
|
|
364
|
-
if (fs2.existsSync(fileWithExt)) return fileWithExt;
|
|
365
|
-
}
|
|
366
|
-
dir = path.dirname(dir);
|
|
367
|
-
}
|
|
368
|
-
return null;
|
|
369
|
-
};
|
|
370
|
-
var resolveTsConfigFromFile = (cwd, filename) => {
|
|
371
|
-
if (path.isAbsolute(filename)) return fs2.existsSync(filename) ? filename : null;
|
|
372
|
-
return findUp(filename, cwd);
|
|
373
|
-
};
|
|
374
|
-
var resolveTsConfigFromExtends = (cwd, name) => {
|
|
375
|
-
if (path.isAbsolute(name)) return fs2.existsSync(name) ? name : null;
|
|
376
|
-
if (name.startsWith(".")) return findUp(name, cwd);
|
|
377
|
-
return req.resolve(name, { paths: [cwd] });
|
|
378
|
-
};
|
|
379
|
-
var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
|
|
380
|
-
var _a, _b;
|
|
381
|
-
dir = path.resolve(dir);
|
|
382
|
-
const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
|
|
383
|
-
if (!id) return null;
|
|
384
|
-
const data = jsoncParse(fs2.readFileSync(id, "utf-8"));
|
|
385
|
-
const configDir = path.dirname(id);
|
|
386
|
-
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) data.compilerOptions.baseUrl = path.join(configDir, data.compilerOptions.baseUrl);
|
|
387
|
-
let extendsFiles = [];
|
|
388
|
-
if (data.extends) {
|
|
389
|
-
const extendsList = Array.isArray(data.extends) ? data.extends : [data.extends];
|
|
390
|
-
const extendsData = {};
|
|
391
|
-
for (const name2 of extendsList) {
|
|
392
|
-
const parentConfig = loadTsConfigInternal(configDir, name2, true);
|
|
393
|
-
if (parentConfig) {
|
|
394
|
-
Object.assign(extendsData, {
|
|
395
|
-
...parentConfig == null ? void 0 : parentConfig.data,
|
|
396
|
-
compilerOptions: {
|
|
397
|
-
...extendsData.compilerOptions,
|
|
398
|
-
...(_b = parentConfig == null ? void 0 : parentConfig.data) == null ? void 0 : _b.compilerOptions
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
extendsFiles.push(...parentConfig.files);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
Object.assign(data, {
|
|
405
|
-
...extendsData,
|
|
406
|
-
...data,
|
|
407
|
-
compilerOptions: {
|
|
408
|
-
...extendsData.compilerOptions,
|
|
409
|
-
...data.compilerOptions
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
delete data.extends;
|
|
414
|
-
return {
|
|
415
|
-
path: id,
|
|
416
|
-
data,
|
|
417
|
-
files: [...extendsFiles, id]
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
var loadTsConfig = (dir, name) => loadTsConfigInternal(dir, name);
|
|
421
|
-
var tsconfigPathsToRegExp = (paths) => {
|
|
422
|
-
return Object.keys(paths || {}).map((key) => {
|
|
423
|
-
return /* @__PURE__ */ new RegExp(`^${key.replace(/\*/, ".*")}$`);
|
|
424
|
-
});
|
|
425
|
-
};
|
|
426
|
-
var match = (id, patterns) => {
|
|
427
|
-
if (!patterns) return false;
|
|
428
|
-
return patterns.some((p) => {
|
|
429
|
-
if (p instanceof RegExp) return p.test(id);
|
|
430
|
-
return id === p || id.startsWith(p + "/");
|
|
431
|
-
});
|
|
432
|
-
};
|
|
433
|
-
function tsconfigResolvePaths(configPath) {
|
|
434
|
-
let tsconfig = loadTsConfig(dirname(configPath));
|
|
435
|
-
if (!tsconfig) tsconfig = loadTsConfig();
|
|
436
|
-
return tsconfig?.data?.compilerOptions?.paths || {};
|
|
437
|
-
}
|
|
438
|
-
const NON_NODE_MODULE_RE = /^[A-Z]:[/\\]|^\.{0,2}\/|^\.{1,2}$/;
|
|
439
|
-
function isCoreImport(path$1, kind) {
|
|
440
|
-
return path$1 === "@content-collections/core" && kind === "import-statement";
|
|
441
|
-
}
|
|
442
|
-
function createExternalsPlugin(configPath) {
|
|
443
|
-
const resolvePatterns = tsconfigPathsToRegExp(tsconfigResolvePaths(configPath));
|
|
444
|
-
return {
|
|
445
|
-
name: "external-packages",
|
|
446
|
-
setup: (build$2) => {
|
|
447
|
-
build$2.onResolve({ filter: /.*/ }, ({ path: path$1, kind }) => {
|
|
448
|
-
if (process.env.NODE_ENV === "test" && isCoreImport(path$1, kind)) return {
|
|
449
|
-
path: join(__dirname, "index.ts"),
|
|
450
|
-
external: true
|
|
451
|
-
};
|
|
452
|
-
if (match(path$1, resolvePatterns)) {
|
|
453
|
-
if (kind === "dynamic-import") return {
|
|
454
|
-
path: path$1,
|
|
455
|
-
external: true
|
|
456
|
-
};
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
if (!NON_NODE_MODULE_RE.test(path$1)) return {
|
|
460
|
-
path: path$1,
|
|
461
|
-
external: true
|
|
462
|
-
};
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
async function compile(configurationPath, outfile) {
|
|
468
|
-
const result = await (0, import_main.build)({
|
|
469
|
-
entryPoints: [configurationPath],
|
|
470
|
-
packages: "external",
|
|
471
|
-
bundle: true,
|
|
472
|
-
platform: "node",
|
|
473
|
-
format: "esm",
|
|
474
|
-
plugins: [createExternalsPlugin(configurationPath)],
|
|
475
|
-
outfile,
|
|
476
|
-
metafile: true
|
|
477
|
-
});
|
|
478
|
-
return Object.keys(result.metafile.inputs);
|
|
479
|
-
}
|
|
480
|
-
var ConfigurationError = class extends Error {
|
|
481
|
-
type;
|
|
482
|
-
constructor(type, message) {
|
|
483
|
-
super(message);
|
|
484
|
-
this.type = type;
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
const defaultConfigName = "content-collection-config.mjs";
|
|
488
|
-
function resolveCacheDir(config$1, options) {
|
|
489
|
-
if (options.cacheDir) return options.cacheDir;
|
|
490
|
-
return path.join(path.dirname(config$1), ".content-collections", "cache");
|
|
491
|
-
}
|
|
492
|
-
function createConfigurationReader() {
|
|
493
|
-
return async (configurationPath, options = { configName: defaultConfigName }) => {
|
|
494
|
-
if (!existsSync(configurationPath)) throw new ConfigurationError("Read", `configuration file ${configurationPath} does not exist`);
|
|
495
|
-
const cacheDir = resolveCacheDir(configurationPath, options);
|
|
496
|
-
await fs.mkdir(cacheDir, { recursive: true });
|
|
497
|
-
const outfile = path.join(cacheDir, options.configName);
|
|
498
|
-
try {
|
|
499
|
-
const configurationPaths = await compile(configurationPath, outfile);
|
|
500
|
-
const module = await import(`file://${path.resolve(outfile)}?x=${Date.now()}`);
|
|
501
|
-
const hash = createHash("sha256");
|
|
502
|
-
hash.update(await fs.readFile(outfile, "utf-8"));
|
|
503
|
-
const checksum = hash.digest("hex");
|
|
504
|
-
return {
|
|
505
|
-
...module.default,
|
|
506
|
-
path: configurationPath,
|
|
507
|
-
inputPaths: configurationPaths.map((p) => path.resolve(p)),
|
|
508
|
-
generateTypes: true,
|
|
509
|
-
checksum
|
|
510
|
-
};
|
|
511
|
-
} catch (error) {
|
|
512
|
-
throw new ConfigurationError("Compile", `configuration file ${configurationPath} is invalid: ${error}`);
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
const deprecations = { implicitContentProperty: `The implicit addition of a content property to schemas is deprecated.
|
|
517
|
-
Please add an explicit content property to your schema.
|
|
518
|
-
For more information, see:
|
|
519
|
-
https://content-collections.dev/docs/deprecations/implicit-content-property` };
|
|
520
|
-
const _suppressDeprecatedWarnings = [];
|
|
521
|
-
function deprecated(deprecation, logger = console.warn) {
|
|
522
|
-
if (_suppressDeprecatedWarnings.includes(deprecation)) return;
|
|
523
|
-
logger(`[CC DEPRECATED]: ${deprecations[deprecation]}`);
|
|
524
|
-
}
|
|
525
|
-
const skippedSymbol = Symbol("skipped");
|
|
526
|
-
Object.freeze({ status: "aborted" });
|
|
527
|
-
function $constructor(name, initializer$1, params) {
|
|
528
|
-
function init(inst, def) {
|
|
529
|
-
var _a;
|
|
530
|
-
Object.defineProperty(inst, "_zod", {
|
|
531
|
-
value: inst._zod ?? {},
|
|
532
|
-
enumerable: false
|
|
533
|
-
});
|
|
534
|
-
(_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
|
|
535
|
-
inst._zod.traits.add(name);
|
|
536
|
-
initializer$1(inst, def);
|
|
537
|
-
for (const k in _.prototype) if (!(k in inst)) Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
|
|
538
|
-
inst._zod.constr = _;
|
|
539
|
-
inst._zod.def = def;
|
|
540
|
-
}
|
|
541
|
-
const Parent = params?.Parent ?? Object;
|
|
542
|
-
class Definition extends Parent {}
|
|
543
|
-
Object.defineProperty(Definition, "name", { value: name });
|
|
544
|
-
function _(def) {
|
|
545
|
-
var _a;
|
|
546
|
-
const inst = params?.Parent ? new Definition() : this;
|
|
547
|
-
init(inst, def);
|
|
548
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
549
|
-
for (const fn of inst._zod.deferred) fn();
|
|
550
|
-
return inst;
|
|
551
|
-
}
|
|
552
|
-
Object.defineProperty(_, "init", { value: init });
|
|
553
|
-
Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
|
|
554
|
-
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
555
|
-
return inst?._zod?.traits?.has(name);
|
|
556
|
-
} });
|
|
557
|
-
Object.defineProperty(_, "name", { value: name });
|
|
558
|
-
return _;
|
|
559
|
-
}
|
|
560
|
-
var $ZodAsyncError = class extends Error {
|
|
561
|
-
constructor() {
|
|
562
|
-
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
const globalConfig = {};
|
|
566
|
-
function config(newConfig) {
|
|
567
|
-
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
568
|
-
return globalConfig;
|
|
569
|
-
}
|
|
570
|
-
function jsonStringifyReplacer(_, value) {
|
|
571
|
-
if (typeof value === "bigint") return value.toString();
|
|
572
|
-
return value;
|
|
573
|
-
}
|
|
574
|
-
function cached(getter) {
|
|
575
|
-
return { get value() {
|
|
576
|
-
{
|
|
577
|
-
const value = getter();
|
|
578
|
-
Object.defineProperty(this, "value", { value });
|
|
579
|
-
return value;
|
|
580
|
-
}
|
|
581
|
-
throw new Error("cached value already set");
|
|
582
|
-
} };
|
|
583
|
-
}
|
|
584
|
-
function cleanRegex(source) {
|
|
585
|
-
const start = source.startsWith("^") ? 1 : 0;
|
|
586
|
-
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
587
|
-
return source.slice(start, end);
|
|
588
|
-
}
|
|
589
|
-
const EVALUATING = Symbol("evaluating");
|
|
590
|
-
function defineLazy(object$1, key, getter) {
|
|
591
|
-
let value = void 0;
|
|
592
|
-
Object.defineProperty(object$1, key, {
|
|
593
|
-
get() {
|
|
594
|
-
if (value === EVALUATING) return;
|
|
595
|
-
if (value === void 0) {
|
|
596
|
-
value = EVALUATING;
|
|
597
|
-
value = getter();
|
|
598
|
-
}
|
|
599
|
-
return value;
|
|
600
|
-
},
|
|
601
|
-
set(v) {
|
|
602
|
-
Object.defineProperty(object$1, key, { value: v });
|
|
603
|
-
},
|
|
604
|
-
configurable: true
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
608
|
-
function isObject(data) {
|
|
609
|
-
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
610
|
-
}
|
|
611
|
-
cached(() => {
|
|
612
|
-
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
|
|
613
|
-
try {
|
|
614
|
-
new Function("");
|
|
615
|
-
return true;
|
|
616
|
-
} catch (_) {
|
|
617
|
-
return false;
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
function isPlainObject(o) {
|
|
621
|
-
if (isObject(o) === false) return false;
|
|
622
|
-
const ctor = o.constructor;
|
|
623
|
-
if (ctor === void 0) return true;
|
|
624
|
-
const prot = ctor.prototype;
|
|
625
|
-
if (isObject(prot) === false) return false;
|
|
626
|
-
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
627
|
-
return true;
|
|
628
|
-
}
|
|
629
|
-
const propertyKeyTypes = new Set([
|
|
630
|
-
"string",
|
|
631
|
-
"number",
|
|
632
|
-
"symbol"
|
|
633
|
-
]);
|
|
634
|
-
function escapeRegex(str) {
|
|
635
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
636
|
-
}
|
|
637
|
-
function clone(inst, def, params) {
|
|
638
|
-
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
639
|
-
if (!def || params?.parent) cl._zod.parent = inst;
|
|
640
|
-
return cl;
|
|
641
|
-
}
|
|
642
|
-
function normalizeParams(_params) {
|
|
643
|
-
const params = _params;
|
|
644
|
-
if (!params) return {};
|
|
645
|
-
if (typeof params === "string") return { error: () => params };
|
|
646
|
-
if (params?.message !== void 0) {
|
|
647
|
-
if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
|
|
648
|
-
params.error = params.message;
|
|
649
|
-
}
|
|
650
|
-
delete params.message;
|
|
651
|
-
if (typeof params.error === "string") return {
|
|
652
|
-
...params,
|
|
653
|
-
error: () => params.error
|
|
654
|
-
};
|
|
655
|
-
return params;
|
|
656
|
-
}
|
|
657
|
-
function optionalKeys(shape) {
|
|
658
|
-
return Object.keys(shape).filter((k) => {
|
|
659
|
-
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, -Number.MAX_VALUE, Number.MAX_VALUE;
|
|
663
|
-
function aborted(x, startIndex = 0) {
|
|
664
|
-
if (x.aborted === true) return true;
|
|
665
|
-
for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
|
|
666
|
-
return false;
|
|
667
|
-
}
|
|
668
|
-
function prefixIssues(path$1, issues) {
|
|
669
|
-
return issues.map((iss) => {
|
|
670
|
-
var _a;
|
|
671
|
-
(_a = iss).path ?? (_a.path = []);
|
|
672
|
-
iss.path.unshift(path$1);
|
|
673
|
-
return iss;
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
function unwrapMessage(message) {
|
|
677
|
-
return typeof message === "string" ? message : message?.message;
|
|
678
|
-
}
|
|
679
|
-
function finalizeIssue(iss, ctx, config$1) {
|
|
680
|
-
const full = {
|
|
681
|
-
...iss,
|
|
682
|
-
path: iss.path ?? []
|
|
683
|
-
};
|
|
684
|
-
if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1.customError?.(iss)) ?? unwrapMessage(config$1.localeError?.(iss)) ?? "Invalid input";
|
|
685
|
-
delete full.inst;
|
|
686
|
-
delete full.continue;
|
|
687
|
-
if (!ctx?.reportInput) delete full.input;
|
|
688
|
-
return full;
|
|
689
|
-
}
|
|
690
|
-
const initializer = (inst, def) => {
|
|
691
|
-
inst.name = "$ZodError";
|
|
692
|
-
Object.defineProperty(inst, "_zod", {
|
|
693
|
-
value: inst._zod,
|
|
694
|
-
enumerable: false
|
|
695
|
-
});
|
|
696
|
-
Object.defineProperty(inst, "issues", {
|
|
697
|
-
value: def,
|
|
698
|
-
enumerable: false
|
|
699
|
-
});
|
|
700
|
-
inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
|
|
701
|
-
Object.defineProperty(inst, "toString", {
|
|
702
|
-
value: () => inst.message,
|
|
703
|
-
enumerable: false
|
|
704
|
-
});
|
|
705
|
-
};
|
|
706
|
-
const $ZodError = $constructor("$ZodError", initializer);
|
|
707
|
-
const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
|
|
708
|
-
const _parse = (_Err) => (schema$1, value, _ctx, _params) => {
|
|
709
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
710
|
-
const result = schema$1._zod.run({
|
|
711
|
-
value,
|
|
712
|
-
issues: []
|
|
713
|
-
}, ctx);
|
|
714
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
715
|
-
if (result.issues.length) {
|
|
716
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
717
|
-
captureStackTrace(e, _params?.callee);
|
|
718
|
-
throw e;
|
|
719
|
-
}
|
|
720
|
-
return result.value;
|
|
721
|
-
};
|
|
722
|
-
const parse$1 = /* @__PURE__ */ _parse($ZodRealError);
|
|
723
|
-
const _parseAsync = (_Err) => async (schema$1, value, _ctx, params) => {
|
|
724
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
725
|
-
let result = schema$1._zod.run({
|
|
726
|
-
value,
|
|
727
|
-
issues: []
|
|
728
|
-
}, ctx);
|
|
729
|
-
if (result instanceof Promise) result = await result;
|
|
730
|
-
if (result.issues.length) {
|
|
731
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
732
|
-
captureStackTrace(e, params?.callee);
|
|
733
|
-
throw e;
|
|
734
|
-
}
|
|
735
|
-
return result.value;
|
|
736
|
-
};
|
|
737
|
-
const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
738
|
-
const _safeParse = (_Err) => (schema$1, value, _ctx) => {
|
|
739
|
-
const ctx = _ctx ? {
|
|
740
|
-
..._ctx,
|
|
741
|
-
async: false
|
|
742
|
-
} : { async: false };
|
|
743
|
-
const result = schema$1._zod.run({
|
|
744
|
-
value,
|
|
745
|
-
issues: []
|
|
746
|
-
}, ctx);
|
|
747
|
-
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
748
|
-
return result.issues.length ? {
|
|
749
|
-
success: false,
|
|
750
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
751
|
-
} : {
|
|
752
|
-
success: true,
|
|
753
|
-
data: result.value
|
|
754
|
-
};
|
|
755
|
-
};
|
|
756
|
-
const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
757
|
-
const _safeParseAsync = (_Err) => async (schema$1, value, _ctx) => {
|
|
758
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
759
|
-
let result = schema$1._zod.run({
|
|
760
|
-
value,
|
|
761
|
-
issues: []
|
|
762
|
-
}, ctx);
|
|
763
|
-
if (result instanceof Promise) result = await result;
|
|
764
|
-
return result.issues.length ? {
|
|
765
|
-
success: false,
|
|
766
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
767
|
-
} : {
|
|
768
|
-
success: true,
|
|
769
|
-
data: result.value
|
|
770
|
-
};
|
|
771
|
-
};
|
|
772
|
-
const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
773
|
-
const string$1 = (params) => {
|
|
774
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
775
|
-
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
776
|
-
};
|
|
777
|
-
const bigint$1 = /^-?\d+n?$/;
|
|
778
|
-
const number$1 = /^-?\d+(?:\.\d+)?/;
|
|
779
|
-
const boolean$1 = /^(?:true|false)$/i;
|
|
780
|
-
const _null$2 = /^null$/i;
|
|
781
|
-
const _undefined$2 = /^undefined$/i;
|
|
782
|
-
const version = {
|
|
783
|
-
major: 4,
|
|
784
|
-
minor: 1,
|
|
785
|
-
patch: 11
|
|
786
|
-
};
|
|
787
|
-
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
788
|
-
var _a;
|
|
789
|
-
inst ?? (inst = {});
|
|
790
|
-
inst._zod.def = def;
|
|
791
|
-
inst._zod.bag = inst._zod.bag || {};
|
|
792
|
-
inst._zod.version = version;
|
|
793
|
-
const checks = [...inst._zod.def.checks ?? []];
|
|
794
|
-
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
795
|
-
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
796
|
-
if (checks.length === 0) {
|
|
797
|
-
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
798
|
-
inst._zod.deferred?.push(() => {
|
|
799
|
-
inst._zod.run = inst._zod.parse;
|
|
800
|
-
});
|
|
801
|
-
} else {
|
|
802
|
-
const runChecks = (payload, checks$1, ctx) => {
|
|
803
|
-
let isAborted = aborted(payload);
|
|
804
|
-
let asyncResult;
|
|
805
|
-
for (const ch of checks$1) {
|
|
806
|
-
if (ch._zod.def.when) {
|
|
807
|
-
if (!ch._zod.def.when(payload)) continue;
|
|
808
|
-
} else if (isAborted) continue;
|
|
809
|
-
const currLen = payload.issues.length;
|
|
810
|
-
const _ = ch._zod.check(payload);
|
|
811
|
-
if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
|
|
812
|
-
if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
813
|
-
await _;
|
|
814
|
-
if (payload.issues.length === currLen) return;
|
|
815
|
-
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
816
|
-
});
|
|
817
|
-
else {
|
|
818
|
-
if (payload.issues.length === currLen) continue;
|
|
819
|
-
if (!isAborted) isAborted = aborted(payload, currLen);
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
if (asyncResult) return asyncResult.then(() => {
|
|
823
|
-
return payload;
|
|
824
|
-
});
|
|
825
|
-
return payload;
|
|
826
|
-
};
|
|
827
|
-
const handleCanaryResult = (canary, payload, ctx) => {
|
|
828
|
-
if (aborted(canary)) {
|
|
829
|
-
canary.aborted = true;
|
|
830
|
-
return canary;
|
|
831
|
-
}
|
|
832
|
-
const checkResult = runChecks(payload, checks, ctx);
|
|
833
|
-
if (checkResult instanceof Promise) {
|
|
834
|
-
if (ctx.async === false) throw new $ZodAsyncError();
|
|
835
|
-
return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx));
|
|
836
|
-
}
|
|
837
|
-
return inst._zod.parse(checkResult, ctx);
|
|
838
|
-
};
|
|
839
|
-
inst._zod.run = (payload, ctx) => {
|
|
840
|
-
if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
|
|
841
|
-
if (ctx.direction === "backward") {
|
|
842
|
-
const canary = inst._zod.parse({
|
|
843
|
-
value: payload.value,
|
|
844
|
-
issues: []
|
|
845
|
-
}, {
|
|
846
|
-
...ctx,
|
|
847
|
-
skipChecks: true
|
|
848
|
-
});
|
|
849
|
-
if (canary instanceof Promise) return canary.then((canary$1) => {
|
|
850
|
-
return handleCanaryResult(canary$1, payload, ctx);
|
|
851
|
-
});
|
|
852
|
-
return handleCanaryResult(canary, payload, ctx);
|
|
853
|
-
}
|
|
854
|
-
const result = inst._zod.parse(payload, ctx);
|
|
855
|
-
if (result instanceof Promise) {
|
|
856
|
-
if (ctx.async === false) throw new $ZodAsyncError();
|
|
857
|
-
return result.then((result$1) => runChecks(result$1, checks, ctx));
|
|
858
|
-
}
|
|
859
|
-
return runChecks(result, checks, ctx);
|
|
860
|
-
};
|
|
861
|
-
}
|
|
862
|
-
inst["~standard"] = {
|
|
863
|
-
validate: (value) => {
|
|
864
|
-
try {
|
|
865
|
-
const r = safeParse(inst, value);
|
|
866
|
-
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
867
|
-
} catch (_) {
|
|
868
|
-
return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
869
|
-
}
|
|
870
|
-
},
|
|
871
|
-
vendor: "zod",
|
|
872
|
-
version: 1
|
|
873
|
-
};
|
|
874
|
-
});
|
|
875
|
-
const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
876
|
-
$ZodType.init(inst, def);
|
|
877
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
|
|
878
|
-
inst._zod.parse = (payload, _) => {
|
|
879
|
-
if (def.coerce) try {
|
|
880
|
-
payload.value = String(payload.value);
|
|
881
|
-
} catch (_$1) {}
|
|
882
|
-
if (typeof payload.value === "string") return payload;
|
|
883
|
-
payload.issues.push({
|
|
884
|
-
expected: "string",
|
|
885
|
-
code: "invalid_type",
|
|
886
|
-
input: payload.value,
|
|
887
|
-
inst
|
|
888
|
-
});
|
|
889
|
-
return payload;
|
|
890
|
-
};
|
|
891
|
-
});
|
|
892
|
-
const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
893
|
-
$ZodType.init(inst, def);
|
|
894
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
|
|
895
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
896
|
-
if (def.coerce) try {
|
|
897
|
-
payload.value = Number(payload.value);
|
|
898
|
-
} catch (_) {}
|
|
899
|
-
const input = payload.value;
|
|
900
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
901
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
902
|
-
payload.issues.push({
|
|
903
|
-
expected: "number",
|
|
904
|
-
code: "invalid_type",
|
|
905
|
-
input,
|
|
906
|
-
inst,
|
|
907
|
-
...received ? { received } : {}
|
|
908
|
-
});
|
|
909
|
-
return payload;
|
|
910
|
-
};
|
|
911
|
-
});
|
|
912
|
-
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
913
|
-
$ZodType.init(inst, def);
|
|
914
|
-
inst._zod.pattern = boolean$1;
|
|
915
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
916
|
-
if (def.coerce) try {
|
|
917
|
-
payload.value = Boolean(payload.value);
|
|
918
|
-
} catch (_) {}
|
|
919
|
-
const input = payload.value;
|
|
920
|
-
if (typeof input === "boolean") return payload;
|
|
921
|
-
payload.issues.push({
|
|
922
|
-
expected: "boolean",
|
|
923
|
-
code: "invalid_type",
|
|
924
|
-
input,
|
|
925
|
-
inst
|
|
926
|
-
});
|
|
927
|
-
return payload;
|
|
928
|
-
};
|
|
929
|
-
});
|
|
930
|
-
const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
|
|
931
|
-
$ZodType.init(inst, def);
|
|
932
|
-
inst._zod.pattern = bigint$1;
|
|
933
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
934
|
-
if (def.coerce) try {
|
|
935
|
-
payload.value = BigInt(payload.value);
|
|
936
|
-
} catch (_) {}
|
|
937
|
-
if (typeof payload.value === "bigint") return payload;
|
|
938
|
-
payload.issues.push({
|
|
939
|
-
expected: "bigint",
|
|
940
|
-
code: "invalid_type",
|
|
941
|
-
input: payload.value,
|
|
942
|
-
inst
|
|
943
|
-
});
|
|
944
|
-
return payload;
|
|
945
|
-
};
|
|
946
|
-
});
|
|
947
|
-
const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) => {
|
|
948
|
-
$ZodType.init(inst, def);
|
|
949
|
-
inst._zod.pattern = _undefined$2;
|
|
950
|
-
inst._zod.values = new Set([void 0]);
|
|
951
|
-
inst._zod.optin = "optional";
|
|
952
|
-
inst._zod.optout = "optional";
|
|
953
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
954
|
-
const input = payload.value;
|
|
955
|
-
if (typeof input === "undefined") return payload;
|
|
956
|
-
payload.issues.push({
|
|
957
|
-
expected: "undefined",
|
|
958
|
-
code: "invalid_type",
|
|
959
|
-
input,
|
|
960
|
-
inst
|
|
961
|
-
});
|
|
962
|
-
return payload;
|
|
963
|
-
};
|
|
964
|
-
});
|
|
965
|
-
const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
966
|
-
$ZodType.init(inst, def);
|
|
967
|
-
inst._zod.pattern = _null$2;
|
|
968
|
-
inst._zod.values = new Set([null]);
|
|
969
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
970
|
-
const input = payload.value;
|
|
971
|
-
if (input === null) return payload;
|
|
972
|
-
payload.issues.push({
|
|
973
|
-
expected: "null",
|
|
974
|
-
code: "invalid_type",
|
|
975
|
-
input,
|
|
976
|
-
inst
|
|
977
|
-
});
|
|
978
|
-
return payload;
|
|
979
|
-
};
|
|
980
|
-
});
|
|
981
|
-
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
982
|
-
$ZodType.init(inst, def);
|
|
983
|
-
inst._zod.parse = (payload) => payload;
|
|
984
|
-
});
|
|
985
|
-
const $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
986
|
-
$ZodType.init(inst, def);
|
|
987
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
988
|
-
if (def.coerce) try {
|
|
989
|
-
payload.value = new Date(payload.value);
|
|
990
|
-
} catch (_err) {}
|
|
991
|
-
const input = payload.value;
|
|
992
|
-
const isDate = input instanceof Date;
|
|
993
|
-
if (isDate && !Number.isNaN(input.getTime())) return payload;
|
|
994
|
-
payload.issues.push({
|
|
995
|
-
expected: "date",
|
|
996
|
-
code: "invalid_type",
|
|
997
|
-
input,
|
|
998
|
-
...isDate ? { received: "Invalid Date" } : {},
|
|
999
|
-
inst
|
|
1000
|
-
});
|
|
1001
|
-
return payload;
|
|
1002
|
-
};
|
|
1003
|
-
});
|
|
1004
|
-
function handleArrayResult(result, final, index) {
|
|
1005
|
-
if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
|
|
1006
|
-
final.value[index] = result.value;
|
|
1007
|
-
}
|
|
1008
|
-
const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
1009
|
-
$ZodType.init(inst, def);
|
|
1010
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1011
|
-
const input = payload.value;
|
|
1012
|
-
if (!Array.isArray(input)) {
|
|
1013
|
-
payload.issues.push({
|
|
1014
|
-
expected: "array",
|
|
1015
|
-
code: "invalid_type",
|
|
1016
|
-
input,
|
|
1017
|
-
inst
|
|
1018
|
-
});
|
|
1019
|
-
return payload;
|
|
1020
|
-
}
|
|
1021
|
-
payload.value = Array(input.length);
|
|
1022
|
-
const proms = [];
|
|
1023
|
-
for (let i = 0; i < input.length; i++) {
|
|
1024
|
-
const item = input[i];
|
|
1025
|
-
const result = def.element._zod.run({
|
|
1026
|
-
value: item,
|
|
1027
|
-
issues: []
|
|
1028
|
-
}, ctx);
|
|
1029
|
-
if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult(result$1, payload, i)));
|
|
1030
|
-
else handleArrayResult(result, payload, i);
|
|
1031
|
-
}
|
|
1032
|
-
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1033
|
-
return payload;
|
|
1034
|
-
};
|
|
1035
|
-
});
|
|
1036
|
-
function handlePropertyResult(result, final, key, input) {
|
|
1037
|
-
if (result.issues.length) final.issues.push(...prefixIssues(key, result.issues));
|
|
1038
|
-
if (result.value === void 0) {
|
|
1039
|
-
if (key in input) final.value[key] = void 0;
|
|
1040
|
-
} else final.value[key] = result.value;
|
|
1041
|
-
}
|
|
1042
|
-
function normalizeDef(def) {
|
|
1043
|
-
const keys = Object.keys(def.shape);
|
|
1044
|
-
for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
|
|
1045
|
-
const okeys = optionalKeys(def.shape);
|
|
1046
|
-
return {
|
|
1047
|
-
...def,
|
|
1048
|
-
keys,
|
|
1049
|
-
keySet: new Set(keys),
|
|
1050
|
-
numKeys: keys.length,
|
|
1051
|
-
optionalKeys: new Set(okeys)
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1055
|
-
const unrecognized = [];
|
|
1056
|
-
const keySet = def.keySet;
|
|
1057
|
-
const _catchall = def.catchall._zod;
|
|
1058
|
-
const t = _catchall.def.type;
|
|
1059
|
-
for (const key of Object.keys(input)) {
|
|
1060
|
-
if (keySet.has(key)) continue;
|
|
1061
|
-
if (t === "never") {
|
|
1062
|
-
unrecognized.push(key);
|
|
1063
|
-
continue;
|
|
1064
|
-
}
|
|
1065
|
-
const r = _catchall.run({
|
|
1066
|
-
value: input[key],
|
|
1067
|
-
issues: []
|
|
1068
|
-
}, ctx);
|
|
1069
|
-
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
|
|
1070
|
-
else handlePropertyResult(r, payload, key, input);
|
|
1071
|
-
}
|
|
1072
|
-
if (unrecognized.length) payload.issues.push({
|
|
1073
|
-
code: "unrecognized_keys",
|
|
1074
|
-
keys: unrecognized,
|
|
1075
|
-
input,
|
|
1076
|
-
inst
|
|
1077
|
-
});
|
|
1078
|
-
if (!proms.length) return payload;
|
|
1079
|
-
return Promise.all(proms).then(() => {
|
|
1080
|
-
return payload;
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
1084
|
-
$ZodType.init(inst, def);
|
|
1085
|
-
if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
|
|
1086
|
-
const sh = def.shape;
|
|
1087
|
-
Object.defineProperty(def, "shape", { get: () => {
|
|
1088
|
-
const newSh = { ...sh };
|
|
1089
|
-
Object.defineProperty(def, "shape", { value: newSh });
|
|
1090
|
-
return newSh;
|
|
1091
|
-
} });
|
|
1092
|
-
}
|
|
1093
|
-
const _normalized = cached(() => normalizeDef(def));
|
|
1094
|
-
defineLazy(inst._zod, "propValues", () => {
|
|
1095
|
-
const shape = def.shape;
|
|
1096
|
-
const propValues = {};
|
|
1097
|
-
for (const key in shape) {
|
|
1098
|
-
const field = shape[key]._zod;
|
|
1099
|
-
if (field.values) {
|
|
1100
|
-
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
1101
|
-
for (const v of field.values) propValues[key].add(v);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
return propValues;
|
|
1105
|
-
});
|
|
1106
|
-
const isObject$1 = isObject;
|
|
1107
|
-
const catchall = def.catchall;
|
|
1108
|
-
let value;
|
|
1109
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1110
|
-
value ?? (value = _normalized.value);
|
|
1111
|
-
const input = payload.value;
|
|
1112
|
-
if (!isObject$1(input)) {
|
|
1113
|
-
payload.issues.push({
|
|
1114
|
-
expected: "object",
|
|
1115
|
-
code: "invalid_type",
|
|
1116
|
-
input,
|
|
1117
|
-
inst
|
|
1118
|
-
});
|
|
1119
|
-
return payload;
|
|
1120
|
-
}
|
|
1121
|
-
payload.value = {};
|
|
1122
|
-
const proms = [];
|
|
1123
|
-
const shape = value.shape;
|
|
1124
|
-
for (const key of value.keys) {
|
|
1125
|
-
const r = shape[key]._zod.run({
|
|
1126
|
-
value: input[key],
|
|
1127
|
-
issues: []
|
|
1128
|
-
}, ctx);
|
|
1129
|
-
if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input)));
|
|
1130
|
-
else handlePropertyResult(r, payload, key, input);
|
|
1131
|
-
}
|
|
1132
|
-
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1133
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
1134
|
-
};
|
|
1135
|
-
});
|
|
1136
|
-
function handleUnionResults(results, final, inst, ctx) {
|
|
1137
|
-
for (const result of results) if (result.issues.length === 0) {
|
|
1138
|
-
final.value = result.value;
|
|
1139
|
-
return final;
|
|
1140
|
-
}
|
|
1141
|
-
const nonaborted = results.filter((r) => !aborted(r));
|
|
1142
|
-
if (nonaborted.length === 1) {
|
|
1143
|
-
final.value = nonaborted[0].value;
|
|
1144
|
-
return nonaborted[0];
|
|
1145
|
-
}
|
|
1146
|
-
final.issues.push({
|
|
1147
|
-
code: "invalid_union",
|
|
1148
|
-
input: final.value,
|
|
1149
|
-
inst,
|
|
1150
|
-
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
1151
|
-
});
|
|
1152
|
-
return final;
|
|
1153
|
-
}
|
|
1154
|
-
const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
|
|
1155
|
-
$ZodType.init(inst, def);
|
|
1156
|
-
defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
|
|
1157
|
-
defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
|
|
1158
|
-
defineLazy(inst._zod, "values", () => {
|
|
1159
|
-
if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
|
|
1160
|
-
});
|
|
1161
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1162
|
-
if (def.options.every((o) => o._zod.pattern)) {
|
|
1163
|
-
const patterns = def.options.map((o) => o._zod.pattern);
|
|
1164
|
-
return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
const single = def.options.length === 1;
|
|
1168
|
-
const first = def.options[0]._zod.run;
|
|
1169
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1170
|
-
if (single) return first(payload, ctx);
|
|
1171
|
-
let async = false;
|
|
1172
|
-
const results = [];
|
|
1173
|
-
for (const option of def.options) {
|
|
1174
|
-
const result = option._zod.run({
|
|
1175
|
-
value: payload.value,
|
|
1176
|
-
issues: []
|
|
1177
|
-
}, ctx);
|
|
1178
|
-
if (result instanceof Promise) {
|
|
1179
|
-
results.push(result);
|
|
1180
|
-
async = true;
|
|
1181
|
-
} else {
|
|
1182
|
-
if (result.issues.length === 0) return result;
|
|
1183
|
-
results.push(result);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
if (!async) return handleUnionResults(results, payload, inst, ctx);
|
|
1187
|
-
return Promise.all(results).then((results$1) => {
|
|
1188
|
-
return handleUnionResults(results$1, payload, inst, ctx);
|
|
1189
|
-
});
|
|
1190
|
-
};
|
|
1191
|
-
});
|
|
1192
|
-
const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
1193
|
-
$ZodType.init(inst, def);
|
|
1194
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1195
|
-
const input = payload.value;
|
|
1196
|
-
if (!isPlainObject(input)) {
|
|
1197
|
-
payload.issues.push({
|
|
1198
|
-
expected: "record",
|
|
1199
|
-
code: "invalid_type",
|
|
1200
|
-
input,
|
|
1201
|
-
inst
|
|
1202
|
-
});
|
|
1203
|
-
return payload;
|
|
1204
|
-
}
|
|
1205
|
-
const proms = [];
|
|
1206
|
-
if (def.keyType._zod.values) {
|
|
1207
|
-
const values = def.keyType._zod.values;
|
|
1208
|
-
payload.value = {};
|
|
1209
|
-
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
1210
|
-
const result = def.valueType._zod.run({
|
|
1211
|
-
value: input[key],
|
|
1212
|
-
issues: []
|
|
1213
|
-
}, ctx);
|
|
1214
|
-
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
1215
|
-
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
1216
|
-
payload.value[key] = result$1.value;
|
|
1217
|
-
}));
|
|
1218
|
-
else {
|
|
1219
|
-
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
1220
|
-
payload.value[key] = result.value;
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
let unrecognized;
|
|
1224
|
-
for (const key in input) if (!values.has(key)) {
|
|
1225
|
-
unrecognized = unrecognized ?? [];
|
|
1226
|
-
unrecognized.push(key);
|
|
1227
|
-
}
|
|
1228
|
-
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
1229
|
-
code: "unrecognized_keys",
|
|
1230
|
-
input,
|
|
1231
|
-
inst,
|
|
1232
|
-
keys: unrecognized
|
|
1233
|
-
});
|
|
1234
|
-
} else {
|
|
1235
|
-
payload.value = {};
|
|
1236
|
-
for (const key of Reflect.ownKeys(input)) {
|
|
1237
|
-
if (key === "__proto__") continue;
|
|
1238
|
-
const keyResult = def.keyType._zod.run({
|
|
1239
|
-
value: key,
|
|
1240
|
-
issues: []
|
|
1241
|
-
}, ctx);
|
|
1242
|
-
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
1243
|
-
if (keyResult.issues.length) {
|
|
1244
|
-
payload.issues.push({
|
|
1245
|
-
code: "invalid_key",
|
|
1246
|
-
origin: "record",
|
|
1247
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
1248
|
-
input: key,
|
|
1249
|
-
path: [key],
|
|
1250
|
-
inst
|
|
1251
|
-
});
|
|
1252
|
-
payload.value[keyResult.value] = keyResult.value;
|
|
1253
|
-
continue;
|
|
1254
|
-
}
|
|
1255
|
-
const result = def.valueType._zod.run({
|
|
1256
|
-
value: input[key],
|
|
1257
|
-
issues: []
|
|
1258
|
-
}, ctx);
|
|
1259
|
-
if (result instanceof Promise) proms.push(result.then((result$1) => {
|
|
1260
|
-
if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
|
|
1261
|
-
payload.value[keyResult.value] = result$1.value;
|
|
1262
|
-
}));
|
|
1263
|
-
else {
|
|
1264
|
-
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
1265
|
-
payload.value[keyResult.value] = result.value;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1270
|
-
return payload;
|
|
1271
|
-
};
|
|
1272
|
-
});
|
|
1273
|
-
const $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
1274
|
-
$ZodType.init(inst, def);
|
|
1275
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1276
|
-
const input = payload.value;
|
|
1277
|
-
if (!(input instanceof Map)) {
|
|
1278
|
-
payload.issues.push({
|
|
1279
|
-
expected: "map",
|
|
1280
|
-
code: "invalid_type",
|
|
1281
|
-
input,
|
|
1282
|
-
inst
|
|
1283
|
-
});
|
|
1284
|
-
return payload;
|
|
1285
|
-
}
|
|
1286
|
-
const proms = [];
|
|
1287
|
-
payload.value = /* @__PURE__ */ new Map();
|
|
1288
|
-
for (const [key, value] of input) {
|
|
1289
|
-
const keyResult = def.keyType._zod.run({
|
|
1290
|
-
value: key,
|
|
1291
|
-
issues: []
|
|
1292
|
-
}, ctx);
|
|
1293
|
-
const valueResult = def.valueType._zod.run({
|
|
1294
|
-
value,
|
|
1295
|
-
issues: []
|
|
1296
|
-
}, ctx);
|
|
1297
|
-
if (keyResult instanceof Promise || valueResult instanceof Promise) proms.push(Promise.all([keyResult, valueResult]).then(([keyResult$1, valueResult$1]) => {
|
|
1298
|
-
handleMapResult(keyResult$1, valueResult$1, payload, key, input, inst, ctx);
|
|
1299
|
-
}));
|
|
1300
|
-
else handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
|
|
1301
|
-
}
|
|
1302
|
-
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1303
|
-
return payload;
|
|
1304
|
-
};
|
|
1305
|
-
});
|
|
1306
|
-
function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
1307
|
-
if (keyResult.issues.length) if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
1308
|
-
else final.issues.push({
|
|
1309
|
-
code: "invalid_key",
|
|
1310
|
-
origin: "map",
|
|
1311
|
-
input,
|
|
1312
|
-
inst,
|
|
1313
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
1314
|
-
});
|
|
1315
|
-
if (valueResult.issues.length) if (propertyKeyTypes.has(typeof key)) final.issues.push(...prefixIssues(key, valueResult.issues));
|
|
1316
|
-
else final.issues.push({
|
|
1317
|
-
origin: "map",
|
|
1318
|
-
code: "invalid_element",
|
|
1319
|
-
input,
|
|
1320
|
-
inst,
|
|
1321
|
-
key,
|
|
1322
|
-
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
1323
|
-
});
|
|
1324
|
-
final.value.set(keyResult.value, valueResult.value);
|
|
1325
|
-
}
|
|
1326
|
-
const $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
1327
|
-
$ZodType.init(inst, def);
|
|
1328
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1329
|
-
const input = payload.value;
|
|
1330
|
-
if (!(input instanceof Set)) {
|
|
1331
|
-
payload.issues.push({
|
|
1332
|
-
input,
|
|
1333
|
-
inst,
|
|
1334
|
-
expected: "set",
|
|
1335
|
-
code: "invalid_type"
|
|
1336
|
-
});
|
|
1337
|
-
return payload;
|
|
1338
|
-
}
|
|
1339
|
-
const proms = [];
|
|
1340
|
-
payload.value = /* @__PURE__ */ new Set();
|
|
1341
|
-
for (const item of input) {
|
|
1342
|
-
const result = def.valueType._zod.run({
|
|
1343
|
-
value: item,
|
|
1344
|
-
issues: []
|
|
1345
|
-
}, ctx);
|
|
1346
|
-
if (result instanceof Promise) proms.push(result.then((result$1) => handleSetResult(result$1, payload)));
|
|
1347
|
-
else handleSetResult(result, payload);
|
|
1348
|
-
}
|
|
1349
|
-
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1350
|
-
return payload;
|
|
1351
|
-
};
|
|
1352
|
-
});
|
|
1353
|
-
function handleSetResult(result, final) {
|
|
1354
|
-
if (result.issues.length) final.issues.push(...result.issues);
|
|
1355
|
-
final.value.add(result.value);
|
|
1356
|
-
}
|
|
1357
|
-
const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
1358
|
-
$ZodType.init(inst, def);
|
|
1359
|
-
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
1360
|
-
inst._zod.values = new Set(def.values);
|
|
1361
|
-
inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
1362
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
1363
|
-
const input = payload.value;
|
|
1364
|
-
if (inst._zod.values.has(input)) return payload;
|
|
1365
|
-
payload.issues.push({
|
|
1366
|
-
code: "invalid_value",
|
|
1367
|
-
values: def.values,
|
|
1368
|
-
input,
|
|
1369
|
-
inst
|
|
1370
|
-
});
|
|
1371
|
-
return payload;
|
|
1372
|
-
};
|
|
1373
|
-
});
|
|
1374
|
-
function handleOptionalResult(result, input) {
|
|
1375
|
-
if (result.issues.length && input === void 0) return {
|
|
1376
|
-
issues: [],
|
|
1377
|
-
value: void 0
|
|
1378
|
-
};
|
|
1379
|
-
return result;
|
|
1380
|
-
}
|
|
1381
|
-
const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
1382
|
-
$ZodType.init(inst, def);
|
|
1383
|
-
inst._zod.optin = "optional";
|
|
1384
|
-
inst._zod.optout = "optional";
|
|
1385
|
-
defineLazy(inst._zod, "values", () => {
|
|
1386
|
-
return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
|
|
1387
|
-
});
|
|
1388
|
-
defineLazy(inst._zod, "pattern", () => {
|
|
1389
|
-
const pattern = def.innerType._zod.pattern;
|
|
1390
|
-
return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
|
|
1391
|
-
});
|
|
1392
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1393
|
-
if (def.innerType._zod.optin === "optional") {
|
|
1394
|
-
const result = def.innerType._zod.run(payload, ctx);
|
|
1395
|
-
if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
|
|
1396
|
-
return handleOptionalResult(result, payload.value);
|
|
1397
|
-
}
|
|
1398
|
-
if (payload.value === void 0) return payload;
|
|
1399
|
-
return def.innerType._zod.run(payload, ctx);
|
|
1400
|
-
};
|
|
1401
|
-
});
|
|
1402
|
-
const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
1403
|
-
$ZodType.init(inst, def);
|
|
1404
|
-
defineLazy(inst._zod, "innerType", () => def.getter());
|
|
1405
|
-
defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
|
|
1406
|
-
defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
|
|
1407
|
-
defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? void 0);
|
|
1408
|
-
defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? void 0);
|
|
1409
|
-
inst._zod.parse = (payload, ctx) => {
|
|
1410
|
-
return inst._zod.innerType._zod.run(payload, ctx);
|
|
1411
|
-
};
|
|
1412
|
-
});
|
|
1413
|
-
function _string(Class, params) {
|
|
1414
|
-
return new Class({
|
|
1415
|
-
type: "string",
|
|
1416
|
-
...normalizeParams(params)
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
function _number(Class, params) {
|
|
1420
|
-
return new Class({
|
|
1421
|
-
type: "number",
|
|
1422
|
-
checks: [],
|
|
1423
|
-
...normalizeParams(params)
|
|
1424
|
-
});
|
|
1425
|
-
}
|
|
1426
|
-
function _boolean(Class, params) {
|
|
1427
|
-
return new Class({
|
|
1428
|
-
type: "boolean",
|
|
1429
|
-
...normalizeParams(params)
|
|
1430
|
-
});
|
|
1431
|
-
}
|
|
1432
|
-
function _bigint(Class, params) {
|
|
1433
|
-
return new Class({
|
|
1434
|
-
type: "bigint",
|
|
1435
|
-
...normalizeParams(params)
|
|
1436
|
-
});
|
|
1437
|
-
}
|
|
1438
|
-
function _undefined$1(Class, params) {
|
|
1439
|
-
return new Class({
|
|
1440
|
-
type: "undefined",
|
|
1441
|
-
...normalizeParams(params)
|
|
1442
|
-
});
|
|
1443
|
-
}
|
|
1444
|
-
function _null$1(Class, params) {
|
|
1445
|
-
return new Class({
|
|
1446
|
-
type: "null",
|
|
1447
|
-
...normalizeParams(params)
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
function _unknown(Class) {
|
|
1451
|
-
return new Class({ type: "unknown" });
|
|
1452
|
-
}
|
|
1453
|
-
function _date(Class, params) {
|
|
1454
|
-
return new Class({
|
|
1455
|
-
type: "date",
|
|
1456
|
-
...normalizeParams(params)
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
1460
|
-
if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
|
|
1461
|
-
$ZodType.init(inst, def);
|
|
1462
|
-
inst.def = def;
|
|
1463
|
-
inst.type = def.type;
|
|
1464
|
-
inst.parse = (data, params) => parse$1(inst, data, params, { callee: inst.parse });
|
|
1465
|
-
inst.safeParse = (data, params) => safeParse(inst, data, params);
|
|
1466
|
-
inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
|
|
1467
|
-
inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
|
|
1468
|
-
inst.check = (...checks) => {
|
|
1469
|
-
return inst.clone({
|
|
1470
|
-
...def,
|
|
1471
|
-
checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
|
|
1472
|
-
check: ch,
|
|
1473
|
-
def: { check: "custom" },
|
|
1474
|
-
onattach: []
|
|
1475
|
-
} } : ch)]
|
|
1476
|
-
});
|
|
1477
|
-
};
|
|
1478
|
-
inst.clone = (_def, params) => clone(inst, _def, params);
|
|
1479
|
-
inst.brand = () => inst;
|
|
1480
|
-
inst.register = ((reg, meta) => {
|
|
1481
|
-
reg.add(inst, meta);
|
|
1482
|
-
return inst;
|
|
1483
|
-
});
|
|
1484
|
-
});
|
|
1485
|
-
const ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
|
|
1486
|
-
$ZodString.init(inst, def);
|
|
1487
|
-
ZodMiniType.init(inst, def);
|
|
1488
|
-
});
|
|
1489
|
-
function string(params) {
|
|
1490
|
-
return _string(ZodMiniString, params);
|
|
1491
|
-
}
|
|
1492
|
-
const ZodMiniNumber = /* @__PURE__ */ $constructor("ZodMiniNumber", (inst, def) => {
|
|
1493
|
-
$ZodNumber.init(inst, def);
|
|
1494
|
-
ZodMiniType.init(inst, def);
|
|
1495
|
-
});
|
|
1496
|
-
function number(params) {
|
|
1497
|
-
return _number(ZodMiniNumber, params);
|
|
1498
|
-
}
|
|
1499
|
-
const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
|
|
1500
|
-
$ZodBoolean.init(inst, def);
|
|
1501
|
-
ZodMiniType.init(inst, def);
|
|
1502
|
-
});
|
|
1503
|
-
function boolean(params) {
|
|
1504
|
-
return _boolean(ZodMiniBoolean, params);
|
|
1505
|
-
}
|
|
1506
|
-
const ZodMiniBigInt = /* @__PURE__ */ $constructor("ZodMiniBigInt", (inst, def) => {
|
|
1507
|
-
$ZodBigInt.init(inst, def);
|
|
1508
|
-
ZodMiniType.init(inst, def);
|
|
1509
|
-
});
|
|
1510
|
-
function bigint(params) {
|
|
1511
|
-
return _bigint(ZodMiniBigInt, params);
|
|
1512
|
-
}
|
|
1513
|
-
const ZodMiniUndefined = /* @__PURE__ */ $constructor("ZodMiniUndefined", (inst, def) => {
|
|
1514
|
-
$ZodUndefined.init(inst, def);
|
|
1515
|
-
ZodMiniType.init(inst, def);
|
|
1516
|
-
});
|
|
1517
|
-
function _undefined(params) {
|
|
1518
|
-
return _undefined$1(ZodMiniUndefined, params);
|
|
1519
|
-
}
|
|
1520
|
-
const ZodMiniNull = /* @__PURE__ */ $constructor("ZodMiniNull", (inst, def) => {
|
|
1521
|
-
$ZodNull.init(inst, def);
|
|
1522
|
-
ZodMiniType.init(inst, def);
|
|
1523
|
-
});
|
|
1524
|
-
function _null(params) {
|
|
1525
|
-
return _null$1(ZodMiniNull, params);
|
|
1526
|
-
}
|
|
1527
|
-
const ZodMiniUnknown = /* @__PURE__ */ $constructor("ZodMiniUnknown", (inst, def) => {
|
|
1528
|
-
$ZodUnknown.init(inst, def);
|
|
1529
|
-
ZodMiniType.init(inst, def);
|
|
1530
|
-
});
|
|
1531
|
-
function unknown() {
|
|
1532
|
-
return _unknown(ZodMiniUnknown);
|
|
1533
|
-
}
|
|
1534
|
-
const ZodMiniDate = /* @__PURE__ */ $constructor("ZodMiniDate", (inst, def) => {
|
|
1535
|
-
$ZodDate.init(inst, def);
|
|
1536
|
-
ZodMiniType.init(inst, def);
|
|
1537
|
-
});
|
|
1538
|
-
function date(params) {
|
|
1539
|
-
return _date(ZodMiniDate, params);
|
|
1540
|
-
}
|
|
1541
|
-
const ZodMiniArray = /* @__PURE__ */ $constructor("ZodMiniArray", (inst, def) => {
|
|
1542
|
-
$ZodArray.init(inst, def);
|
|
1543
|
-
ZodMiniType.init(inst, def);
|
|
1544
|
-
});
|
|
1545
|
-
function array(element, params) {
|
|
1546
|
-
return new ZodMiniArray({
|
|
1547
|
-
type: "array",
|
|
1548
|
-
element,
|
|
1549
|
-
...normalizeParams(params)
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
1553
|
-
$ZodObject.init(inst, def);
|
|
1554
|
-
ZodMiniType.init(inst, def);
|
|
1555
|
-
defineLazy(inst, "shape", () => def.shape);
|
|
1556
|
-
});
|
|
1557
|
-
function object(shape, params) {
|
|
1558
|
-
return new ZodMiniObject({
|
|
1559
|
-
type: "object",
|
|
1560
|
-
shape: shape ?? {},
|
|
1561
|
-
...normalizeParams(params)
|
|
1562
|
-
});
|
|
1563
|
-
}
|
|
1564
|
-
const ZodMiniUnion = /* @__PURE__ */ $constructor("ZodMiniUnion", (inst, def) => {
|
|
1565
|
-
$ZodUnion.init(inst, def);
|
|
1566
|
-
ZodMiniType.init(inst, def);
|
|
1567
|
-
});
|
|
1568
|
-
function union(options, params) {
|
|
1569
|
-
return new ZodMiniUnion({
|
|
1570
|
-
type: "union",
|
|
1571
|
-
options,
|
|
1572
|
-
...normalizeParams(params)
|
|
1573
|
-
});
|
|
1574
|
-
}
|
|
1575
|
-
const ZodMiniRecord = /* @__PURE__ */ $constructor("ZodMiniRecord", (inst, def) => {
|
|
1576
|
-
$ZodRecord.init(inst, def);
|
|
1577
|
-
ZodMiniType.init(inst, def);
|
|
1578
|
-
});
|
|
1579
|
-
function record(keyType, valueType, params) {
|
|
1580
|
-
return new ZodMiniRecord({
|
|
1581
|
-
type: "record",
|
|
1582
|
-
keyType,
|
|
1583
|
-
valueType,
|
|
1584
|
-
...normalizeParams(params)
|
|
1585
|
-
});
|
|
1586
|
-
}
|
|
1587
|
-
const ZodMiniMap = /* @__PURE__ */ $constructor("ZodMiniMap", (inst, def) => {
|
|
1588
|
-
$ZodMap.init(inst, def);
|
|
1589
|
-
ZodMiniType.init(inst, def);
|
|
1590
|
-
});
|
|
1591
|
-
function map(keyType, valueType, params) {
|
|
1592
|
-
return new ZodMiniMap({
|
|
1593
|
-
type: "map",
|
|
1594
|
-
keyType,
|
|
1595
|
-
valueType,
|
|
1596
|
-
...normalizeParams(params)
|
|
1597
|
-
});
|
|
1598
|
-
}
|
|
1599
|
-
const ZodMiniSet = /* @__PURE__ */ $constructor("ZodMiniSet", (inst, def) => {
|
|
1600
|
-
$ZodSet.init(inst, def);
|
|
1601
|
-
ZodMiniType.init(inst, def);
|
|
1602
|
-
});
|
|
1603
|
-
function set(valueType, params) {
|
|
1604
|
-
return new ZodMiniSet({
|
|
1605
|
-
type: "set",
|
|
1606
|
-
valueType,
|
|
1607
|
-
...normalizeParams(params)
|
|
1608
|
-
});
|
|
1609
|
-
}
|
|
1610
|
-
const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
1611
|
-
$ZodLiteral.init(inst, def);
|
|
1612
|
-
ZodMiniType.init(inst, def);
|
|
1613
|
-
});
|
|
1614
|
-
function literal(value, params) {
|
|
1615
|
-
return new ZodMiniLiteral({
|
|
1616
|
-
type: "literal",
|
|
1617
|
-
values: Array.isArray(value) ? value : [value],
|
|
1618
|
-
...normalizeParams(params)
|
|
1619
|
-
});
|
|
1620
|
-
}
|
|
1621
|
-
const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
|
|
1622
|
-
$ZodOptional.init(inst, def);
|
|
1623
|
-
ZodMiniType.init(inst, def);
|
|
1624
|
-
});
|
|
1625
|
-
function optional(innerType) {
|
|
1626
|
-
return new ZodMiniOptional({
|
|
1627
|
-
type: "optional",
|
|
1628
|
-
innerType
|
|
1629
|
-
});
|
|
1630
|
-
}
|
|
1631
|
-
const ZodMiniLazy = /* @__PURE__ */ $constructor("ZodMiniLazy", (inst, def) => {
|
|
1632
|
-
$ZodLazy.init(inst, def);
|
|
1633
|
-
ZodMiniType.init(inst, def);
|
|
1634
|
-
});
|
|
1635
|
-
function _lazy(getter) {
|
|
1636
|
-
return new ZodMiniLazy({
|
|
1637
|
-
type: "lazy",
|
|
1638
|
-
getter
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
const importSchema = object({
|
|
1642
|
-
__cc_import: literal(true),
|
|
1643
|
-
path: string(),
|
|
1644
|
-
name: optional(string())
|
|
1645
|
-
});
|
|
1646
|
-
function isImport(value) {
|
|
1647
|
-
return value && value.__cc_import;
|
|
1648
|
-
}
|
|
1649
|
-
const literalSchema = union([
|
|
1650
|
-
string(),
|
|
1651
|
-
number(),
|
|
1652
|
-
boolean(),
|
|
1653
|
-
_null(),
|
|
1654
|
-
_undefined(),
|
|
1655
|
-
date(),
|
|
1656
|
-
map(unknown(), unknown()),
|
|
1657
|
-
set(unknown()),
|
|
1658
|
-
bigint(),
|
|
1659
|
-
importSchema
|
|
1660
|
-
]);
|
|
1661
|
-
const schema = _lazy(() => union([
|
|
1662
|
-
literalSchema,
|
|
1663
|
-
array(schema),
|
|
1664
|
-
record(string(), schema)
|
|
1665
|
-
]));
|
|
1666
|
-
const extension = "js";
|
|
1667
|
-
const serializableSchema = record(string(), schema);
|
|
1668
|
-
function createImport(imp, variableName) {
|
|
1669
|
-
return `import ${imp.name ? `{ ${imp.name} as ${variableName} }` : variableName} from "${imp.path}";\n`;
|
|
1670
|
-
}
|
|
1671
|
-
function serialize(value) {
|
|
1672
|
-
let serializedValue = "";
|
|
1673
|
-
let counter = 0;
|
|
1674
|
-
function handleImports(item) {
|
|
1675
|
-
if (item instanceof Object) Object.entries(item).forEach(([key, value$1]) => {
|
|
1676
|
-
if (isImport(value$1)) {
|
|
1677
|
-
counter++;
|
|
1678
|
-
const variableName = `__v_${counter}`;
|
|
1679
|
-
serializedValue += createImport(value$1, variableName);
|
|
1680
|
-
item[key] = variableName;
|
|
1681
|
-
} else if (value$1 instanceof Object) handleImports(value$1);
|
|
1682
|
-
});
|
|
1683
|
-
}
|
|
1684
|
-
value.forEach(handleImports);
|
|
1685
|
-
serializedValue += "\n";
|
|
1686
|
-
const js = (0, import_serialize_javascript.default)(value, {
|
|
1687
|
-
space: 2,
|
|
1688
|
-
unsafe: true,
|
|
1689
|
-
ignoreFunction: true
|
|
1690
|
-
}).replace(/"__v_(\d+)"/g, (_, index) => {
|
|
1691
|
-
return `__v_${index}`;
|
|
1692
|
-
});
|
|
1693
|
-
serializedValue += "export default " + js;
|
|
1694
|
-
return serializedValue;
|
|
1695
|
-
}
|
|
1696
|
-
var TransformError = class extends Error {
|
|
1697
|
-
type;
|
|
1698
|
-
constructor(type, message) {
|
|
1699
|
-
super(message);
|
|
1700
|
-
this.type = type;
|
|
1701
|
-
}
|
|
1702
|
-
};
|
|
1703
|
-
function isSkippedSignal(signal) {
|
|
1704
|
-
return signal[skippedSymbol] === true;
|
|
1705
|
-
}
|
|
1706
|
-
function createPath(path$1, ext) {
|
|
1707
|
-
let p = path$1.slice(0, -ext.length);
|
|
1708
|
-
if (p.endsWith("/index")) p = p.slice(0, -6);
|
|
1709
|
-
return p;
|
|
1710
|
-
}
|
|
1711
|
-
function isContentDefined(value) {
|
|
1712
|
-
return value !== null && typeof value === "object" && "content" in value;
|
|
1713
|
-
}
|
|
1714
|
-
function createTransformer(emitter, cacheManager) {
|
|
1715
|
-
const deprecatedWarnings = /* @__PURE__ */ new Set();
|
|
1716
|
-
function warnImplicitContentProperty(collection) {
|
|
1717
|
-
const key = `implicitContentProperty:${collection.name}`;
|
|
1718
|
-
if (deprecatedWarnings.has(key)) return;
|
|
1719
|
-
deprecatedWarnings.add(key);
|
|
1720
|
-
deprecated("implicitContentProperty");
|
|
1721
|
-
}
|
|
1722
|
-
async function parseFile(collection, file) {
|
|
1723
|
-
const { data, path: path$1 } = file;
|
|
1724
|
-
const parsedData = await collection.schema["~standard"].validate(data);
|
|
1725
|
-
if (parsedData.issues) {
|
|
1726
|
-
emitter.emit("transformer:validation-error", {
|
|
1727
|
-
collection,
|
|
1728
|
-
file,
|
|
1729
|
-
error: new TransformError("Validation", parsedData.issues.map((issue) => issue.message).join(", "))
|
|
1730
|
-
});
|
|
1731
|
-
return null;
|
|
1732
|
-
}
|
|
1733
|
-
let values = parsedData.value;
|
|
1734
|
-
if (getParser(collection.parser).hasContent && !isContentDefined(values)) {
|
|
1735
|
-
warnImplicitContentProperty(collection);
|
|
1736
|
-
if (typeof data.content !== "string") {
|
|
1737
|
-
emitter.emit("transformer:validation-error", {
|
|
1738
|
-
collection,
|
|
1739
|
-
file,
|
|
1740
|
-
error: new TransformError("Validation", `The content property is not a string`)
|
|
1741
|
-
});
|
|
1742
|
-
return null;
|
|
1743
|
-
}
|
|
1744
|
-
values = {
|
|
1745
|
-
...values,
|
|
1746
|
-
content: data.content
|
|
1747
|
-
};
|
|
1748
|
-
}
|
|
1749
|
-
const ext = extname(path$1);
|
|
1750
|
-
let extension$1 = ext;
|
|
1751
|
-
if (extension$1.startsWith(".")) extension$1 = extension$1.slice(1);
|
|
1752
|
-
return { document: {
|
|
1753
|
-
...values,
|
|
1754
|
-
_meta: {
|
|
1755
|
-
filePath: path$1,
|
|
1756
|
-
fileName: basename(path$1),
|
|
1757
|
-
directory: dirname(path$1),
|
|
1758
|
-
extension: extension$1,
|
|
1759
|
-
path: createPath(path$1, ext)
|
|
1760
|
-
}
|
|
1761
|
-
} };
|
|
1762
|
-
}
|
|
1763
|
-
async function parseCollection(collection) {
|
|
1764
|
-
const promises = collection.files.map((file) => parseFile(collection, file));
|
|
1765
|
-
return {
|
|
1766
|
-
...collection,
|
|
1767
|
-
documents: (await Promise.all(promises)).filter(isDefined)
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
function createContext(collections, collection, cache) {
|
|
1771
|
-
return {
|
|
1772
|
-
documents: (collection$1) => {
|
|
1773
|
-
const resolved = collections.find((c) => c.name === collection$1.name);
|
|
1774
|
-
if (!resolved) throw new TransformError("Configuration", `Collection ${collection$1.name} not found, do you have registered it in your configuration?`);
|
|
1775
|
-
return resolved.documents.map((doc) => doc.document);
|
|
1776
|
-
},
|
|
1777
|
-
collection: {
|
|
1778
|
-
name: collection.name,
|
|
1779
|
-
directory: collection.directory,
|
|
1780
|
-
documents: async () => {
|
|
1781
|
-
return collection.documents.map((doc) => doc.document);
|
|
1782
|
-
}
|
|
1783
|
-
},
|
|
1784
|
-
cache: cache.cacheFn,
|
|
1785
|
-
skip: (reason) => ({
|
|
1786
|
-
[skippedSymbol]: true,
|
|
1787
|
-
reason
|
|
1788
|
-
})
|
|
1789
|
-
};
|
|
1790
|
-
}
|
|
1791
|
-
async function transformDocument(collections, collection, transform, doc) {
|
|
1792
|
-
const cache = cacheManager.cache(collection.name, doc.document._meta.path);
|
|
1793
|
-
const context = createContext(collections, collection, cache);
|
|
1794
|
-
try {
|
|
1795
|
-
const document = await transform(doc.document, context);
|
|
1796
|
-
await cache.tidyUp();
|
|
1797
|
-
if (isSkippedSignal(document)) emitter.emit("transformer:document-skipped", {
|
|
1798
|
-
collection,
|
|
1799
|
-
filePath: join(collection.directory, doc.document._meta.filePath),
|
|
1800
|
-
reason: document.reason
|
|
1801
|
-
});
|
|
1802
|
-
else return {
|
|
1803
|
-
...doc,
|
|
1804
|
-
document
|
|
1805
|
-
};
|
|
1806
|
-
} catch (error) {
|
|
1807
|
-
if (error instanceof TransformError) emitter.emit("transformer:error", {
|
|
1808
|
-
collection,
|
|
1809
|
-
error
|
|
1810
|
-
});
|
|
1811
|
-
else emitter.emit("transformer:error", {
|
|
1812
|
-
collection,
|
|
1813
|
-
error: new TransformError("Transform", String(error))
|
|
1814
|
-
});
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
async function transformCollection(collections, collection) {
|
|
1818
|
-
const transform = collection.transform;
|
|
1819
|
-
if (transform) {
|
|
1820
|
-
const limit = pLimit(os.cpus().length);
|
|
1821
|
-
const docs = collection.documents.map((doc) => limit(() => transformDocument(collections, collection, transform, doc)));
|
|
1822
|
-
const transformed = await Promise.all(docs);
|
|
1823
|
-
await cacheManager.flush();
|
|
1824
|
-
return transformed.filter(isDefined);
|
|
1825
|
-
}
|
|
1826
|
-
return collection.documents;
|
|
1827
|
-
}
|
|
1828
|
-
async function validateDocuments(collection, documents) {
|
|
1829
|
-
const docs = [];
|
|
1830
|
-
for (const doc of documents) {
|
|
1831
|
-
let parsedData = await serializableSchema.safeParseAsync(doc.document);
|
|
1832
|
-
if (parsedData.success) docs.push(doc);
|
|
1833
|
-
else emitter.emit("transformer:result-error", {
|
|
1834
|
-
collection,
|
|
1835
|
-
document: doc.document,
|
|
1836
|
-
error: new TransformError("Result", parsedData.error.message)
|
|
1837
|
-
});
|
|
1838
|
-
}
|
|
1839
|
-
return docs;
|
|
1840
|
-
}
|
|
1841
|
-
return async (untransformedCollections) => {
|
|
1842
|
-
const promises = untransformedCollections.map((collection) => parseCollection(collection));
|
|
1843
|
-
const collections = await Promise.all(promises);
|
|
1844
|
-
for (const collection of collections) collection.documents = await validateDocuments(collection, await transformCollection(collections, collection));
|
|
1845
|
-
return collections;
|
|
1846
|
-
};
|
|
1847
|
-
}
|
|
1848
|
-
function createArrayConstName(name) {
|
|
1849
|
-
return "all" + pluralize(name.charAt(0).toUpperCase() + name.slice(1));
|
|
1850
|
-
}
|
|
1851
|
-
async function createDataFile(directory, collection) {
|
|
1852
|
-
const dataPath = path.join(directory, `${createArrayConstName(collection.name)}.${extension}`);
|
|
1853
|
-
await fs.writeFile(dataPath, serialize(collection.documents.map((doc) => doc.document)));
|
|
1854
|
-
}
|
|
1855
|
-
function createDataFiles(directory, collections) {
|
|
1856
|
-
return Promise.all(collections.map((collection) => createDataFile(directory, collection)));
|
|
1857
|
-
}
|
|
1858
|
-
async function createJavaScriptFile(directory, configuration) {
|
|
1859
|
-
const collections = configuration.collections.map(({ name }) => createArrayConstName(name));
|
|
1860
|
-
let content = `// generated by content-collections at ${/* @__PURE__ */ new Date()}\n\n`;
|
|
1861
|
-
for (const name of collections) content += `import ${name} from "./${name}.${extension}";\n`;
|
|
1862
|
-
content += "\n";
|
|
1863
|
-
content += "export { " + collections.join(", ") + " };\n";
|
|
1864
|
-
await fs.writeFile(path.join(directory, "index.js"), content, "utf-8");
|
|
1865
|
-
}
|
|
1866
|
-
function createImportPath(directory, target) {
|
|
1867
|
-
let importPath = path.posix.join(...path.relative(directory, target).split(path.sep));
|
|
1868
|
-
if (!importPath.startsWith(".")) importPath = "./" + importPath;
|
|
1869
|
-
return importPath;
|
|
1870
|
-
}
|
|
1871
|
-
async function createTypeDefinitionFile(directory, configuration) {
|
|
1872
|
-
if (!configuration.generateTypes) return;
|
|
1873
|
-
let content = `import configuration from "${createImportPath(directory, configuration.path)}";
|
|
1874
|
-
import { GetTypeByName } from "@content-collections/core";
|
|
1875
|
-
`;
|
|
1876
|
-
const collections = configuration.collections;
|
|
1877
|
-
for (const collection of collections) {
|
|
1878
|
-
content += `\n`;
|
|
1879
|
-
content += `export type ${collection.typeName} = GetTypeByName<typeof configuration, "${collection.name}">;\n`;
|
|
1880
|
-
content += `export declare const ${createArrayConstName(collection.name)}: Array<${collection.typeName}>;\n`;
|
|
1881
|
-
}
|
|
1882
|
-
content += "\n";
|
|
1883
|
-
content += "export {};\n";
|
|
1884
|
-
await fs.writeFile(path.join(directory, "index.d.ts"), content, "utf-8");
|
|
1885
|
-
}
|
|
1886
|
-
async function createWriter(directory) {
|
|
1887
|
-
await fs.mkdir(directory, { recursive: true });
|
|
1888
|
-
return {
|
|
1889
|
-
createJavaScriptFile: (configuration) => createJavaScriptFile(directory, configuration),
|
|
1890
|
-
createTypeDefinitionFile: (configuration) => createTypeDefinitionFile(directory, configuration),
|
|
1891
|
-
createDataFiles: (collections) => createDataFiles(directory, collections)
|
|
1892
|
-
};
|
|
1893
|
-
}
|
|
1894
|
-
async function createBuildContext({ emitter, outputDirectory, baseDirectory, configuration }) {
|
|
1895
|
-
const collector = createCollector(emitter, baseDirectory);
|
|
1896
|
-
const [writer, resolved, cacheManager] = await Promise.all([
|
|
1897
|
-
createWriter(outputDirectory),
|
|
1898
|
-
collector.collect(configuration.collections),
|
|
1899
|
-
createCacheManager(baseDirectory, configuration.checksum)
|
|
1900
|
-
]);
|
|
1901
|
-
return {
|
|
1902
|
-
resolved,
|
|
1903
|
-
writer,
|
|
1904
|
-
synchronizer: createSynchronizer(collector.collectFile, resolved, baseDirectory),
|
|
1905
|
-
transform: createTransformer(emitter, cacheManager),
|
|
1906
|
-
emitter,
|
|
1907
|
-
cacheManager,
|
|
1908
|
-
configuration
|
|
1909
|
-
};
|
|
1910
|
-
}
|
|
1911
|
-
async function build$1({ emitter, transform, resolved, writer, configuration }) {
|
|
1912
|
-
const startedAt = Date.now();
|
|
1913
|
-
emitter.emit("builder:start", { startedAt });
|
|
1914
|
-
const collections = await transform(resolved);
|
|
1915
|
-
await Promise.all([
|
|
1916
|
-
writer.createDataFiles(collections),
|
|
1917
|
-
writer.createTypeDefinitionFile(configuration),
|
|
1918
|
-
writer.createJavaScriptFile(configuration)
|
|
1919
|
-
]);
|
|
1920
|
-
const pendingOnSuccess = collections.filter((collection) => Boolean(collection.onSuccess)).map((collection) => collection.onSuccess?.(collection.documents.map((doc) => doc.document)));
|
|
1921
|
-
await Promise.all(pendingOnSuccess.filter(isDefined));
|
|
1922
|
-
const stats = collections.reduce((acc, collection) => {
|
|
1923
|
-
acc.collections++;
|
|
1924
|
-
acc.documents += collection.documents.length;
|
|
1925
|
-
return acc;
|
|
1926
|
-
}, {
|
|
1927
|
-
collections: 0,
|
|
1928
|
-
documents: 0
|
|
1929
|
-
});
|
|
1930
|
-
emitter.emit("builder:end", {
|
|
1931
|
-
startedAt,
|
|
1932
|
-
endedAt: Date.now(),
|
|
1933
|
-
stats
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
//#endregion
|
|
1938
|
-
export { build$1, createBuildContext, createConfigurationReader, serialize };
|
|
1939
|
-
//# sourceMappingURL=index.mjs.map
|