@carbonenginejs/runtime-resource 0.9.2 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -2
- package/README.md +47 -6
- package/dist/CjsMotherLode.js +88 -88
- package/dist/CjsMotherLode.js.map +1 -1
- package/dist/CjsResMan.js +717 -228
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -0
- package/dist/CjsResManFetchProvider.js.map +1 -0
- package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
- package/dist/CjsResManWorkQueue.js.map +1 -0
- package/dist/format/CjsBlueReader.js +89 -0
- package/dist/format/CjsBlueReader.js.map +1 -1
- package/dist/format/CjsFormat.js +42 -16
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsReader.js +4 -0
- package/dist/format/CjsReader.js.map +1 -1
- package/dist/format/CjsResourceProbe.js +2 -0
- package/dist/format/CjsResourceProbe.js.map +1 -1
- package/dist/format/payloadContract.js +20 -0
- package/dist/format/payloadContract.js.map +1 -1
- package/dist/formats/black/CjsBlackFormat.js +15 -1
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
- package/dist/formats/black/core/CjsBlackReader.js +125 -0
- package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
- package/dist/formats/black/core/helpers.js +17 -0
- package/dist/formats/black/core/helpers.js.map +1 -1
- package/dist/formats/bnk/CjsBnkFormat.js +8 -0
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +20 -0
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +40 -3
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
- package/dist/formats/cmf/core/binary.js +71 -0
- package/dist/formats/cmf/core/binary.js.map +1 -1
- package/dist/formats/cmf/core/buffers.js +4 -0
- package/dist/formats/cmf/core/buffers.js.map +1 -1
- package/dist/formats/cmf/core/helpers.js +31 -0
- package/dist/formats/cmf/core/helpers.js.map +1 -1
- package/dist/formats/cmf/core/schema.js +10 -0
- package/dist/formats/cmf/core/schema.js.map +1 -1
- package/dist/formats/cmf/core/shared.js +9 -0
- package/dist/formats/cmf/core/shared.js.map +1 -1
- package/dist/formats/cmf/core/writer.js +54 -0
- package/dist/formats/cmf/core/writer.js.map +1 -1
- package/dist/formats/dds/core/bc6h.js +10 -0
- package/dist/formats/dds/core/bc6h.js.map +1 -1
- package/dist/formats/dds/core/bc7.js +16 -0
- package/dist/formats/dds/core/bc7.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +47 -0
- package/dist/formats/dds/core/helpers.js.map +1 -1
- package/dist/formats/fbx/core/helpers.js +21 -0
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/flac/CjsFlacFormat.js +49 -0
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +20 -0
- package/dist/formats/flac/core/helpers.js.map +1 -1
- package/dist/formats/gif/CjsGifFormat.js +49 -0
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +20 -0
- package/dist/formats/gif/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/helpers.js +15 -0
- package/dist/formats/gltf/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/parser.js +13 -0
- package/dist/formats/gltf/core/parser.js.map +1 -1
- package/dist/formats/gltf/core/targets.js +10 -0
- package/dist/formats/gltf/core/targets.js.map +1 -1
- package/dist/formats/gr2/core/bitknit2.js +2 -0
- package/dist/formats/gr2/core/bitknit2.js.map +1 -1
- package/dist/formats/gr2/core/helpers.js +20 -0
- package/dist/formats/gr2/core/helpers.js.map +1 -1
- package/dist/formats/gr2/core/targets.js +10 -0
- package/dist/formats/gr2/core/targets.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +52 -0
- package/dist/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/formats/jpeg/core/jpeg.js +93 -0
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +37 -0
- package/dist/formats/mp3/core/helpers.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +35 -0
- package/dist/formats/mp4/core/helpers.js.map +1 -1
- package/dist/formats/ogg/CjsOggFormat.js +49 -0
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +23 -0
- package/dist/formats/ogg/core/helpers.js.map +1 -1
- package/dist/formats/ogg/core/vorbis.js +13 -0
- package/dist/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/formats/png/core/helpers.js +52 -0
- package/dist/formats/png/core/helpers.js.map +1 -1
- package/dist/formats/red/CjsRedFormat.js +2 -0
- package/dist/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/formats/red/core/CjsRedReader.js +52 -0
- package/dist/formats/red/core/CjsRedReader.js.map +1 -1
- package/dist/formats/red/core/helpers.js +19 -0
- package/dist/formats/red/core/helpers.js.map +1 -1
- package/dist/formats/stl/core/stl.js +8 -0
- package/dist/formats/stl/core/stl.js.map +1 -1
- package/dist/formats/stl/core/targets.js +10 -0
- package/dist/formats/stl/core/targets.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +47 -0
- package/dist/formats/tga/core/helpers.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +37 -0
- package/dist/formats/wav/core/helpers.js.map +1 -1
- package/dist/formats/webm/core/helpers.js +35 -0
- package/dist/formats/webm/core/helpers.js.map +1 -1
- package/dist/formats/webp/CjsWebpFormat.js +49 -0
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +23 -0
- package/dist/formats/webp/core/helpers.js.map +1 -1
- package/dist/formats/wem/CjsWemFormat.js +8 -0
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/bitStream.js +2 -0
- package/dist/formats/wem/core/bitStream.js.map +1 -1
- package/dist/formats/wem/core/helpers.js +20 -0
- package/dist/formats/wem/core/helpers.js.map +1 -1
- package/dist/formats/yaml/CjsYamlFormat.js +45 -0
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +10 -0
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/index.js +56 -43
- package/dist/index.js.map +1 -1
- package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
- package/dist/resource/CjsResource.js.map +1 -0
- package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
- package/dist/resource/Tr2LightProfileRes.js.map +1 -0
- package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
- package/dist/resource/audio/CjsAudioRes.js +213 -0
- package/dist/resource/audio/CjsAudioRes.js.map +1 -0
- package/dist/resource/audio/index.js +4 -0
- package/dist/resource/audio/index.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
- package/dist/resource/geometry/MeshDecalData.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
- package/dist/resource/geometry/TriGeometryRes.js +656 -0
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
- package/dist/resource/geometry/TriJointBinding.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
- package/dist/resource/geometry/granny/enums.js.map +1 -0
- package/dist/resource/geometry/granny/index.js +6 -0
- package/dist/resource/geometry/granny/index.js.map +1 -0
- package/dist/resource/geometry/index.js +17 -0
- package/dist/resource/geometry/index.js.map +1 -0
- package/dist/resource/index.js +52 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/resourceBoundary.js +64 -0
- package/dist/resource/resourceBoundary.js.map +1 -0
- package/dist/resource/shader/Tr2EffectRes.js +420 -0
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialArea.js +9 -4
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialMesh.js +8 -3
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2MaterialRes.js +10 -4
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
- package/dist/resource/shader/Tr2Shader.js +250 -0
- package/dist/resource/shader/Tr2Shader.js.map +1 -0
- package/dist/{resources → resource/shader}/Tr2ShaderPermutation.js +13 -7
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
- package/dist/resource/shader/index.js +17 -0
- package/dist/resource/shader/index.js.map +1 -0
- package/dist/resource/shader/portable.js +33 -0
- package/dist/resource/shader/portable.js.map +1 -0
- package/dist/resource/shader/portableValidation.js +461 -0
- package/dist/resource/shader/portableValidation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +100 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +34 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +113 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +141 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +107 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js +90 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +235 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +71 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2Pass.js +111 -0
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +80 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
- package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
- package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
- package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
- package/dist/resource/texture/TriTextureRes.js.map +1 -0
- package/dist/resource/texture/index.js +15 -0
- package/dist/resource/texture/index.js.map +1 -0
- package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
- package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
- package/dist/worker/CjsResManMainThreadLoader.js +87 -0
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
- package/dist/worker/CjsResManWorker.js +217 -0
- package/dist/worker/CjsResManWorker.js.map +1 -0
- package/dist/worker/CjsResManWorkerLoader.js +434 -0
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
- package/dist/worker/protocol.js +12 -0
- package/dist/worker/protocol.js.map +1 -0
- package/docs/README.md +16 -3
- package/docs/architecture.md +39 -16
- package/docs/concepts/resource-lifecycle.md +2 -1
- package/docs/formats/README.md +4 -0
- package/docs/reference/classes/README.md +6 -4
- package/docs/reference/classes/audio.md +30 -0
- package/docs/reference/classes/core.md +31 -11
- package/docs/reference/classes/resources.md +151 -41
- package/docs/reference/classes/texture.md +7 -7
- package/docs/reference/motherlode-cache.md +17 -0
- package/docs/reference/queues.md +9 -1
- package/docs/reference/workers.md +135 -0
- package/docs/roadmap.md +27 -1
- package/package.json +8 -1
- package/dist/CjsResManQueue.js.map +0 -1
- package/dist/CjsResource.js.map +0 -1
- package/dist/CjsResourceSource.js +0 -68
- package/dist/CjsResourceSource.js.map +0 -1
- package/dist/resourcePath.js +0 -18
- package/dist/resourcePath.js.map +0 -1
- package/dist/resourceStates.js +0 -9
- package/dist/resourceStates.js.map +0 -1
- package/dist/resources/AudioGeometryResData.js.map +0 -1
- package/dist/resources/GStateBindingCallbackData.js.map +0 -1
- package/dist/resources/MeshDecalData.js.map +0 -1
- package/dist/resources/MeshDecalLodData.js.map +0 -1
- package/dist/resources/Tr2EffectRes.js +0 -71
- package/dist/resources/Tr2EffectRes.js.map +0 -1
- package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
- package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
- package/dist/resources/Tr2ImageRes.js.map +0 -1
- package/dist/resources/Tr2LightProfileRes.js.map +0 -1
- package/dist/resources/Tr2MaterialArea.js.map +0 -1
- package/dist/resources/Tr2MaterialMesh.js.map +0 -1
- package/dist/resources/Tr2MaterialRes.js.map +0 -1
- package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
- package/dist/resources/Tr2TextureLodManager.js.map +0 -1
- package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
- package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
- package/dist/resources/Tr2TexturePipeline.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
- package/dist/resources/TriGeometryRes.js +0 -239
- package/dist/resources/TriGeometryRes.js.map +0 -1
- package/dist/resources/TriGeometryResAreaData.js.map +0 -1
- package/dist/resources/TriGeometryResJointData.js.map +0 -1
- package/dist/resources/TriGeometryResLodData.js.map +0 -1
- package/dist/resources/TriGeometryResMeshData.js.map +0 -1
- package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
- package/dist/resources/TriGrannyRes.js.map +0 -1
- package/dist/resources/TriJointBinding.js.map +0 -1
- package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
- package/dist/resources/TriRtGeometryConstants.js.map +0 -1
- package/dist/resources/TriTextureRes.js.map +0 -1
- package/dist/resources/enums.js.map +0 -1
- package/dist/resources/resourceBoundary.js +0 -47
- package/dist/resources/resourceBoundary.js.map +0 -1
- package/dist/resources/texturePipelineBehavior.js.map +0 -1
- package/dist/texture/CjsTextureArrayRes.js.map +0 -1
- package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsYamlFormat.js","sources":["../../../../src/formats/yaml/CjsYamlFormat.js"],"sourcesContent":["import { CjsYamlReader } from \"./core/CjsYamlReader.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_DOCUMENT,\n OUTPUT_JSON,\n OUTPUT_PAYLOAD,\n OUTPUT_RAW,\n TAG_HANDLE,\n TAG_PRESERVE,\n TAG_REJECT,\n normalizeValues,\n toJsonGraph\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsYamlFormat\";\n\n/**\n * YAML format profile that parses YAML text into payload, JSON-graph, raw,\n * or document output with configurable tag policies, alias limits, and\n * identity/reference markers.\n */\nexport class CjsYamlFormat\n{\n #values = DEFAULT_VALUES;\n\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n Read(input, options = {})\n {\n return CjsYamlFormat.read(input, this.GetValues(options));\n }\n\n ReadPayload(input, options = {})\n {\n return CjsYamlFormat.readPayload(input, this.GetValues(options));\n }\n\n ReadRaw(input, options = {})\n {\n return CjsYamlFormat.readRaw(input, this.GetValues(options));\n }\n\n ReadDocument(input, options = {})\n {\n return CjsYamlFormat.readDocument(input, this.GetValues(options));\n }\n\n Inspect(input, options = {})\n {\n return CjsYamlFormat.inspect(input, this.GetValues(options));\n }\n\n ToJSON(value, options = {})\n {\n return toJsonGraph(value, this.GetValues(options));\n }\n\n static read(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n if (values.emit === OUTPUT_RAW) return new CjsYamlReader(input, values).ReadRaw();\n if (values.emit === OUTPUT_DOCUMENT) return new CjsYamlReader(input, values).ReadDocument();\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readPayload(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n static readRaw(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadRaw();\n }\n\n static readDocument(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadDocument();\n }\n\n static inspect(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).Inspect();\n }\n\n static toJSON(value, options = {})\n {\n return toJsonGraph(value, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n JSON: OUTPUT_JSON,\n PAYLOAD: OUTPUT_PAYLOAD,\n RAW: OUTPUT_RAW,\n DOCUMENT: OUTPUT_DOCUMENT\n });\n static TAG_PRESERVE = TAG_PRESERVE;\n static TAG_REJECT = TAG_REJECT;\n static TAG_HANDLE = TAG_HANDLE;\n static id = \"yaml\";\n static extensions = Object.freeze([ \".yaml\", \".yml\" ]);\n static type = Object.freeze([ \"data\" ]);\n static mediaTypes = Object.freeze([ \"data\" ]);\n static inputTypes = Object.freeze([ \"yaml\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON, OUTPUT_PAYLOAD ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_RAW, OUTPUT_DOCUMENT ]);\n}\n\nexport default CjsYamlFormat;\n"],"names":["FORMAT_NAME","CjsYamlFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","GetValues","Read","input","read","ReadPayload","readPayload","ReadRaw","readRaw","ReadDocument","readDocument","Inspect","inspect","ToJSON","value","toJsonGraph","values","emit","OUTPUT_RAW","CjsYamlReader","OUTPUT_DOCUMENT","toJSON","Output","Object","freeze","JSON","OUTPUT_JSON","PAYLOAD","OUTPUT_PAYLOAD","RAW","DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","id","extensions","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes"],"mappings":";;;AAcA,MAAMA,WAAW,GAAG,eAAe;;AAEnC;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,CAC1B;EACI,OAAO,GAAGC,cAAc;
|
|
1
|
+
{"version":3,"file":"CjsYamlFormat.js","sources":["../../../../src/formats/yaml/CjsYamlFormat.js"],"sourcesContent":["import { CjsYamlReader } from \"./core/CjsYamlReader.js\";\nimport {\n DEFAULT_VALUES,\n OUTPUT_DOCUMENT,\n OUTPUT_JSON,\n OUTPUT_PAYLOAD,\n OUTPUT_RAW,\n TAG_HANDLE,\n TAG_PRESERVE,\n TAG_REJECT,\n normalizeValues,\n toJsonGraph\n} from \"./core/helpers.js\";\n\nconst FORMAT_NAME = \"CjsYamlFormat\";\n\n/**\n * YAML format profile that parses YAML text into payload, JSON-graph, raw,\n * or document output with configurable tag policies, alias limits, and\n * identity/reference markers.\n */\nexport class CjsYamlFormat\n{\n #values = DEFAULT_VALUES;\n\n /** Creates a CjsYamlFormat with caller-provided reader configuration. */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Applies caller-provided options after normalizing supported fields for the\n * YAML document reader.\n */\n SetValues(options = {})\n {\n this.#values = normalizeValues(this.#values, options, FORMAT_NAME);\n return this;\n }\n\n /**\n * Returns a snapshot of the normalized reader options for the YAML document\n * reader.\n */\n GetValues(options = {})\n {\n return normalizeValues(this.#values, options, FORMAT_NAME);\n }\n\n /**\n * Reads the primary public payload representation from the supplied input\n * for the YAML document reader.\n */\n Read(input, options = {})\n {\n return CjsYamlFormat.read(input, this.GetValues(options));\n }\n\n /** Reads payload from the current YAML document reader. */\n ReadPayload(input, options = {})\n {\n return CjsYamlFormat.readPayload(input, this.GetValues(options));\n }\n\n /** Reads raw from the current YAML document reader. */\n ReadRaw(input, options = {})\n {\n return CjsYamlFormat.readRaw(input, this.GetValues(options));\n }\n\n /** Reads document from the current YAML document reader. */\n ReadDocument(input, options = {})\n {\n return CjsYamlFormat.readDocument(input, this.GetValues(options));\n }\n\n /**\n * Returns structural metadata without materializing the decoded payload for\n * the YAML document reader.\n */\n Inspect(input, options = {})\n {\n return CjsYamlFormat.inspect(input, this.GetValues(options));\n }\n\n /**\n * Converts the current decoded payload into a JSON-safe representation for\n * the YAML document reader.\n */\n ToJSON(value, options = {})\n {\n return toJsonGraph(value, this.GetValues(options));\n }\n\n /** Provides the one-shot YAML payload reader entry point. */\n static read(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n if (values.emit === OUTPUT_RAW) return new CjsYamlReader(input, values).ReadRaw();\n if (values.emit === OUTPUT_DOCUMENT) return new CjsYamlReader(input, values).ReadDocument();\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n /** Provides the one-shot YAML normalized-payload reader entry point. */\n static readPayload(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadPayload();\n }\n\n /** Provides the one-shot YAML raw-value reader entry point. */\n static readRaw(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadRaw();\n }\n\n /** Provides the one-shot YAML document reader entry point. */\n static readDocument(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).ReadDocument();\n }\n\n /** Provides the one-shot YAML metadata inspection entry point. */\n static inspect(input, options = {})\n {\n const values = normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME);\n return new CjsYamlReader(input, values).Inspect();\n }\n\n /** Provides the one-shot YAML JSON conversion entry point. */\n static toJSON(value, options = {})\n {\n return toJsonGraph(value, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Emit targets for this format (canonical frozen enum).\n */\n static Output = Object.freeze({\n JSON: OUTPUT_JSON,\n PAYLOAD: OUTPUT_PAYLOAD,\n RAW: OUTPUT_RAW,\n DOCUMENT: OUTPUT_DOCUMENT\n });\n static TAG_PRESERVE = TAG_PRESERVE;\n static TAG_REJECT = TAG_REJECT;\n static TAG_HANDLE = TAG_HANDLE;\n static id = \"yaml\";\n static extensions = Object.freeze([ \".yaml\", \".yml\" ]);\n static type = Object.freeze([ \"data\" ]);\n static mediaTypes = Object.freeze([ \"data\" ]);\n static inputTypes = Object.freeze([ \"yaml\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON, OUTPUT_PAYLOAD ]);\n static debugOutputTypes = Object.freeze([ OUTPUT_RAW, OUTPUT_DOCUMENT ]);\n}\n\nexport default CjsYamlFormat;\n"],"names":["FORMAT_NAME","CjsYamlFormat","DEFAULT_VALUES","constructor","options","SetValues","normalizeValues","GetValues","Read","input","read","ReadPayload","readPayload","ReadRaw","readRaw","ReadDocument","readDocument","Inspect","inspect","ToJSON","value","toJsonGraph","values","emit","OUTPUT_RAW","CjsYamlReader","OUTPUT_DOCUMENT","toJSON","Output","Object","freeze","JSON","OUTPUT_JSON","PAYLOAD","OUTPUT_PAYLOAD","RAW","DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","id","extensions","type","mediaTypes","inputTypes","outputTypes","debugOutputTypes"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AE,GAAG,MAAM;EAClB,OAAOC,UAAU,GAAGZ,MAAM,CAACC,MAAM,CAAC,CAAE,OAAO,EAAE,MAAM,CAAE,CAAC;EACtD,OAAOY,IAAI,GAAGb,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EACvC,OAAOa,UAAU,GAAGd,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAC7C,OAAOc,UAAU,GAAGf,MAAM,CAACC,MAAM,CAAC,CAAE,MAAM,CAAE,CAAC;EAC7C,OAAOe,WAAW,GAAGhB,MAAM,CAACC,MAAM,CAAC,CAAEE,WAAW,EAAEE,cAAc,CAAE,CAAC;EACnE,OAAOY,gBAAgB,GAAGjB,MAAM,CAACC,MAAM,CAAC,CAAEN,UAAU,EAAEE,eAAe,CAAE,CAAC;AAC5E;;;;"}
|
|
@@ -31,6 +31,10 @@ function defineMappingValue(target, key, value) {
|
|
|
31
31
|
* enforcing tag policy and alias limits.
|
|
32
32
|
*/
|
|
33
33
|
class CjsYamlReader extends CjsReader {
|
|
34
|
+
/**
|
|
35
|
+
* Creates a CjsYamlReader over caller-provided YAML bytes and reader
|
|
36
|
+
* options.
|
|
37
|
+
*/
|
|
34
38
|
constructor(input, options = {}) {
|
|
35
39
|
super(options);
|
|
36
40
|
if (typeof input !== "string") {
|
|
@@ -47,17 +51,28 @@ class CjsYamlReader extends CjsReader {
|
|
|
47
51
|
});
|
|
48
52
|
this.inventory = this.BuildInventory();
|
|
49
53
|
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Reads the primary public payload representation from the supplied input
|
|
57
|
+
* for the YAML document reader.
|
|
58
|
+
*/
|
|
50
59
|
Read() {
|
|
51
60
|
return this.ReadPayload();
|
|
52
61
|
}
|
|
62
|
+
|
|
63
|
+
/** Reads payload from the current YAML document reader. */
|
|
53
64
|
ReadPayload() {
|
|
54
65
|
return toJsonGraph(this.ReadRaw(), this.options);
|
|
55
66
|
}
|
|
67
|
+
|
|
68
|
+
/** Reads raw from the current YAML document reader. */
|
|
56
69
|
ReadRaw() {
|
|
57
70
|
this.AssertSyntax();
|
|
58
71
|
this.AssertAliasLimit();
|
|
59
72
|
return this.Convert(this.document.contents, new Map());
|
|
60
73
|
}
|
|
74
|
+
|
|
75
|
+
/** Reads document from the current YAML document reader. */
|
|
61
76
|
ReadDocument() {
|
|
62
77
|
let value = null;
|
|
63
78
|
const errors = this.inventory.errors.slice();
|
|
@@ -88,6 +103,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
88
103
|
errors
|
|
89
104
|
};
|
|
90
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns structural metadata without materializing the decoded payload for
|
|
109
|
+
* the YAML document reader.
|
|
110
|
+
*/
|
|
91
111
|
Inspect() {
|
|
92
112
|
return {
|
|
93
113
|
format: {
|
|
@@ -107,6 +127,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
107
127
|
errors: this.inventory.errors
|
|
108
128
|
};
|
|
109
129
|
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Classifies the root YAML node before conversion for the YAML document
|
|
133
|
+
* reader.
|
|
134
|
+
*/
|
|
110
135
|
RootKind() {
|
|
111
136
|
const node = this.document.contents;
|
|
112
137
|
if (node === null) return "null";
|
|
@@ -116,17 +141,32 @@ class CjsYamlReader extends CjsReader {
|
|
|
116
141
|
if (isAlias(node)) return "alias";
|
|
117
142
|
return "unknown";
|
|
118
143
|
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Validates syntax against YAML document reader constraints and throws on
|
|
147
|
+
* failure.
|
|
148
|
+
*/
|
|
119
149
|
AssertSyntax() {
|
|
120
150
|
if (!this.document.errors.length) return;
|
|
121
151
|
const first = this.document.errors[0];
|
|
122
152
|
const source = this.options.sourceName ? ` in ${this.options.sourceName}` : "";
|
|
123
153
|
throw new SyntaxError(`CjsYamlFormat${source}: ${displayMessage(first)}`);
|
|
124
154
|
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Validates alias limit against YAML document reader constraints and throws
|
|
158
|
+
* on failure.
|
|
159
|
+
*/
|
|
125
160
|
AssertAliasLimit() {
|
|
126
161
|
if (this.inventory.aliases.length <= this.options.maxAliasCount) return;
|
|
127
162
|
const source = this.options.sourceName ? ` in ${this.options.sourceName}` : "";
|
|
128
163
|
throw new RangeError(`CjsYamlFormat${source}: alias count ${this.inventory.aliases.length} exceeds maxAliasCount ${this.options.maxAliasCount}`);
|
|
129
164
|
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Converts the current value into the normalized YAML document reader
|
|
168
|
+
* representation.
|
|
169
|
+
*/
|
|
130
170
|
Convert(node, memo) {
|
|
131
171
|
if (node === null || node === undefined) return null;
|
|
132
172
|
if (isAlias(node)) {
|
|
@@ -172,6 +212,8 @@ class CjsYamlReader extends CjsReader {
|
|
|
172
212
|
}
|
|
173
213
|
return this.ConvertBase(node, memo, true);
|
|
174
214
|
}
|
|
215
|
+
|
|
216
|
+
/** Converts base into the normalized YAML document reader representation. */
|
|
175
217
|
ConvertBase(node, memo, memoize) {
|
|
176
218
|
if (isScalar(node)) return node.value;
|
|
177
219
|
if (isSeq(node)) {
|
|
@@ -196,25 +238,47 @@ class CjsYamlReader extends CjsReader {
|
|
|
196
238
|
}
|
|
197
239
|
throw this.NodeError(node, "unsupported YAML node");
|
|
198
240
|
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Converts a YAML mapping key into its JavaScript property representation
|
|
244
|
+
* for the YAML document reader.
|
|
245
|
+
*/
|
|
199
246
|
MapKey(node) {
|
|
200
247
|
if (!isScalar(node)) throw this.NodeError(node, "mapping keys must be scalar values");
|
|
201
248
|
return String(node.value);
|
|
202
249
|
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Converts a YAML custom-tag node through its registered handler for the
|
|
253
|
+
* YAML document reader.
|
|
254
|
+
*/
|
|
203
255
|
CustomTag(node) {
|
|
204
256
|
const tag = canonicalTag(node.tag);
|
|
205
257
|
return tag && !STANDARD_TAGS.has(tag) ? tag : null;
|
|
206
258
|
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Validates tag allowed against YAML document reader constraints and throws
|
|
262
|
+
* on failure.
|
|
263
|
+
*/
|
|
207
264
|
AssertTagAllowed(tag, node) {
|
|
208
265
|
if (!this.options.allowedTags) return;
|
|
209
266
|
const allowed = new Set(this.options.allowedTags.map(canonicalTag));
|
|
210
267
|
if (!allowed.has(tag)) throw this.NodeError(node, `custom tag "${tag}" is not in allowedTags`);
|
|
211
268
|
}
|
|
269
|
+
|
|
270
|
+
/** Finds tag handler in the current YAML document reader. */
|
|
212
271
|
FindTagHandler(tag) {
|
|
213
272
|
const handlers = this.options.tagHandlers;
|
|
214
273
|
const short = tag.startsWith(TAG_PREFIX) ? `!!${tag.slice(TAG_PREFIX.length)}` : tag;
|
|
215
274
|
if (handlers instanceof Map) return handlers.get(tag) || handlers.get(short) || null;
|
|
216
275
|
return handlers[tag] || handlers[short] || null;
|
|
217
276
|
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Builds the context passed to a YAML custom-tag handler for the YAML
|
|
280
|
+
* document reader.
|
|
281
|
+
*/
|
|
218
282
|
TagContext(tag, node) {
|
|
219
283
|
return {
|
|
220
284
|
tag,
|
|
@@ -222,6 +286,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
222
286
|
location: this.TagLocation(node)
|
|
223
287
|
};
|
|
224
288
|
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Creates a YAML conversion error annotated with node location for the YAML
|
|
292
|
+
* document reader.
|
|
293
|
+
*/
|
|
225
294
|
NodeError(node, message) {
|
|
226
295
|
const at = node && node.tag ? this.TagLocation(node) : this.Location(node);
|
|
227
296
|
const source = this.options.sourceName ? `${this.options.sourceName}:` : "";
|
|
@@ -231,6 +300,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
231
300
|
error.location = at;
|
|
232
301
|
return error;
|
|
233
302
|
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Returns normalized source-location metadata for a YAML node for the YAML
|
|
306
|
+
* document reader.
|
|
307
|
+
*/
|
|
234
308
|
Location(node) {
|
|
235
309
|
if (!node || !Array.isArray(node.range)) return null;
|
|
236
310
|
const pos = this.lineCounter.linePos(node.range[0]);
|
|
@@ -240,6 +314,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
240
314
|
column: pos.col
|
|
241
315
|
};
|
|
242
316
|
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Returns normalized source-location metadata for a YAML tag for the YAML
|
|
320
|
+
* document reader.
|
|
321
|
+
*/
|
|
243
322
|
TagLocation(node) {
|
|
244
323
|
const fallback = this.Location(node);
|
|
245
324
|
if (!fallback || !node.tag) return fallback;
|
|
@@ -256,6 +335,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
256
335
|
column: pos.col
|
|
257
336
|
};
|
|
258
337
|
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Builds a public description of error from the current YAML document
|
|
341
|
+
* reader.
|
|
342
|
+
*/
|
|
259
343
|
DescribeError(error) {
|
|
260
344
|
const linePos = error && error.linePos && error.linePos[0];
|
|
261
345
|
return {
|
|
@@ -267,6 +351,8 @@ class CjsYamlReader extends CjsReader {
|
|
|
267
351
|
} : null
|
|
268
352
|
};
|
|
269
353
|
}
|
|
354
|
+
|
|
355
|
+
/** Builds inventory for the current YAML document reader. */
|
|
270
356
|
BuildInventory() {
|
|
271
357
|
const tags = [];
|
|
272
358
|
const anchors = [];
|
|
@@ -298,6 +384,11 @@ class CjsYamlReader extends CjsReader {
|
|
|
298
384
|
errors: this.document.errors.map(error => this.DescribeError(error))
|
|
299
385
|
};
|
|
300
386
|
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Returns the public kind label for a YAML node for the YAML document
|
|
390
|
+
* reader.
|
|
391
|
+
*/
|
|
301
392
|
NodeKind(node) {
|
|
302
393
|
if (isMap(node)) return "mapping";
|
|
303
394
|
if (isSeq(node)) return "sequence";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsYamlReader.js","sources":["../../../../../src/formats/yaml/core/CjsYamlReader.js"],"sourcesContent":["import {\n LineCounter,\n isAlias,\n isMap,\n isScalar,\n isSeq,\n parseDocument,\n visit\n} from \"yaml\";\n\nimport { CjsReader } from \"../../../format/CjsReader.js\";\nimport { TAG_HANDLE, TAG_PRESERVE, TAG_REJECT, toJsonGraph } from \"./helpers.js\";\n\nconst TAG_PREFIX = \"tag:yaml.org,2002:\";\nconst PYTHON_TUPLE = `${TAG_PREFIX}python/tuple`;\nconst PYTHON_UNICODE = `${TAG_PREFIX}python/unicode`;\nconst PYTHON_PROJECTED_DECAL = `${TAG_PREFIX}python/object:paperDoll.ProjectedDecal`;\nconst PYTHON_PART_METADATA = `${TAG_PREFIX}python/object:paperDoll.AvatarPartMetaData`;\n\nconst STANDARD_TAGS = new Set([\n \"binary\", \"bool\", \"float\", \"int\", \"map\", \"merge\", \"null\", \"omap\",\n \"pairs\", \"seq\", \"set\", \"str\", \"timestamp\"\n].map(name => `${TAG_PREFIX}${name}`));\n\nfunction canonicalTag(tag)\n{\n if (typeof tag !== \"string\") return tag;\n if (tag.startsWith(\"!!\")) return `${TAG_PREFIX}${tag.slice(2)}`;\n return tag;\n}\n\nfunction displayMessage(error)\n{\n return String(error && error.message ? error.message : error).trim();\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\n/**\n * Construction-bound reader that parses one YAML source with the `yaml`\n * library and produces the format's payload, raw, or document graphs while\n * enforcing tag policy and alias limits.\n */\nexport class CjsYamlReader extends CjsReader\n{\n constructor(input, options = {})\n {\n super(options);\n\n if (typeof input !== \"string\")\n {\n throw new TypeError(\"CjsYamlFormat input must be a YAML string\");\n }\n\n this.source = input;\n this.lineCounter = new LineCounter();\n this.document = parseDocument(input, {\n keepSourceTokens: true,\n lineCounter: this.lineCounter,\n prettyErrors: true,\n strict: true,\n uniqueKeys: this.options.uniqueKeys\n });\n this.inventory = this.BuildInventory();\n }\n\n Read()\n {\n return this.ReadPayload();\n }\n\n ReadPayload()\n {\n return toJsonGraph(this.ReadRaw(), this.options);\n }\n\n ReadRaw()\n {\n this.AssertSyntax();\n this.AssertAliasLimit();\n return this.Convert(this.document.contents, new Map());\n }\n\n ReadDocument()\n {\n let value = null;\n const errors = this.inventory.errors.slice();\n\n if (!errors.length)\n {\n try\n {\n this.AssertAliasLimit();\n value = this.Convert(this.document.contents, new Map());\n }\n catch (error)\n {\n errors.push(this.DescribeError(error));\n }\n }\n\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n value,\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors\n };\n }\n\n Inspect()\n {\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors: this.inventory.errors\n };\n }\n\n RootKind()\n {\n const node = this.document.contents;\n if (node === null) return \"null\";\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n\n AssertSyntax()\n {\n if (!this.document.errors.length) return;\n const first = this.document.errors[0];\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new SyntaxError(`CjsYamlFormat${source}: ${displayMessage(first)}`);\n }\n\n AssertAliasLimit()\n {\n if (this.inventory.aliases.length <= this.options.maxAliasCount) return;\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new RangeError(`CjsYamlFormat${source}: alias count ${this.inventory.aliases.length} exceeds maxAliasCount ${this.options.maxAliasCount}`);\n }\n\n Convert(node, memo)\n {\n if (node === null || node === undefined) return null;\n\n if (isAlias(node))\n {\n const source = node.resolve(this.document);\n if (!source) throw this.NodeError(node, `unresolved alias \"${node.source}\"`);\n return this.Convert(source, memo);\n }\n\n if (memo.has(node)) return memo.get(node);\n\n const tag = this.CustomTag(node);\n if (tag)\n {\n this.AssertTagAllowed(tag, node);\n const handler = this.FindTagHandler(tag);\n\n if (handler)\n {\n const value = this.ConvertBase(node, memo, true);\n const handled = handler(value, this.TagContext(tag, node));\n memo.set(node, handled);\n return handled;\n }\n\n if (tag === PYTHON_TUPLE)\n {\n if (!isSeq(node)) throw this.NodeError(node, `${tag} must decorate a sequence`);\n return this.ConvertBase(node, memo, true);\n }\n\n if (tag === PYTHON_UNICODE)\n {\n if (!isScalar(node) || typeof node.value !== \"string\")\n {\n throw this.NodeError(node, `${tag} must decorate a string scalar`);\n }\n return node.value;\n }\n\n if (this.options.tagPolicy === TAG_REJECT)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" is rejected by tagPolicy`);\n }\n\n if (this.options.tagPolicy === TAG_HANDLE)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" has no explicit handler`);\n }\n\n if (this.options.tagPolicy === TAG_PRESERVE || tag === PYTHON_PROJECTED_DECAL || tag === PYTHON_PART_METADATA)\n {\n const wrapper = { [this.options.tagField]: tag };\n memo.set(node, wrapper);\n wrapper[this.options.valueField] = this.ConvertBase(node, memo, false);\n return wrapper;\n }\n }\n\n return this.ConvertBase(node, memo, true);\n }\n\n ConvertBase(node, memo, memoize)\n {\n if (isScalar(node)) return node.value;\n\n if (isSeq(node))\n {\n const out = [];\n if (memoize) memo.set(node, out);\n for (const item of node.items) out.push(this.Convert(item, memo));\n return out;\n }\n\n if (isMap(node))\n {\n const out = {};\n if (memoize) memo.set(node, out);\n for (const pair of node.items)\n {\n const key = this.MapKey(pair.key);\n if (this.options.uniqueKeys && Object.prototype.hasOwnProperty.call(out, key))\n {\n throw this.NodeError(pair.key, `duplicate mapping key \"${key}\"`);\n }\n // Defining the property prevents keys such as \"__proto__\" from\n // mutating the result object's prototype.\n defineMappingValue(out, key, this.Convert(pair.value, memo));\n }\n return out;\n }\n\n throw this.NodeError(node, \"unsupported YAML node\");\n }\n\n MapKey(node)\n {\n if (!isScalar(node)) throw this.NodeError(node, \"mapping keys must be scalar values\");\n return String(node.value);\n }\n\n CustomTag(node)\n {\n const tag = canonicalTag(node.tag);\n return tag && !STANDARD_TAGS.has(tag) ? tag : null;\n }\n\n AssertTagAllowed(tag, node)\n {\n if (!this.options.allowedTags) return;\n const allowed = new Set(this.options.allowedTags.map(canonicalTag));\n if (!allowed.has(tag)) throw this.NodeError(node, `custom tag \"${tag}\" is not in allowedTags`);\n }\n\n FindTagHandler(tag)\n {\n const handlers = this.options.tagHandlers;\n const short = tag.startsWith(TAG_PREFIX) ? `!!${tag.slice(TAG_PREFIX.length)}` : tag;\n if (handlers instanceof Map) return handlers.get(tag) || handlers.get(short) || null;\n return handlers[tag] || handlers[short] || null;\n }\n\n TagContext(tag, node)\n {\n return {\n tag,\n sourceName: this.options.sourceName,\n location: this.TagLocation(node)\n };\n }\n\n NodeError(node, message)\n {\n const at = node && node.tag ? this.TagLocation(node) : this.Location(node);\n const source = this.options.sourceName ? `${this.options.sourceName}:` : \"\";\n const where = at ? `${source}${at.line}:${at.column}` : (this.options.sourceName || \"YAML input\");\n const error = new Error(`CjsYamlFormat ${where}: ${message}`);\n error.code = \"YAML_TAG_POLICY\";\n error.location = at;\n return error;\n }\n\n Location(node)\n {\n if (!node || !Array.isArray(node.range)) return null;\n const pos = this.lineCounter.linePos(node.range[0]);\n return { offset: node.range[0], line: pos.line, column: pos.col };\n }\n\n TagLocation(node)\n {\n const fallback = this.Location(node);\n if (!fallback || !node.tag) return fallback;\n\n const lineStart = this.source.lastIndexOf(\"\\n\", node.range[0] - 1) + 1;\n const prefix = this.source.slice(lineStart, node.range[0]);\n const tags = [ ...prefix.matchAll(/!<[^>]+>|!!?[^\\s[\\]{},]+/g) ];\n const match = tags[tags.length - 1];\n if (!match) return fallback;\n\n const offset = lineStart + match.index;\n const pos = this.lineCounter.linePos(offset);\n return { offset, line: pos.line, column: pos.col };\n }\n\n DescribeError(error)\n {\n const linePos = error && error.linePos && error.linePos[0];\n return {\n code: error && error.code ? error.code : \"YAML_ERROR\",\n message: displayMessage(error),\n location: error && error.location ? error.location : (linePos ? {\n line: linePos.line,\n column: linePos.col\n } : null)\n };\n }\n\n BuildInventory()\n {\n const tags = [];\n const anchors = [];\n const aliases = [];\n\n visit(this.document, (_key, node) =>\n {\n if (!node || typeof node !== \"object\") return;\n const tag = this.CustomTag(node);\n const location = tag ? this.TagLocation(node) : this.Location(node);\n if (tag) tags.push({ tag, kind: this.NodeKind(node), location });\n if (node.anchor) anchors.push({ name: node.anchor, kind: this.NodeKind(node), location });\n if (isAlias(node)) aliases.push({ name: node.source, location });\n });\n\n return {\n tags,\n anchors,\n aliases,\n warnings: this.document.warnings.map(error => this.DescribeError(error)),\n errors: this.document.errors.map(error => this.DescribeError(error))\n };\n }\n\n NodeKind(node)\n {\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n}\n\nexport default CjsYamlReader;\n"],"names":["TAG_PREFIX","PYTHON_TUPLE","PYTHON_UNICODE","PYTHON_PROJECTED_DECAL","PYTHON_PART_METADATA","STANDARD_TAGS","Set","map","name","canonicalTag","tag","startsWith","slice","displayMessage","error","String","message","trim","defineMappingValue","target","key","value","Object","defineProperty","enumerable","configurable","writable","CjsYamlReader","CjsReader","constructor","input","options","TypeError","source","lineCounter","LineCounter","document","parseDocument","keepSourceTokens","prettyErrors","strict","uniqueKeys","inventory","BuildInventory","Read","ReadPayload","toJsonGraph","ReadRaw","AssertSyntax","AssertAliasLimit","Convert","contents","Map","ReadDocument","errors","length","push","DescribeError","format","id","sourceName","root","kind","RootKind","tags","anchors","aliases","warnings","Inspect","node","isMap","isSeq","isScalar","isAlias","first","SyntaxError","maxAliasCount","RangeError","memo","undefined","resolve","NodeError","has","get","CustomTag","AssertTagAllowed","handler","FindTagHandler","ConvertBase","handled","TagContext","set","tagPolicy","TAG_REJECT","TAG_HANDLE","TAG_PRESERVE","wrapper","tagField","valueField","memoize","out","item","items","pair","MapKey","prototype","hasOwnProperty","call","allowedTags","allowed","handlers","tagHandlers","short","location","TagLocation","at","Location","where","line","column","Error","code","Array","isArray","range","pos","linePos","offset","col","fallback","lineStart","lastIndexOf","prefix","matchAll","match","index","visit","_key","NodeKind","anchor"],"mappings":";;;;AAaA,MAAMA,UAAU,GAAG,oBAAoB;AACvC,MAAMC,YAAY,GAAG,CAAA,EAAGD,UAAU,CAAA,YAAA,CAAc;AAChD,MAAME,cAAc,GAAG,CAAA,EAAGF,UAAU,CAAA,cAAA,CAAgB;AACpD,MAAMG,sBAAsB,GAAG,CAAA,EAAGH,UAAU,CAAA,sCAAA,CAAwC;AACpF,MAAMI,oBAAoB,GAAG,CAAA,EAAGJ,UAAU,CAAA,0CAAA,CAA4C;AAEtF,MAAMK,aAAa,GAAG,IAAIC,GAAG,CAAC,CAC1B,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAChE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAC5C,CAACC,GAAG,CAACC,IAAI,IAAI,CAAA,EAAGR,UAAU,GAAGQ,IAAI,CAAA,CAAE,CAAC,CAAC;AAEtC,SAASC,YAAYA,CAACC,GAAG,EACzB;AACI,EAAA,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAOA,GAAG;AACvC,EAAA,IAAIA,GAAG,CAACC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA,EAAGX,UAAU,GAAGU,GA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,IAAI,CAAC;AAAE4C,QAAAA;AAAS,OAAC,CAAC;AAChE,MAAA,IAAI5C,IAAI,CAACsE,MAAM,EAAE1E,OAAO,CAACT,IAAI,CAAC;QAAEhD,IAAI,EAAE6D,IAAI,CAACsE,MAAM;AAAE7E,QAAAA,IAAI,EAAE,IAAI,CAAC4E,QAAQ,CAACrE,IAAI,CAAC;AAAE4C,QAAAA;AAAS,OAAC,CAAC;MACzF,IAAIxC,OAAO,CAACJ,IAAI,CAAC,EAAEH,OAAO,CAACV,IAAI,CAAC;QAAEhD,IAAI,EAAE6D,IAAI,CAACpC,MAAM;AAAEgF,QAAAA;AAAS,OAAC,CAAC;AACpE,IAAA,CAAC,CAAC;IAEF,OAAO;MACHjD,IAAI;MACJC,OAAO;MACPC,OAAO;AACPC,MAAAA,QAAQ,EAAE,IAAI,CAAC/B,QAAQ,CAAC+B,QAAQ,CAAC5D,GAAG,CAACO,KAAK,IAAI,IAAI,CAAC2C,aAAa,CAAC3C,KAAK,CAAC,CAAC;AACxEwC,MAAAA,MAAM,EAAE,IAAI,CAAClB,QAAQ,CAACkB,MAAM,CAAC/C,GAAG,CAACO,KAAK,IAAI,IAAI,CAAC2C,aAAa,CAAC3C,KAAK,CAAC;KACtE;AACL,EAAA;EAEA4H,QAAQA,CAACrE,IAAI,EACb;AACI,IAAA,IAAIC,KAAK,CAACD,IAAI,CAAC,EAAE,OAAO,SAAS;AACjC,IAAA,IAAIE,KAAK,CAACF,IAAI,CAAC,EAAE,OAAO,UAAU;AAClC,IAAA,IAAIG,QAAQ,CAACH,IAAI,CAAC,EAAE,OAAO,QAAQ;AACnC,IAAA,IAAII,OAAO,CAACJ,IAAI,CAAC,EAAE,OAAO,OAAO;AACjC,IAAA,OAAO,SAAS;AACpB,EAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"CjsYamlReader.js","sources":["../../../../../src/formats/yaml/core/CjsYamlReader.js"],"sourcesContent":["import {\n LineCounter,\n isAlias,\n isMap,\n isScalar,\n isSeq,\n parseDocument,\n visit\n} from \"yaml\";\n\nimport { CjsReader } from \"../../../format/CjsReader.js\";\nimport { TAG_HANDLE, TAG_PRESERVE, TAG_REJECT, toJsonGraph } from \"./helpers.js\";\n\nconst TAG_PREFIX = \"tag:yaml.org,2002:\";\nconst PYTHON_TUPLE = `${TAG_PREFIX}python/tuple`;\nconst PYTHON_UNICODE = `${TAG_PREFIX}python/unicode`;\nconst PYTHON_PROJECTED_DECAL = `${TAG_PREFIX}python/object:paperDoll.ProjectedDecal`;\nconst PYTHON_PART_METADATA = `${TAG_PREFIX}python/object:paperDoll.AvatarPartMetaData`;\n\nconst STANDARD_TAGS = new Set([\n \"binary\", \"bool\", \"float\", \"int\", \"map\", \"merge\", \"null\", \"omap\",\n \"pairs\", \"seq\", \"set\", \"str\", \"timestamp\"\n].map(name => `${TAG_PREFIX}${name}`));\n\nfunction canonicalTag(tag)\n{\n if (typeof tag !== \"string\") return tag;\n if (tag.startsWith(\"!!\")) return `${TAG_PREFIX}${tag.slice(2)}`;\n return tag;\n}\n\nfunction displayMessage(error)\n{\n return String(error && error.message ? error.message : error).trim();\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\n/**\n * Construction-bound reader that parses one YAML source with the `yaml`\n * library and produces the format's payload, raw, or document graphs while\n * enforcing tag policy and alias limits.\n */\nexport class CjsYamlReader extends CjsReader\n{\n /**\n * Creates a CjsYamlReader over caller-provided YAML bytes and reader\n * options.\n */\n constructor(input, options = {})\n {\n super(options);\n\n if (typeof input !== \"string\")\n {\n throw new TypeError(\"CjsYamlFormat input must be a YAML string\");\n }\n\n this.source = input;\n this.lineCounter = new LineCounter();\n this.document = parseDocument(input, {\n keepSourceTokens: true,\n lineCounter: this.lineCounter,\n prettyErrors: true,\n strict: true,\n uniqueKeys: this.options.uniqueKeys\n });\n this.inventory = this.BuildInventory();\n }\n\n /**\n * Reads the primary public payload representation from the supplied input\n * for the YAML document reader.\n */\n Read()\n {\n return this.ReadPayload();\n }\n\n /** Reads payload from the current YAML document reader. */\n ReadPayload()\n {\n return toJsonGraph(this.ReadRaw(), this.options);\n }\n\n /** Reads raw from the current YAML document reader. */\n ReadRaw()\n {\n this.AssertSyntax();\n this.AssertAliasLimit();\n return this.Convert(this.document.contents, new Map());\n }\n\n /** Reads document from the current YAML document reader. */\n ReadDocument()\n {\n let value = null;\n const errors = this.inventory.errors.slice();\n\n if (!errors.length)\n {\n try\n {\n this.AssertAliasLimit();\n value = this.Convert(this.document.contents, new Map());\n }\n catch (error)\n {\n errors.push(this.DescribeError(error));\n }\n }\n\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n value,\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors\n };\n }\n\n /**\n * Returns structural metadata without materializing the decoded payload for\n * the YAML document reader.\n */\n Inspect()\n {\n return {\n format: { id: \"yaml\" },\n source: { name: this.options.sourceName, length: this.source.length },\n root: { kind: this.RootKind() },\n tags: this.inventory.tags,\n anchors: this.inventory.anchors,\n aliases: this.inventory.aliases,\n warnings: this.inventory.warnings,\n errors: this.inventory.errors\n };\n }\n\n /**\n * Classifies the root YAML node before conversion for the YAML document\n * reader.\n */\n RootKind()\n {\n const node = this.document.contents;\n if (node === null) return \"null\";\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n\n /**\n * Validates syntax against YAML document reader constraints and throws on\n * failure.\n */\n AssertSyntax()\n {\n if (!this.document.errors.length) return;\n const first = this.document.errors[0];\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new SyntaxError(`CjsYamlFormat${source}: ${displayMessage(first)}`);\n }\n\n /**\n * Validates alias limit against YAML document reader constraints and throws\n * on failure.\n */\n AssertAliasLimit()\n {\n if (this.inventory.aliases.length <= this.options.maxAliasCount) return;\n const source = this.options.sourceName ? ` in ${this.options.sourceName}` : \"\";\n throw new RangeError(`CjsYamlFormat${source}: alias count ${this.inventory.aliases.length} exceeds maxAliasCount ${this.options.maxAliasCount}`);\n }\n\n /**\n * Converts the current value into the normalized YAML document reader\n * representation.\n */\n Convert(node, memo)\n {\n if (node === null || node === undefined) return null;\n\n if (isAlias(node))\n {\n const source = node.resolve(this.document);\n if (!source) throw this.NodeError(node, `unresolved alias \"${node.source}\"`);\n return this.Convert(source, memo);\n }\n\n if (memo.has(node)) return memo.get(node);\n\n const tag = this.CustomTag(node);\n if (tag)\n {\n this.AssertTagAllowed(tag, node);\n const handler = this.FindTagHandler(tag);\n\n if (handler)\n {\n const value = this.ConvertBase(node, memo, true);\n const handled = handler(value, this.TagContext(tag, node));\n memo.set(node, handled);\n return handled;\n }\n\n if (tag === PYTHON_TUPLE)\n {\n if (!isSeq(node)) throw this.NodeError(node, `${tag} must decorate a sequence`);\n return this.ConvertBase(node, memo, true);\n }\n\n if (tag === PYTHON_UNICODE)\n {\n if (!isScalar(node) || typeof node.value !== \"string\")\n {\n throw this.NodeError(node, `${tag} must decorate a string scalar`);\n }\n return node.value;\n }\n\n if (this.options.tagPolicy === TAG_REJECT)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" is rejected by tagPolicy`);\n }\n\n if (this.options.tagPolicy === TAG_HANDLE)\n {\n throw this.NodeError(node, `custom tag \"${tag}\" has no explicit handler`);\n }\n\n if (this.options.tagPolicy === TAG_PRESERVE || tag === PYTHON_PROJECTED_DECAL || tag === PYTHON_PART_METADATA)\n {\n const wrapper = { [this.options.tagField]: tag };\n memo.set(node, wrapper);\n wrapper[this.options.valueField] = this.ConvertBase(node, memo, false);\n return wrapper;\n }\n }\n\n return this.ConvertBase(node, memo, true);\n }\n\n /** Converts base into the normalized YAML document reader representation. */\n ConvertBase(node, memo, memoize)\n {\n if (isScalar(node)) return node.value;\n\n if (isSeq(node))\n {\n const out = [];\n if (memoize) memo.set(node, out);\n for (const item of node.items) out.push(this.Convert(item, memo));\n return out;\n }\n\n if (isMap(node))\n {\n const out = {};\n if (memoize) memo.set(node, out);\n for (const pair of node.items)\n {\n const key = this.MapKey(pair.key);\n if (this.options.uniqueKeys && Object.prototype.hasOwnProperty.call(out, key))\n {\n throw this.NodeError(pair.key, `duplicate mapping key \"${key}\"`);\n }\n // Defining the property prevents keys such as \"__proto__\" from\n // mutating the result object's prototype.\n defineMappingValue(out, key, this.Convert(pair.value, memo));\n }\n return out;\n }\n\n throw this.NodeError(node, \"unsupported YAML node\");\n }\n\n /**\n * Converts a YAML mapping key into its JavaScript property representation\n * for the YAML document reader.\n */\n MapKey(node)\n {\n if (!isScalar(node)) throw this.NodeError(node, \"mapping keys must be scalar values\");\n return String(node.value);\n }\n\n /**\n * Converts a YAML custom-tag node through its registered handler for the\n * YAML document reader.\n */\n CustomTag(node)\n {\n const tag = canonicalTag(node.tag);\n return tag && !STANDARD_TAGS.has(tag) ? tag : null;\n }\n\n /**\n * Validates tag allowed against YAML document reader constraints and throws\n * on failure.\n */\n AssertTagAllowed(tag, node)\n {\n if (!this.options.allowedTags) return;\n const allowed = new Set(this.options.allowedTags.map(canonicalTag));\n if (!allowed.has(tag)) throw this.NodeError(node, `custom tag \"${tag}\" is not in allowedTags`);\n }\n\n /** Finds tag handler in the current YAML document reader. */\n FindTagHandler(tag)\n {\n const handlers = this.options.tagHandlers;\n const short = tag.startsWith(TAG_PREFIX) ? `!!${tag.slice(TAG_PREFIX.length)}` : tag;\n if (handlers instanceof Map) return handlers.get(tag) || handlers.get(short) || null;\n return handlers[tag] || handlers[short] || null;\n }\n\n /**\n * Builds the context passed to a YAML custom-tag handler for the YAML\n * document reader.\n */\n TagContext(tag, node)\n {\n return {\n tag,\n sourceName: this.options.sourceName,\n location: this.TagLocation(node)\n };\n }\n\n /**\n * Creates a YAML conversion error annotated with node location for the YAML\n * document reader.\n */\n NodeError(node, message)\n {\n const at = node && node.tag ? this.TagLocation(node) : this.Location(node);\n const source = this.options.sourceName ? `${this.options.sourceName}:` : \"\";\n const where = at ? `${source}${at.line}:${at.column}` : (this.options.sourceName || \"YAML input\");\n const error = new Error(`CjsYamlFormat ${where}: ${message}`);\n error.code = \"YAML_TAG_POLICY\";\n error.location = at;\n return error;\n }\n\n /**\n * Returns normalized source-location metadata for a YAML node for the YAML\n * document reader.\n */\n Location(node)\n {\n if (!node || !Array.isArray(node.range)) return null;\n const pos = this.lineCounter.linePos(node.range[0]);\n return { offset: node.range[0], line: pos.line, column: pos.col };\n }\n\n /**\n * Returns normalized source-location metadata for a YAML tag for the YAML\n * document reader.\n */\n TagLocation(node)\n {\n const fallback = this.Location(node);\n if (!fallback || !node.tag) return fallback;\n\n const lineStart = this.source.lastIndexOf(\"\\n\", node.range[0] - 1) + 1;\n const prefix = this.source.slice(lineStart, node.range[0]);\n const tags = [ ...prefix.matchAll(/!<[^>]+>|!!?[^\\s[\\]{},]+/g) ];\n const match = tags[tags.length - 1];\n if (!match) return fallback;\n\n const offset = lineStart + match.index;\n const pos = this.lineCounter.linePos(offset);\n return { offset, line: pos.line, column: pos.col };\n }\n\n /**\n * Builds a public description of error from the current YAML document\n * reader.\n */\n DescribeError(error)\n {\n const linePos = error && error.linePos && error.linePos[0];\n return {\n code: error && error.code ? error.code : \"YAML_ERROR\",\n message: displayMessage(error),\n location: error && error.location ? error.location : (linePos ? {\n line: linePos.line,\n column: linePos.col\n } : null)\n };\n }\n\n /** Builds inventory for the current YAML document reader. */\n BuildInventory()\n {\n const tags = [];\n const anchors = [];\n const aliases = [];\n\n visit(this.document, (_key, node) =>\n {\n if (!node || typeof node !== \"object\") return;\n const tag = this.CustomTag(node);\n const location = tag ? this.TagLocation(node) : this.Location(node);\n if (tag) tags.push({ tag, kind: this.NodeKind(node), location });\n if (node.anchor) anchors.push({ name: node.anchor, kind: this.NodeKind(node), location });\n if (isAlias(node)) aliases.push({ name: node.source, location });\n });\n\n return {\n tags,\n anchors,\n aliases,\n warnings: this.document.warnings.map(error => this.DescribeError(error)),\n errors: this.document.errors.map(error => this.DescribeError(error))\n };\n }\n\n /**\n * Returns the public kind label for a YAML node for the YAML document\n * reader.\n */\n NodeKind(node)\n {\n if (isMap(node)) return \"mapping\";\n if (isSeq(node)) return \"sequence\";\n if (isScalar(node)) return \"scalar\";\n if (isAlias(node)) return \"alias\";\n return \"unknown\";\n }\n}\n\nexport default CjsYamlReader;\n"],"names":["TAG_PREFIX","PYTHON_TUPLE","PYTHON_UNICODE","PYTHON_PROJECTED_DECAL","PYTHON_PART_METADATA","STANDARD_TAGS","Set","map","name","canonicalTag","tag","startsWith","slice","displayMessage","error","String","message","trim","defineMappingValue","target","key","value","Object","defineProperty","enumerable","configurable","writable","CjsYamlReader","CjsReader","constructor","input","options","TypeError","source","lineCounter","LineCounter","document","parseDocument","keepSourceTokens","prettyErrors","strict","uniqueKeys","inventory","BuildInventory","Read","ReadPayload","toJsonGraph","ReadRaw","AssertSyntax","AssertAliasLimit","Convert","contents","Map","ReadDocument","errors","length","push","DescribeError","format","id","sourceName","root","kind","RootKind","tags","anchors","aliases","warnings","Inspect","node","isMap","isSeq","isScalar","isAlias","first","SyntaxError","maxAliasCount","RangeError","memo","undefined","resolve","NodeError","has","get","CustomTag","AssertTagAllowed","handler","FindTagHandler","ConvertBase","handled","TagContext","set","tagPolicy","TAG_REJECT","TAG_HANDLE","TAG_PRESERVE","wrapper","tagField","valueField","memoize","out","item","items","pair","MapKey","prototype","hasOwnProperty","call","allowedTags","allowed","handlers","tagHandlers","short","location","TagLocation","at","Location","where","line","column","Error","code","Array","isArray","range","pos","linePos","offset","col","fallback","lineStart","lastIndexOf","prefix","matchAll","match","index","visit","_key","NodeKind","anchor"],"mappings":";;;;AAaA,MAAMA,UAAU,GAAG,oBAAoB;AACvC,MAAMC,YAAY,GAAG,CAAA,EAAGD,UAAU,CAAA,YAAA,CAAc;AAChD,MAAME,cAAc,GAAG,CAA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Q,CAACrE,IAAI,CAAC;AAAE4C,QAAAA;AAAS,OAAC,CAAC;MACzF,IAAIxC,OAAO,CAACJ,IAAI,CAAC,EAAEH,OAAO,CAACV,IAAI,CAAC;QAAEhD,IAAI,EAAE6D,IAAI,CAACpC,MAAM;AAAEgF,QAAAA;AAAS,OAAC,CAAC;AACpE,IAAA,CAAC,CAAC;IAEF,OAAO;MACHjD,IAAI;MACJC,OAAO;MACPC,OAAO;AACPC,MAAAA,QAAQ,EAAE,IAAI,CAAC/B,QAAQ,CAAC+B,QAAQ,CAAC5D,GAAG,CAACO,KAAK,IAAI,IAAI,CAAC2C,aAAa,CAAC3C,KAAK,CAAC,CAAC;AACxEwC,MAAAA,MAAM,EAAE,IAAI,CAAClB,QAAQ,CAACkB,MAAM,CAAC/C,GAAG,CAACO,KAAK,IAAI,IAAI,CAAC2C,aAAa,CAAC3C,KAAK,CAAC;KACtE;AACL,EAAA;;AAEA;AACJ;AACA;AACA;EACI4H,QAAQA,CAACrE,IAAI,EACb;AACI,IAAA,IAAIC,KAAK,CAACD,IAAI,CAAC,EAAE,OAAO,SAAS;AACjC,IAAA,IAAIE,KAAK,CAACF,IAAI,CAAC,EAAE,OAAO,UAAU;AAClC,IAAA,IAAIG,QAAQ,CAACH,IAAI,CAAC,EAAE,OAAO,QAAQ;AACnC,IAAA,IAAII,OAAO,CAACJ,IAAI,CAAC,EAAE,OAAO,OAAO;AACjC,IAAA,OAAO,SAAS;AACpB,EAAA;AACJ;;;;"}
|
|
@@ -78,6 +78,11 @@ function normalizeBoolean(value, name, readerName) {
|
|
|
78
78
|
if (typeof value !== "boolean") throw new TypeError(`${readerName} ${name} must be a boolean`);
|
|
79
79
|
return value;
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Normalizes reader options against their supported defaults for the YAML
|
|
84
|
+
* document reader.
|
|
85
|
+
*/
|
|
81
86
|
function normalizeValues(base, options = {}, readerName = "CjsYamlFormat") {
|
|
82
87
|
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
|
83
88
|
throw new TypeError(`${readerName} options must be an object`);
|
|
@@ -111,6 +116,11 @@ function normalizeValues(base, options = {}, readerName = "CjsYamlFormat") {
|
|
|
111
116
|
}
|
|
112
117
|
return values;
|
|
113
118
|
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Converts a YAML node graph into JSON-safe values while preserving references
|
|
122
|
+
* for the YAML document reader.
|
|
123
|
+
*/
|
|
114
124
|
function toJsonGraph(value, options) {
|
|
115
125
|
const counts = new WeakMap();
|
|
116
126
|
const traversed = new WeakSet();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../../src/formats/yaml/core/helpers.js"],"sourcesContent":["export const OUTPUT_JSON = \"json\";\nexport const OUTPUT_PAYLOAD = \"payload\";\nexport const OUTPUT_RAW = \"raw\";\nexport const OUTPUT_DOCUMENT = \"document\";\n\nexport const TAG_PRESERVE = \"preserve\";\nexport const TAG_REJECT = \"reject\";\nexport const TAG_HANDLE = \"handle\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_PAYLOAD,\n tagPolicy: TAG_PRESERVE,\n allowedTags: null,\n tagHandlers: Object.freeze({}),\n sourceName: null,\n maxAliasCount: 100,\n uniqueKeys: true,\n idField: \"$yamlId\",\n refField: \"$yamlRef\",\n valuesField: \"$yamlValues\",\n tagField: \"$yamlTag\",\n valueField: \"$yamlValue\"\n});\n\nconst OPTION_KEYS = new Set(Object.keys(DEFAULT_VALUES));\n\nfunction hasOwn(value, key)\n{\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\nfunction normalizeEmit(value, readerName)\n{\n if (value === OUTPUT_JSON || value === OUTPUT_PAYLOAD) return value;\n if (value === OUTPUT_RAW || value === OUTPUT_DOCUMENT) return value;\n throw new TypeError(`${readerName} unknown emit value \"${value}\"`);\n}\n\nfunction normalizeTagPolicy(value, readerName)\n{\n if (value === TAG_PRESERVE || value === TAG_REJECT || value === TAG_HANDLE) return value;\n throw new TypeError(`${readerName} unknown tagPolicy value \"${value}\"`);\n}\n\nfunction normalizeAllowedTags(value, readerName)\n{\n if (value === null || value === undefined) return null;\n if (!Array.isArray(value) && !(value instanceof Set))\n {\n throw new TypeError(`${readerName} allowedTags must be an array, Set, or null`);\n }\n return [ ...value ];\n}\n\nfunction normalizeTagHandlers(value, readerName)\n{\n if (value instanceof Map)\n {\n for (const [ tag, handler ] of value)\n {\n if (typeof handler !== \"function\")\n {\n throw new TypeError(`${readerName} tag handler \"${tag}\" must be a function`);\n }\n }\n return new Map(value);\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value))\n {\n throw new TypeError(`${readerName} tagHandlers must be an object or Map`);\n }\n for (const [ tag, handler ] of Object.entries(value))\n {\n if (typeof handler !== \"function\")\n {\n throw new TypeError(`${readerName} tag handler \"${tag}\" must be a function`);\n }\n }\n return { ...value };\n}\n\nfunction normalizeField(value, name, readerName)\n{\n if (typeof value !== \"string\" || !value)\n {\n throw new TypeError(`${readerName} ${name} must be a non-empty string`);\n }\n return value;\n}\n\nfunction normalizeBoolean(value, name, readerName)\n{\n if (typeof value !== \"boolean\") throw new TypeError(`${readerName} ${name} must be a boolean`);\n return value;\n}\n\nexport function normalizeValues(base, options = {}, readerName = \"CjsYamlFormat\")\n{\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(`${readerName} options must be an object`);\n }\n\n for (const key of Object.keys(options))\n {\n if (!OPTION_KEYS.has(key)) throw new TypeError(`${readerName} unknown option \"${key}\"`);\n }\n\n const values = {\n ...base,\n allowedTags: base.allowedTags ? [ ...base.allowedTags ] : null,\n tagHandlers: base.tagHandlers instanceof Map ? new Map(base.tagHandlers) : { ...base.tagHandlers }\n };\n\n if (hasOwn(options, \"emit\")) values.emit = normalizeEmit(options.emit, readerName);\n if (hasOwn(options, \"tagPolicy\")) values.tagPolicy = normalizeTagPolicy(options.tagPolicy, readerName);\n if (hasOwn(options, \"allowedTags\")) values.allowedTags = normalizeAllowedTags(options.allowedTags, readerName);\n if (hasOwn(options, \"tagHandlers\")) values.tagHandlers = normalizeTagHandlers(options.tagHandlers, readerName);\n if (hasOwn(options, \"sourceName\")) values.sourceName = options.sourceName == null ? null : String(options.sourceName);\n if (hasOwn(options, \"maxAliasCount\"))\n {\n if (!Number.isInteger(options.maxAliasCount) || options.maxAliasCount < 0)\n {\n throw new TypeError(`${readerName} maxAliasCount must be a non-negative integer`);\n }\n values.maxAliasCount = options.maxAliasCount;\n }\n if (hasOwn(options, \"uniqueKeys\"))\n {\n values.uniqueKeys = normalizeBoolean(options.uniqueKeys, \"uniqueKeys\", readerName);\n }\n\n for (const name of [ \"idField\", \"refField\", \"valuesField\", \"tagField\", \"valueField\" ])\n {\n if (hasOwn(options, name)) values[name] = normalizeField(options[name], name, readerName);\n }\n\n return values;\n}\n\nexport function toJsonGraph(value, options)\n{\n const counts = new WeakMap();\n const traversed = new WeakSet();\n\n const count = (node) =>\n {\n if (!node || typeof node !== \"object\") return;\n counts.set(node, (counts.get(node) || 0) + 1);\n if (traversed.has(node)) return;\n traversed.add(node);\n if (Array.isArray(node)) node.forEach(count);\n else Object.keys(node).forEach(key => count(node[key]));\n };\n count(value);\n\n const ids = new WeakMap();\n let nextId = 1;\n\n const encode = (node) =>\n {\n if (node === null || typeof node !== \"object\") return node;\n if (ArrayBuffer.isView(node)) return Array.from(node, encode);\n if (node instanceof Date) return node.toISOString();\n\n const repeated = (counts.get(node) || 0) > 1;\n if (ids.has(node)) return { [options.refField]: ids.get(node) };\n\n let id = null;\n if (repeated)\n {\n id = nextId++;\n ids.set(node, id);\n }\n\n if (Array.isArray(node))\n {\n const values = node.map(encode);\n return repeated ? { [options.idField]: id, [options.valuesField]: values } : values;\n }\n\n if (repeated && Object.prototype.hasOwnProperty.call(node, options.idField))\n {\n throw new TypeError(`CjsYamlFormat cannot encode repeated mapping: reserved field \"${options.idField}\" already exists`);\n }\n\n const out = repeated ? { [options.idField]: id } : {};\n for (const key of Object.keys(node)) defineMappingValue(out, key, encode(node[key]));\n return out;\n };\n\n return encode(value);\n}\n"],"names":["OUTPUT_JSON","OUTPUT_PAYLOAD","OUTPUT_RAW","OUTPUT_DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","DEFAULT_VALUES","Object","freeze","emit","tagPolicy","allowedTags","tagHandlers","sourceName","maxAliasCount","uniqueKeys","idField","refField","valuesField","tagField","valueField","OPTION_KEYS","Set","keys","hasOwn","value","key","prototype","hasOwnProperty","call","defineMappingValue","target","defineProperty","enumerable","configurable","writable","normalizeEmit","readerName","TypeError","normalizeTagPolicy","normalizeAllowedTags","undefined","Array","isArray","normalizeTagHandlers","Map","tag","handler","entries","normalizeField","name","normalizeBoolean","normalizeValues","base","options","has","values","String","Number","isInteger","toJsonGraph","counts","WeakMap","traversed","WeakSet","count","node","set","get","add","forEach","ids","nextId","encode","ArrayBuffer","isView","from","Date","toISOString","repeated","id","map","out"],"mappings":"AAAO,MAAMA,WAAW,GAAG;AACpB,MAAMC,cAAc,GAAG;AACvB,MAAMC,UAAU,GAAG;AACnB,MAAMC,eAAe,GAAG;AAExB,MAAMC,YAAY,GAAG;AACrB,MAAMC,UAAU,GAAG;AACnB,MAAMC,UAAU,GAAG;MAEbC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAET,cAAc;AACpBU,EAAAA,SAAS,EAAEP,YAAY;AACvBQ,EAAAA,WAAW,EAAE,IAAI;AACjBC,EAAAA,WAAW,EAAEL,MAAM,CAACC,MAAM,CAAC,EAAE,CAAC;AAC9BK,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,aAAa,EAAE,GAAG;AAClBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,QAAQ,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AS,CAACC,cAAc,CAACC,IAAI,CAACqC,IAAI,EAAEZ,OAAO,CAACtC,OAAO,CAAC,EAC3E;MACI,MAAM,IAAIsB,SAAS,CAAC,CAAA,8DAAA,EAAiEgB,OAAO,CAACtC,OAAO,kBAAkB,CAAC;AAC3H,IAAA;IAEA,MAAMkE,GAAG,GAAGH,QAAQ,GAAG;MAAE,CAACzB,OAAO,CAACtC,OAAO,GAAGgE;KAAI,GAAG,EAAE;IACrD,KAAK,MAAMtD,GAAG,IAAInB,MAAM,CAACgB,IAAI,CAAC2C,IAAI,CAAC,EAAEpC,kBAAkB,CAACoD,GAAG,EAAExD,GAAG,EAAE+C,MAAM,CAACP,IAAI,CAACxC,GAAG,CAAC,CAAC,CAAC;AACpF,IAAA,OAAOwD,GAAG;EACd,CAAC;EAED,OAAOT,MAAM,CAAChD,KAAK,CAAC;AACxB;;;;"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../../../../../src/formats/yaml/core/helpers.js"],"sourcesContent":["export const OUTPUT_JSON = \"json\";\nexport const OUTPUT_PAYLOAD = \"payload\";\nexport const OUTPUT_RAW = \"raw\";\nexport const OUTPUT_DOCUMENT = \"document\";\n\nexport const TAG_PRESERVE = \"preserve\";\nexport const TAG_REJECT = \"reject\";\nexport const TAG_HANDLE = \"handle\";\n\nexport const DEFAULT_VALUES = Object.freeze({\n emit: OUTPUT_PAYLOAD,\n tagPolicy: TAG_PRESERVE,\n allowedTags: null,\n tagHandlers: Object.freeze({}),\n sourceName: null,\n maxAliasCount: 100,\n uniqueKeys: true,\n idField: \"$yamlId\",\n refField: \"$yamlRef\",\n valuesField: \"$yamlValues\",\n tagField: \"$yamlTag\",\n valueField: \"$yamlValue\"\n});\n\nconst OPTION_KEYS = new Set(Object.keys(DEFAULT_VALUES));\n\nfunction hasOwn(value, key)\n{\n return Object.prototype.hasOwnProperty.call(value, key);\n}\n\nfunction defineMappingValue(target, key, value)\n{\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n}\n\nfunction normalizeEmit(value, readerName)\n{\n if (value === OUTPUT_JSON || value === OUTPUT_PAYLOAD) return value;\n if (value === OUTPUT_RAW || value === OUTPUT_DOCUMENT) return value;\n throw new TypeError(`${readerName} unknown emit value \"${value}\"`);\n}\n\nfunction normalizeTagPolicy(value, readerName)\n{\n if (value === TAG_PRESERVE || value === TAG_REJECT || value === TAG_HANDLE) return value;\n throw new TypeError(`${readerName} unknown tagPolicy value \"${value}\"`);\n}\n\nfunction normalizeAllowedTags(value, readerName)\n{\n if (value === null || value === undefined) return null;\n if (!Array.isArray(value) && !(value instanceof Set))\n {\n throw new TypeError(`${readerName} allowedTags must be an array, Set, or null`);\n }\n return [ ...value ];\n}\n\nfunction normalizeTagHandlers(value, readerName)\n{\n if (value instanceof Map)\n {\n for (const [ tag, handler ] of value)\n {\n if (typeof handler !== \"function\")\n {\n throw new TypeError(`${readerName} tag handler \"${tag}\" must be a function`);\n }\n }\n return new Map(value);\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value))\n {\n throw new TypeError(`${readerName} tagHandlers must be an object or Map`);\n }\n for (const [ tag, handler ] of Object.entries(value))\n {\n if (typeof handler !== \"function\")\n {\n throw new TypeError(`${readerName} tag handler \"${tag}\" must be a function`);\n }\n }\n return { ...value };\n}\n\nfunction normalizeField(value, name, readerName)\n{\n if (typeof value !== \"string\" || !value)\n {\n throw new TypeError(`${readerName} ${name} must be a non-empty string`);\n }\n return value;\n}\n\nfunction normalizeBoolean(value, name, readerName)\n{\n if (typeof value !== \"boolean\") throw new TypeError(`${readerName} ${name} must be a boolean`);\n return value;\n}\n\n/**\n * Normalizes reader options against their supported defaults for the YAML\n * document reader.\n */\nexport function normalizeValues(base, options = {}, readerName = \"CjsYamlFormat\")\n{\n if (!options || typeof options !== \"object\" || Array.isArray(options))\n {\n throw new TypeError(`${readerName} options must be an object`);\n }\n\n for (const key of Object.keys(options))\n {\n if (!OPTION_KEYS.has(key)) throw new TypeError(`${readerName} unknown option \"${key}\"`);\n }\n\n const values = {\n ...base,\n allowedTags: base.allowedTags ? [ ...base.allowedTags ] : null,\n tagHandlers: base.tagHandlers instanceof Map ? new Map(base.tagHandlers) : { ...base.tagHandlers }\n };\n\n if (hasOwn(options, \"emit\")) values.emit = normalizeEmit(options.emit, readerName);\n if (hasOwn(options, \"tagPolicy\")) values.tagPolicy = normalizeTagPolicy(options.tagPolicy, readerName);\n if (hasOwn(options, \"allowedTags\")) values.allowedTags = normalizeAllowedTags(options.allowedTags, readerName);\n if (hasOwn(options, \"tagHandlers\")) values.tagHandlers = normalizeTagHandlers(options.tagHandlers, readerName);\n if (hasOwn(options, \"sourceName\")) values.sourceName = options.sourceName == null ? null : String(options.sourceName);\n if (hasOwn(options, \"maxAliasCount\"))\n {\n if (!Number.isInteger(options.maxAliasCount) || options.maxAliasCount < 0)\n {\n throw new TypeError(`${readerName} maxAliasCount must be a non-negative integer`);\n }\n values.maxAliasCount = options.maxAliasCount;\n }\n if (hasOwn(options, \"uniqueKeys\"))\n {\n values.uniqueKeys = normalizeBoolean(options.uniqueKeys, \"uniqueKeys\", readerName);\n }\n\n for (const name of [ \"idField\", \"refField\", \"valuesField\", \"tagField\", \"valueField\" ])\n {\n if (hasOwn(options, name)) values[name] = normalizeField(options[name], name, readerName);\n }\n\n return values;\n}\n\n/**\n * Converts a YAML node graph into JSON-safe values while preserving references\n * for the YAML document reader.\n */\nexport function toJsonGraph(value, options)\n{\n const counts = new WeakMap();\n const traversed = new WeakSet();\n\n const count = (node) =>\n {\n if (!node || typeof node !== \"object\") return;\n counts.set(node, (counts.get(node) || 0) + 1);\n if (traversed.has(node)) return;\n traversed.add(node);\n if (Array.isArray(node)) node.forEach(count);\n else Object.keys(node).forEach(key => count(node[key]));\n };\n count(value);\n\n const ids = new WeakMap();\n let nextId = 1;\n\n const encode = (node) =>\n {\n if (node === null || typeof node !== \"object\") return node;\n if (ArrayBuffer.isView(node)) return Array.from(node, encode);\n if (node instanceof Date) return node.toISOString();\n\n const repeated = (counts.get(node) || 0) > 1;\n if (ids.has(node)) return { [options.refField]: ids.get(node) };\n\n let id = null;\n if (repeated)\n {\n id = nextId++;\n ids.set(node, id);\n }\n\n if (Array.isArray(node))\n {\n const values = node.map(encode);\n return repeated ? { [options.idField]: id, [options.valuesField]: values } : values;\n }\n\n if (repeated && Object.prototype.hasOwnProperty.call(node, options.idField))\n {\n throw new TypeError(`CjsYamlFormat cannot encode repeated mapping: reserved field \"${options.idField}\" already exists`);\n }\n\n const out = repeated ? { [options.idField]: id } : {};\n for (const key of Object.keys(node)) defineMappingValue(out, key, encode(node[key]));\n return out;\n };\n\n return encode(value);\n}\n"],"names":["OUTPUT_JSON","OUTPUT_PAYLOAD","OUTPUT_RAW","OUTPUT_DOCUMENT","TAG_PRESERVE","TAG_REJECT","TAG_HANDLE","DEFAULT_VALUES","Object","freeze","emit","tagPolicy","allowedTags","tagHandlers","sourceName","maxAliasCount","uniqueKeys","idField","refField","valuesField","tagField","valueField","OPTION_KEYS","Set","keys","hasOwn","value","key","prototype","hasOwnProperty","call","defineMappingValue","target","defineProperty","enumerable","configurable","writable","normalizeEmit","readerName","TypeError","normalizeTagPolicy","normalizeAllowedTags","undefined","Array","isArray","normalizeTagHandlers","Map","tag","handler","entries","normalizeField","name","normalizeBoolean","normalizeValues","base","options","has","values","String","Number","isInteger","toJsonGraph","counts","WeakMap","traversed","WeakSet","count","node","set","get","add","forEach","ids","nextId","encode","ArrayBuffer","isView","from","Date","toISOString","repeated","id","map","out"],"mappings":"AAAO,MAAMA,WAAW,GAAG;AACpB,MAAMC,cAAc,GAAG;AACvB,MAAMC,UAAU,GAAG;AACnB,MAAMC,eAAe,GAAG;AAExB,MAAMC,YAAY,GAAG;AACrB,MAAMC,UAAU,GAAG;AACnB,MAAMC,UAAU,GAAG;MAEbC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;AACxCC,EAAAA,IAAI,EAAET,cAAc;AACpBU,EAAAA,SAAS,EAAEP,YAAY;A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ACvB;AACI,MAAA,MAAMV,MAAM,GAAGU,IAAI,CAACe,GAAG,CAACR,MAAM,CAAC;AAC/B,MAAA,OAAOM,QAAQ,GAAG;AAAE,QAAA,CAACzB,OAAO,CAACtC,OAAO,GAAGgE,EAAE;QAAE,CAAC1B,OAAO,CAACpC,WAAW,GAAGsC;AAAO,OAAC,GAAGA,MAAM;AACvF,IAAA;AAEA,IAAA,IAAIuB,QAAQ,IAAIxE,MAAM,CAACoB,SAAS,CAACC,cAAc,CAACC,IAAI,CAACqC,IAAI,EAAEZ,OAAO,CAACtC,OAAO,CAAC,EAC3E;MACI,MAAM,IAAIsB,SAAS,CAAC,CAAA,8DAAA,EAAiEgB,OAAO,CAACtC,OAAO,kBAAkB,CAAC;AAC3H,IAAA;IAEA,MAAMkE,GAAG,GAAGH,QAAQ,GAAG;MAAE,CAACzB,OAAO,CAACtC,OAAO,GAAGgE;KAAI,GAAG,EAAE;IACrD,KAAK,MAAMtD,GAAG,IAAInB,MAAM,CAACgB,IAAI,CAAC2C,IAAI,CAAC,EAAEpC,kBAAkB,CAACoD,GAAG,EAAExD,GAAG,EAAE+C,MAAM,CAACP,IAAI,CAACxC,GAAG,CAAC,CAAC,CAAC;AACpF,IAAA,OAAOwD,GAAG;EACd,CAAC;EAED,OAAOT,MAAM,CAAChD,KAAK,CAAC;AACxB;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,62 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
1
|
+
export { CjsResource } from './resource/CjsResource.js';
|
|
2
|
+
export { Tr2LightProfileRes } from './resource/Tr2LightProfileRes.js';
|
|
3
|
+
export { AudioGeometryResData } from './resource/audio/AudioGeometryResData.js';
|
|
4
|
+
export { CjsAudioBufferRes } from './resource/audio/CjsAudioBufferRes.js';
|
|
5
|
+
export { CjsAudioRes } from './resource/audio/CjsAudioRes.js';
|
|
6
|
+
export { MeshDecalData } from './resource/geometry/MeshDecalData.js';
|
|
7
|
+
export { MeshDecalLodData } from './resource/geometry/MeshDecalLodData.js';
|
|
8
|
+
export { TriGeometryRes } from './resource/geometry/TriGeometryRes.js';
|
|
9
|
+
export { TriGeometryResAreaData } from './resource/geometry/TriGeometryResAreaData.js';
|
|
10
|
+
export { TriGeometryResJointData } from './resource/geometry/TriGeometryResJointData.js';
|
|
11
|
+
export { TriGeometryResLodData } from './resource/geometry/TriGeometryResLodData.js';
|
|
12
|
+
export { TriGeometryResMeshData } from './resource/geometry/TriGeometryResMeshData.js';
|
|
13
|
+
export { TriGeometryResSkeletonData } from './resource/geometry/TriGeometryResSkeletonData.js';
|
|
14
|
+
export { TriJointBinding } from './resource/geometry/TriJointBinding.js';
|
|
15
|
+
export { TriMorphTargetGeometryConstants } from './resource/geometry/TriMorphTargetGeometryConstants.js';
|
|
16
|
+
export { TriRtGeometryConstants } from './resource/geometry/TriRtGeometryConstants.js';
|
|
17
|
+
export { GStateBindingCallbackData } from './resource/geometry/granny/GStateBindingCallbackData.js';
|
|
18
|
+
export { Tr2GrannyIntersectionResult } from './resource/geometry/granny/Tr2GrannyIntersectionResult.js';
|
|
19
|
+
export { Tr2GrannyStateRes } from './resource/geometry/granny/Tr2GrannyStateRes.js';
|
|
20
|
+
export { TriGrannyRes } from './resource/geometry/granny/TriGrannyRes.js';
|
|
21
|
+
export { GrannyDeprecationLevel } from './resource/geometry/granny/enums.js';
|
|
22
|
+
export { GetGlobalEffectOptions, ModifyGlobalEffectOptions, Tr2EffectRes } from './resource/shader/Tr2EffectRes.js';
|
|
23
|
+
export { Tr2MaterialArea } from './resource/shader/Tr2MaterialArea.js';
|
|
24
|
+
export { Tr2MaterialMesh } from './resource/shader/Tr2MaterialMesh.js';
|
|
25
|
+
export { Tr2MaterialRes } from './resource/shader/Tr2MaterialRes.js';
|
|
26
|
+
export { Tr2Shader } from './resource/shader/Tr2Shader.js';
|
|
27
|
+
export { Tr2ShaderPermutation } from './resource/shader/Tr2ShaderPermutation.js';
|
|
28
|
+
export { Tr2EffectConstant } from './resource/shader/reflection/Tr2EffectConstant.js';
|
|
29
|
+
export { Tr2EffectDefine } from './resource/shader/reflection/Tr2EffectDefine.js';
|
|
30
|
+
export { Tr2EffectDescription } from './resource/shader/reflection/Tr2EffectDescription.js';
|
|
31
|
+
export { Tr2EffectLibrary } from './resource/shader/reflection/Tr2EffectLibrary.js';
|
|
32
|
+
export { Tr2EffectParameterAnnotation } from './resource/shader/reflection/Tr2EffectParameterAnnotation.js';
|
|
33
|
+
export { Tr2EffectResource } from './resource/shader/reflection/Tr2EffectResource.js';
|
|
34
|
+
export { Tr2EffectStageInput } from './resource/shader/reflection/Tr2EffectStageInput.js';
|
|
35
|
+
export { Tr2EffectTechnique } from './resource/shader/reflection/Tr2EffectTechnique.js';
|
|
36
|
+
export { Tr2Pass } from './resource/shader/reflection/Tr2Pass.js';
|
|
37
|
+
export { Tr2SamplerSetup } from './resource/shader/sampler/Tr2SamplerSetup.js';
|
|
38
|
+
export { CjsTextureArrayRes } from './resource/texture/CjsTextureArrayRes.js';
|
|
39
|
+
export { CjsTextureArrayResParameterProxy } from './resource/texture/CjsTextureArrayResParameterProxy.js';
|
|
40
|
+
export { Tr2ImageRes } from './resource/texture/Tr2ImageRes.js';
|
|
41
|
+
export { Tr2TextureLodManager } from './resource/texture/Tr2TextureLodManager.js';
|
|
42
|
+
export { Tr2TextureLodUpdateRequest } from './resource/texture/Tr2TextureLodUpdateRequest.js';
|
|
43
|
+
export { Tr2TexturePackChannel } from './resource/texture/Tr2TexturePackChannel.js';
|
|
44
|
+
export { Tr2TexturePipeline } from './resource/texture/Tr2TexturePipeline.js';
|
|
45
|
+
export { Tr2TexturePipelineParams } from './resource/texture/Tr2TexturePipelineParams.js';
|
|
46
|
+
export { Tr2TexturePipelineStepCompress } from './resource/texture/Tr2TexturePipelineStepCompress.js';
|
|
47
|
+
export { Tr2TexturePipelineStepGenerateMips } from './resource/texture/Tr2TexturePipelineStepGenerateMips.js';
|
|
48
|
+
export { Tr2TexturePipelineStepLimitSize } from './resource/texture/Tr2TexturePipelineStepLimitSize.js';
|
|
49
|
+
export { Tr2TexturePipelineStepLoad } from './resource/texture/Tr2TexturePipelineStepLoad.js';
|
|
50
|
+
export { Tr2TexturePipelineStepPack } from './resource/texture/Tr2TexturePipelineStepPack.js';
|
|
51
|
+
export { TriTextureRes } from './resource/texture/TriTextureRes.js';
|
|
41
52
|
export { CjsResourceProbe } from './format/CjsResourceProbe.js';
|
|
42
53
|
export { ResourcePayloadType, ResourcePayloadValues, validateAudioPayload, validateRgbaPayload, validateTexturePayload, validateVideoPayload } from './format/payloadContract.js';
|
|
43
|
-
export { CjsFormat
|
|
54
|
+
export { CjsFormat } from './format/CjsFormat.js';
|
|
44
55
|
export { CjsEventEmitter } from '@carbonenginejs/runtime-utils/model';
|
|
45
56
|
export { CjsMotherLode, getMotherLodeKey } from './CjsMotherLode.js';
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
57
|
+
export { CjsResManFetchProvider } from './CjsResManFetchProvider.js';
|
|
58
|
+
export { CjsResManMainThreadLoader } from './worker/CjsResManMainThreadLoader.js';
|
|
59
|
+
export { CjsResManWorkerLoader } from './worker/CjsResManWorkerLoader.js';
|
|
60
|
+
export { CjsResManQueue } from './CjsResManWorkQueue.js';
|
|
48
61
|
export { CjsResMan } from './CjsResMan.js';
|
|
49
62
|
//# sourceMappingURL=index.js.map
|