@amazon/vinyl 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -8
- package/dist/index.cjs +276 -200
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +280 -203
- package/dist/index.js.map +4 -4
- package/dist/test/benchmark.es5.js +169 -232
- package/dist/test/benchmark.js +1475 -1933
- package/dist/test/benchmark.js.map +4 -4
- package/dist/test/integ.es5.js +771 -394
- package/dist/test/integ.js +6063 -5273
- package/dist/test/integ.js.map +4 -4
- package/dist/test/jasmineHtml.es5.js +8 -8
- package/dist/test/jasmineHtml.js +8 -4
- package/dist/test/jasmineHtml.js.map +3 -3
- package/dist/types/current/client/Capabilities.d.ts.map +1 -1
- package/dist/types/current/client/CapabilitiesImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmController.d.ts +2 -2
- package/dist/types/current/drm/DrmController.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +7 -7
- package/dist/types/current/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/current/drm/DrmKeySystemResolver.d.ts.map +1 -1
- package/dist/types/current/drm/DrmKeySystemResolver.js +1 -1
- package/dist/types/current/drm/DrmOptions.d.ts +1 -1
- package/dist/types/current/drm/DrmOptions.d.ts.map +1 -1
- package/dist/types/current/drm/DrmOptions.js +1 -1
- package/dist/types/current/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/current/drm/commonEme/CommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.js +1 -1
- package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/WebKitCommonEme.js +1 -1
- package/dist/types/current/drm/commonEme/createDrmErrorHandler.js +1 -1
- package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts.map +1 -1
- package/dist/types/current/global/environment.d.ts +6 -2
- package/dist/types/current/global/environment.d.ts.map +1 -1
- package/dist/types/current/global/environment.js +4 -3
- package/dist/types/current/global/initializeVinylGlobal.js +1 -1
- package/dist/types/current/patch/media/MediaElementPatchOptions.js +1 -1
- package/dist/types/current/patch/media/patchMediaElement.js +1 -1
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts.map +1 -1
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.js +4 -4
- package/dist/types/current/playback/ReadonlyPlaybackController.d.ts.map +1 -1
- package/dist/types/current/playback/error/ReportableMediaError.js +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts.map +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.js +1 -1
- package/dist/types/current/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/current/playback/nextHasMetadata.d.ts.map +1 -1
- package/dist/types/current/streaming/ContentStream.d.ts +4 -4
- package/dist/types/current/streaming/ContentStream.d.ts.map +1 -1
- package/dist/types/current/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/current/streaming/ContentStreamingOptions.d.ts.map +1 -1
- package/dist/types/current/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/current/streaming/MediaQualityMetadata.d.ts.map +1 -1
- package/dist/types/current/streaming/MediaQualityMetadata.js +1 -1
- package/dist/types/current/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/current/streaming/MediaTimeline.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentController.d.ts +2 -7
- package/dist/types/current/streaming/SegmentController.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/current/streaming/SegmentControllerImpl.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentControllerImpl.js +5 -15
- package/dist/types/current/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/current/streaming/SegmentReference.d.ts.map +1 -1
- package/dist/types/current/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/current/streaming/StreamingEventMap.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/current/streaming/abr/QualitySelector.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelectorImpl.js +8 -2
- package/dist/types/current/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/current/streaming/buffering/BufferingController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/BufferingController.js +1 -24
- package/dist/types/current/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/current/streaming/buffering/MediaSourceController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/MediaSourceController.js +74 -17
- package/dist/types/current/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/current/streaming/buffering/SourceBufferController.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.js +2 -2
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts.map +1 -1
- package/dist/types/current/streaming/mediaTimelineFilter.js +1 -1
- package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts.map +1 -1
- package/dist/types/current/streaming/util/segment.d.ts +1 -1
- package/dist/types/current/streaming/util/segment.d.ts.map +1 -1
- package/dist/types/current/track/AutoResetController.d.ts +37 -12
- package/dist/types/current/track/AutoResetController.d.ts.map +1 -1
- package/dist/types/current/track/AutoResetController.js +38 -28
- package/dist/types/current/track/Track.d.ts.map +1 -1
- package/dist/types/current/track/TrackBase.d.ts.map +1 -1
- package/dist/types/current/track/TrackController.d.ts +2 -2
- package/dist/types/current/track/TrackController.d.ts.map +1 -1
- package/dist/types/current/track/TrackFactory.d.ts +1 -1
- package/dist/types/current/track/TrackFactory.d.ts.map +1 -1
- package/dist/types/current/track/createSegmentDataProvider.d.ts.map +1 -1
- package/dist/types/current/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/current/track/createVinylTrackFactories.d.ts.map +1 -1
- package/dist/types/current/track/createVinylTrackFactories.js +4 -4
- package/dist/types/current/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/current/track/dash/DashManifestController.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.js +1 -1
- package/dist/types/current/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/current/track/dash/DashTrack.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashTrack.js +2 -2
- package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts.map +1 -1
- package/dist/types/current/track/dash/buildDashMediaTimeline.js +2 -2
- package/dist/types/current/track/dash/createDashContentStreamFactories.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/current/track/dash/createDashContentTypesValue.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashContentTypesValue.js +1 -1
- package/dist/types/current/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/current/track/dash/createDashFactories.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashFactories.js +8 -8
- package/dist/types/current/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/current/track/dash/createDashManifestProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashManifestProvider.js +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.js +1 -1
- package/dist/types/current/track/dash/createSegmentControllerFactory.d.ts.map +1 -1
- package/dist/types/current/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/current/track/dash/manifestTransformUtils.d.ts.map +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.js +3 -3
- package/dist/types/current/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/current/track/dash/urlDashManifestProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mimeType.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mimeType.js +1 -1
- package/dist/types/current/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/current/track/dash/util/mpd.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mpd.js +13 -3
- package/dist/types/current/track/dash/util/uriResolution.js +1 -1
- package/dist/types/current/track/filters/keySystemFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/resourceTypeFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
- package/dist/types/current/track/hls/HlsTrack.d.ts.map +1 -1
- package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts.map +1 -1
- package/dist/types/current/track/hls/buildHlsMediaTimeline.js +16 -14
- package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts.map +1 -1
- package/dist/types/current/track/hls/createHlsContentStreamFactories.d.ts.map +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts.map +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.js +1 -1
- package/dist/types/current/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +2 -1
- package/dist/types/current/track/mse/codec.d.ts.map +1 -1
- package/dist/types/current/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/current/track/source/FixedPlaybackQuality.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/current/track/source/SourceObjectTrack.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceObjectTrack.js +2 -2
- package/dist/types/current/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/current/track/source/SourceTrack.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceTrack.js +2 -2
- package/dist/types/current/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/current/track/source/SourceTrackBase.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceTrackBase.js +2 -2
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/vinyl/ReadonlyPlaybackStreamingState.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/current/vinyl/VinylDeps.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylOptions.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPatchOptions.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.d.ts +26 -2
- package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.js +18 -3
- package/dist/types/current/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/current/vinyl/createVinylFactories.d.ts.map +1 -1
- package/dist/types/current/vinyl/createVinylFactories.js +2 -2
- package/dist/types/ts3.7/drm/DrmController.d.ts +2 -2
- package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts3.7/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts3.7/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts3.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts3.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts3.7/global/environment.d.ts +6 -2
- package/dist/types/ts3.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts3.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts3.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts3.7/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts3.7/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts3.7/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts3.7/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts3.7/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts3.7/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts3.7/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts3.7/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts3.7/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts3.7/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts3.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts3.7/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts3.7/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts3.7/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts3.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts3.7/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts3.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts3.7/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts3.7/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts3.7/track/TrackController.d.ts +2 -2
- package/dist/types/ts3.7/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts3.7/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts3.7/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts3.7/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts3.7/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts3.7/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts3.7/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts3.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts3.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts3.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/ts3.7/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts3.7/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/ts3.7/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +18 -2
- package/dist/types/ts3.7/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/ts4.1/drm/DrmController.d.ts +2 -2
- package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts4.1/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts4.1/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts4.1/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts4.1/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts4.1/global/environment.d.ts +6 -2
- package/dist/types/ts4.1/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts4.1/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.1/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts4.1/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts4.1/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts4.1/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts4.1/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts4.1/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts4.1/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts4.1/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts4.1/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts4.1/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts4.1/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts4.1/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts4.1/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts4.1/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts4.1/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts4.1/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts4.1/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts4.1/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts4.1/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts4.1/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts4.1/track/TrackController.d.ts +2 -2
- package/dist/types/ts4.1/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts4.1/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts4.1/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts4.1/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts4.1/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts4.1/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts4.1/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts4.1/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts4.1/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts4.1/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.1/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +3 -3
- package/dist/types/ts4.1/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts4.1/track/source/SourceObjectTrack.d.ts +5 -5
- package/dist/types/ts4.1/track/source/SourceTrack.d.ts +5 -5
- package/dist/types/ts4.1/track/source/SourceTrackBase.d.ts +3 -3
- package/dist/types/ts4.1/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +18 -2
- package/dist/types/ts4.1/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/ts4.7/drm/DrmController.d.ts +2 -2
- package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts4.7/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts4.7/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts4.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts4.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts4.7/global/environment.d.ts +6 -2
- package/dist/types/ts4.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts4.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts4.7/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts4.7/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts4.7/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts4.7/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts4.7/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts4.7/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts4.7/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts4.7/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts4.7/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts4.7/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts4.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts4.7/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts4.7/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts4.7/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts4.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts4.7/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts4.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts4.7/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts4.7/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts4.7/track/TrackController.d.ts +2 -2
- package/dist/types/ts4.7/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts4.7/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts4.7/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts4.7/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts4.7/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts4.7/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts4.7/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts4.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts4.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/ts4.7/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts4.7/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/ts4.7/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +26 -2
- package/dist/types/ts4.7/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/unit/types/current/streaming/MediaTimeline.test.js +6 -1
- package/dist/unit/types/current/streaming/MseTrack.test.js +4 -0
- package/dist/unit/types/current/streaming/SegmentControllerImpl.test.js +3 -33
- package/dist/unit/types/current/streaming/abr/QualitySelectorImpl.test.js +73 -0
- package/dist/unit/types/current/streaming/buffering/BufferingController.test.js +1 -41
- package/dist/unit/types/current/streaming/buffering/MediaSourceController.test.js +97 -17
- package/dist/unit/types/current/streaming/createDefaultMediaTimelineTransformer.test.js +6 -0
- package/dist/unit/types/current/streaming/mediaTimelineFilter.test.js +2 -0
- package/dist/unit/types/current/streaming/mediaTimelineLanguageFilter.test.js +7 -0
- package/dist/unit/types/current/track/AutoResetController.test.js +134 -22
- package/dist/unit/types/current/track/dash/createDashContentStreamFactories.test.js +5 -1
- package/dist/unit/types/current/track/dash/createSegmentControllerFactory.test.js +5 -1
- package/dist/unit/types/current/track/dash/util/mpd.test.js +29 -0
- package/dist/unit/types/current/track/hls/buildHlsMediaTimeline.test.js +16 -8
- package/dist/unit/types/current/track/hls/createHlsContentStreamFactories.test.js +5 -1
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/vinyl/VinylPlayer.test.js +35 -0
- package/dist/vinylTestUtil/index.js +20 -14
- package/dist/vinylTestUtil/index.js.map +2 -2
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.js +1 -1
- package/dist/vinylTestUtil/types/current/mediaSource/ControlledMediaSource.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/current/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/current/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.js +7 -7
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.js +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.js +0 -1
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.js +1 -0
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.js +11 -7
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.js +11 -7
- package/dist/vinylTestUtil/types/current/player/createVinylSuite.js +1 -1
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackCanSeek.js +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.js +2 -2
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.js +1 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts3.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts3.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts3.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.1/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts4.1/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.1/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.1/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.7/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts4.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/docs/USAGE.md +33 -0
- package/package.json +13 -15
package/dist/test/benchmark.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
// ../vinyl-util/dist/browserTestUtil/index.js
|
|
8
|
-
var __defProp2 = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
6
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
8
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
10
|
var __spreadValues = (a, b) => {
|
|
14
11
|
for (var prop in b || (b = {}))
|
|
15
12
|
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
14
|
if (__getOwnPropSymbols)
|
|
18
15
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
16
|
if (__propIsEnum.call(b, prop))
|
|
20
|
-
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
18
|
}
|
|
22
19
|
return a;
|
|
23
20
|
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
22
|
var __objRest = (source, exclude) => {
|
|
25
23
|
var target = {};
|
|
26
24
|
for (var prop in source)
|
|
@@ -33,7 +31,9 @@
|
|
|
33
31
|
}
|
|
34
32
|
return target;
|
|
35
33
|
};
|
|
36
|
-
var
|
|
34
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
35
|
+
|
|
36
|
+
// ../vinyl-util/test/browserTestUtil/mock/createSpyFactory.ts
|
|
37
37
|
var createSpy = jasmine.createSpy;
|
|
38
38
|
function createSpyFactory(createFake) {
|
|
39
39
|
return (key) => {
|
|
@@ -45,58 +45,66 @@
|
|
|
45
45
|
function createSpy2(key) {
|
|
46
46
|
return createSpy(String(key));
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
// ../vinyl-util/test/browserTestUtil/mock/dom/lib.dom.ts
|
|
48
50
|
var MockAbortSignal = class {
|
|
49
51
|
constructor() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
__publicField(this, "aborted", false);
|
|
53
|
+
__publicField(this, "onabort", null);
|
|
54
|
+
__publicField(this, "reason");
|
|
55
|
+
__publicField(this, "throwIfAborted", createSpy2("throwIfAborted"));
|
|
56
|
+
__publicField(this, "addEventListener", createSpy2("addEventListener"));
|
|
57
|
+
__publicField(this, "removeEventListener", createSpy2(
|
|
56
58
|
"removeEventListener"
|
|
57
59
|
));
|
|
58
|
-
|
|
60
|
+
__publicField(this, "dispatchEvent", createSpy2("dispatchEvent"));
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
var MockMediaSource = class {
|
|
62
64
|
constructor() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
__publicField(this, "activeSourceBuffers");
|
|
66
|
+
__publicField(this, "duration", 0);
|
|
67
|
+
__publicField(this, "onsourceclose", null);
|
|
68
|
+
__publicField(this, "onsourceended", null);
|
|
69
|
+
__publicField(this, "onsourceopen", null);
|
|
70
|
+
__publicField(this, "readyState", "closed");
|
|
71
|
+
__publicField(this, "sourceBuffers");
|
|
72
|
+
__publicField(this, "addSourceBuffer", createSpy2("addSourceBuffer"));
|
|
73
|
+
__publicField(this, "clearLiveSeekableRange", createSpy2(
|
|
72
74
|
"clearLiveSeekableRange"
|
|
73
75
|
));
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
__publicField(this, "endOfStream", createSpy2("endOfStream"));
|
|
77
|
+
__publicField(this, "removeSourceBuffer", createSpy2("removeSourceBuffer"));
|
|
78
|
+
__publicField(this, "setLiveSeekableRange", createSpy2(
|
|
77
79
|
"setLiveSeekableRange"
|
|
78
80
|
));
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
__publicField(this, "addEventListener", createSpy2("addEventListener"));
|
|
82
|
+
__publicField(this, "removeEventListener", createSpy2(
|
|
81
83
|
"removeEventListener"
|
|
82
84
|
));
|
|
83
|
-
|
|
85
|
+
__publicField(this, "dispatchEvent", createSpy2("dispatchEvent"));
|
|
84
86
|
}
|
|
85
87
|
};
|
|
88
|
+
|
|
89
|
+
// ../vinyl-util/test/browserTestUtil/mock/dom/globals.ts
|
|
86
90
|
var MockMediaSourceGlobal = class extends MockMediaSource {
|
|
87
91
|
};
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
__publicField(MockMediaSourceGlobal, "canConstructInDedicatedWorker", false);
|
|
93
|
+
__publicField(MockMediaSourceGlobal, "isTypeSupported", createSpy2(
|
|
90
94
|
"isTypeSupported"
|
|
91
95
|
));
|
|
92
96
|
var MockAbortSignalGlobal = class extends MockAbortSignal {
|
|
93
97
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
__publicField(MockAbortSignalGlobal, "abort", createSpy2("abort"));
|
|
99
|
+
__publicField(MockAbortSignalGlobal, "any", createSpy2("any"));
|
|
100
|
+
__publicField(MockAbortSignalGlobal, "timeout", createSpy2("timeout"));
|
|
101
|
+
|
|
102
|
+
// ../vinyl-util/test/browserTestUtil/expect/expectNothing.ts
|
|
97
103
|
function expectNothing() {
|
|
98
104
|
expect(true).toBeTruthy();
|
|
99
105
|
}
|
|
106
|
+
|
|
107
|
+
// ../vinyl-util/test/browserTestUtil/env/jasmineEnv.ts
|
|
100
108
|
var nextTestTimeoutOverridden = false;
|
|
101
109
|
function setTestTimeout(timeout) {
|
|
102
110
|
let originalTimeout = null;
|
|
@@ -110,6 +118,8 @@
|
|
|
110
118
|
if (nextTestTimeoutOverridden) nextTestTimeoutOverridden = false;
|
|
111
119
|
});
|
|
112
120
|
}
|
|
121
|
+
|
|
122
|
+
// ../vinyl-util/test/browserTestUtil/benchmark/Benchmark.ts
|
|
113
123
|
var now;
|
|
114
124
|
if (typeof window !== "undefined" && typeof window.performance !== "undefined" && typeof window.performance.now !== "undefined") {
|
|
115
125
|
now = () => window.performance.now();
|
|
@@ -120,9 +130,9 @@
|
|
|
120
130
|
}
|
|
121
131
|
var BenchmarkRunResults = class {
|
|
122
132
|
constructor(name) {
|
|
123
|
-
this
|
|
124
|
-
|
|
125
|
-
|
|
133
|
+
__publicField(this, "name", name);
|
|
134
|
+
__publicField(this, "cycleResults", []);
|
|
135
|
+
__publicField(this, "_totalSamples", 0);
|
|
126
136
|
}
|
|
127
137
|
get totalSamples() {
|
|
128
138
|
return this._totalSamples;
|
|
@@ -173,8 +183,11 @@
|
|
|
173
183
|
};
|
|
174
184
|
var RunResultsComparison = class {
|
|
175
185
|
constructor(name, results) {
|
|
176
|
-
this
|
|
177
|
-
|
|
186
|
+
__publicField(this, "name", name);
|
|
187
|
+
/**
|
|
188
|
+
* Sorted by median ops/s from slowest to fastest.
|
|
189
|
+
*/
|
|
190
|
+
__publicField(this, "results");
|
|
178
191
|
this.results = results.sort((a, b) => {
|
|
179
192
|
return a.meanOpsPerSec - b.meanOpsPerSec;
|
|
180
193
|
});
|
|
@@ -219,7 +232,7 @@
|
|
|
219
232
|
maxCycleDuration: 0.5,
|
|
220
233
|
cycles: 9
|
|
221
234
|
};
|
|
222
|
-
var _Benchmark = class
|
|
235
|
+
var _Benchmark = class _Benchmark {
|
|
223
236
|
/**
|
|
224
237
|
* Constructs a new Benchmark.
|
|
225
238
|
*
|
|
@@ -229,14 +242,14 @@
|
|
|
229
242
|
* @param options Optional configuration for the benchmark.
|
|
230
243
|
*/
|
|
231
244
|
constructor(name, executor, options) {
|
|
232
|
-
this
|
|
233
|
-
this
|
|
234
|
-
|
|
245
|
+
__publicField(this, "name", name);
|
|
246
|
+
__publicField(this, "executor", executor);
|
|
247
|
+
__publicField(this, "options");
|
|
235
248
|
this.options = __spreadValues(__spreadValues({}, defaultBenchmarkOptions), options);
|
|
236
249
|
}
|
|
237
250
|
async run() {
|
|
238
251
|
const opts = this.options;
|
|
239
|
-
await
|
|
252
|
+
await _Benchmark.semaphore;
|
|
240
253
|
const warmupTimeMs = opts.warmupTime * 1e3;
|
|
241
254
|
const cycleStart = now();
|
|
242
255
|
let isAsync = false;
|
|
@@ -254,7 +267,7 @@
|
|
|
254
267
|
}
|
|
255
268
|
return results;
|
|
256
269
|
})();
|
|
257
|
-
|
|
270
|
+
_Benchmark.semaphore = resultsPromise;
|
|
258
271
|
return await resultsPromise;
|
|
259
272
|
}
|
|
260
273
|
/**
|
|
@@ -280,7 +293,7 @@
|
|
|
280
293
|
};
|
|
281
294
|
}
|
|
282
295
|
};
|
|
283
|
-
|
|
296
|
+
__publicField(_Benchmark, "semaphore", nextFrame());
|
|
284
297
|
var Benchmark = _Benchmark;
|
|
285
298
|
function benchmark(name, executor, options) {
|
|
286
299
|
const benchmark2 = new Benchmark(name, executor, options);
|
|
@@ -307,7 +320,6 @@
|
|
|
307
320
|
const sum = values.reduce((acc, value) => acc + value, 0);
|
|
308
321
|
return sum / values.length;
|
|
309
322
|
}
|
|
310
|
-
var createSpy3 = jasmine.createSpy;
|
|
311
323
|
|
|
312
324
|
// test/benchmark/setup.ts
|
|
313
325
|
function setupBenchmark() {
|
|
@@ -375,33 +387,15 @@
|
|
|
375
387
|
return element2;
|
|
376
388
|
}
|
|
377
389
|
|
|
378
|
-
// ../vinyl-util/
|
|
379
|
-
var __defProp3 = Object.defineProperty;
|
|
380
|
-
var __defProps = Object.defineProperties;
|
|
381
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
382
|
-
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
383
|
-
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
384
|
-
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
385
|
-
var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
386
|
-
var __spreadValues2 = (a, b) => {
|
|
387
|
-
for (var prop in b || (b = {}))
|
|
388
|
-
if (__hasOwnProp2.call(b, prop))
|
|
389
|
-
__defNormalProp3(a, prop, b[prop]);
|
|
390
|
-
if (__getOwnPropSymbols2)
|
|
391
|
-
for (var prop of __getOwnPropSymbols2(b)) {
|
|
392
|
-
if (__propIsEnum2.call(b, prop))
|
|
393
|
-
__defNormalProp3(a, prop, b[prop]);
|
|
394
|
-
}
|
|
395
|
-
return a;
|
|
396
|
-
};
|
|
397
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
398
|
-
var __publicField3 = (obj, key, value) => __defNormalProp3(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
390
|
+
// ../vinyl-util/src/util/type.ts
|
|
399
391
|
function invariant() {
|
|
400
392
|
return void 0;
|
|
401
393
|
}
|
|
402
394
|
function covariant() {
|
|
403
395
|
return void 0;
|
|
404
396
|
}
|
|
397
|
+
|
|
398
|
+
// ../vinyl-util/src/error/ErrorOrigin.ts
|
|
405
399
|
var ErrorOrigin = {
|
|
406
400
|
/**
|
|
407
401
|
* The error originated from Vinyl and was reported from the uncaught exception or promise
|
|
@@ -446,11 +440,13 @@
|
|
|
446
440
|
*/
|
|
447
441
|
DRM: "drm"
|
|
448
442
|
};
|
|
443
|
+
|
|
444
|
+
// ../vinyl-util/src/error/ReportableError.ts
|
|
449
445
|
var ReportableError = class _ReportableError extends Error {
|
|
450
|
-
constructor(message, origin = ErrorOrigin.INTERNAL, level = "fatal") {
|
|
446
|
+
constructor(message, origin = ErrorOrigin.INTERNAL, level = "fatal" /* FATAL */) {
|
|
451
447
|
super(message);
|
|
452
|
-
this
|
|
453
|
-
this
|
|
448
|
+
__publicField(this, "origin", origin);
|
|
449
|
+
__publicField(this, "level", level);
|
|
454
450
|
Object.setPrototypeOf(this, _ReportableError.prototype);
|
|
455
451
|
}
|
|
456
452
|
get [Symbol.toStringTag]() {
|
|
@@ -472,25 +468,38 @@
|
|
|
472
468
|
};
|
|
473
469
|
}
|
|
474
470
|
};
|
|
471
|
+
|
|
472
|
+
// ../vinyl-util/src/error/IllegalArgumentError.ts
|
|
475
473
|
var IllegalArgumentError = class _IllegalArgumentError extends ReportableError {
|
|
476
474
|
constructor(message, isInternal = true) {
|
|
477
475
|
super(message, isInternal ? ErrorOrigin.INTERNAL : ErrorOrigin.API);
|
|
478
|
-
this
|
|
476
|
+
__publicField(this, "isInternal", isInternal);
|
|
479
477
|
Object.setPrototypeOf(this, _IllegalArgumentError.prototype);
|
|
480
478
|
}
|
|
481
479
|
get [Symbol.toStringTag]() {
|
|
482
480
|
return "IllegalArgumentError";
|
|
483
481
|
}
|
|
484
482
|
};
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
483
|
+
|
|
484
|
+
// ../vinyl-util/src/util/map/map.ts
|
|
485
|
+
function getOrSet(map, key, defaultValue) {
|
|
486
|
+
if (map.has(key)) {
|
|
487
|
+
return map.get(key);
|
|
488
488
|
} else {
|
|
489
489
|
const value = defaultValue(key);
|
|
490
|
-
|
|
490
|
+
map.set(key, value);
|
|
491
491
|
return value;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
+
function flipMap(map) {
|
|
495
|
+
const result = /* @__PURE__ */ new Map();
|
|
496
|
+
for (const [key, value] of map) {
|
|
497
|
+
result.set(value, key);
|
|
498
|
+
}
|
|
499
|
+
return result;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// ../vinyl-util/src/util/string/string.ts
|
|
494
503
|
var locale = {
|
|
495
504
|
variableNotDefined: "Variable '{name}' is not defined"
|
|
496
505
|
};
|
|
@@ -535,6 +544,7 @@
|
|
|
535
544
|
return str;
|
|
536
545
|
}
|
|
537
546
|
}
|
|
547
|
+
var standardEntityValueToNames = flipMap(predefinedDecodeEntities);
|
|
538
548
|
function eqStr(a, b, ignoreCase = false) {
|
|
539
549
|
if (a == null && b == null) return true;
|
|
540
550
|
if (a == null || b == null) return false;
|
|
@@ -552,12 +562,16 @@
|
|
|
552
562
|
return str.substring(0, maxLength - indicator.length) + indicator;
|
|
553
563
|
return str;
|
|
554
564
|
}
|
|
555
|
-
|
|
556
|
-
|
|
565
|
+
|
|
566
|
+
// ../vinyl-util/src/util/math/math.ts
|
|
567
|
+
function clamp(value, min, max) {
|
|
568
|
+
return Math.min(Math.max(value, min), max);
|
|
557
569
|
}
|
|
558
570
|
function roundToNearest(value, snap, offset = 0) {
|
|
559
571
|
return Math.round((value - offset) / snap) * snap + offset;
|
|
560
572
|
}
|
|
573
|
+
|
|
574
|
+
// ../vinyl-util/src/util/serialization/ParseError.ts
|
|
561
575
|
function printStringPosition(str, index, options) {
|
|
562
576
|
var _a3;
|
|
563
577
|
const caret = (options == null ? void 0 : options.caret) || "^";
|
|
@@ -584,13 +598,19 @@
|
|
|
584
598
|
out += " ".repeat(leadingChars) + caret;
|
|
585
599
|
return out;
|
|
586
600
|
}
|
|
601
|
+
|
|
602
|
+
// ../vinyl-util/src/util/string/StringReader.ts
|
|
587
603
|
var StringReader = class {
|
|
588
604
|
/**
|
|
589
605
|
* @param data The string to read.
|
|
590
606
|
*/
|
|
591
607
|
constructor(data) {
|
|
592
|
-
this
|
|
593
|
-
|
|
608
|
+
__publicField(this, "data", data);
|
|
609
|
+
/**
|
|
610
|
+
* The current cursor.
|
|
611
|
+
* This should always be between the range 0 and `data.length`
|
|
612
|
+
*/
|
|
613
|
+
__publicField(this, "position", 0);
|
|
594
614
|
}
|
|
595
615
|
/**
|
|
596
616
|
* Returns true if the current {@link position} is less than the source data's length.
|
|
@@ -793,9 +813,9 @@
|
|
|
793
813
|
`${reason}${locale2.messageSeparator}${location2}`,
|
|
794
814
|
ErrorOrigin.PARSING
|
|
795
815
|
);
|
|
796
|
-
this
|
|
797
|
-
this
|
|
798
|
-
|
|
816
|
+
__publicField(this, "position", position);
|
|
817
|
+
__publicField(this, "reason", reason);
|
|
818
|
+
__publicField(this, "location");
|
|
799
819
|
this.location = location2;
|
|
800
820
|
Object.setPrototypeOf(this, _StringParseError.prototype);
|
|
801
821
|
}
|
|
@@ -803,16 +823,20 @@
|
|
|
803
823
|
return "StringParseError";
|
|
804
824
|
}
|
|
805
825
|
toJSON() {
|
|
806
|
-
return __spreadProps(
|
|
826
|
+
return __spreadProps(__spreadValues({}, super.toJSON()), {
|
|
807
827
|
position: this.position,
|
|
808
828
|
location: this.location,
|
|
809
829
|
reason: this.reason
|
|
810
830
|
});
|
|
811
831
|
}
|
|
812
832
|
};
|
|
833
|
+
|
|
834
|
+
// ../vinyl-util/src/util/set/set.ts
|
|
813
835
|
function union(a, b) {
|
|
814
836
|
return /* @__PURE__ */ new Set([...a, ...b]);
|
|
815
837
|
}
|
|
838
|
+
|
|
839
|
+
// ../vinyl-util/src/util/object/object.ts
|
|
816
840
|
function ownKeys(obj) {
|
|
817
841
|
if (!obj) return /* @__PURE__ */ new Set();
|
|
818
842
|
if (typeof Reflect !== "undefined")
|
|
@@ -828,6 +852,8 @@
|
|
|
828
852
|
const proto = Object.getPrototypeOf(value);
|
|
829
853
|
return !proto || !Object.getPrototypeOf(proto);
|
|
830
854
|
}
|
|
855
|
+
|
|
856
|
+
// ../vinyl-util/src/util/serialization/json.ts
|
|
831
857
|
function toJson(value) {
|
|
832
858
|
return toJsonInternal(value, /* @__PURE__ */ new Set());
|
|
833
859
|
}
|
|
@@ -876,6 +902,8 @@
|
|
|
876
902
|
}
|
|
877
903
|
}
|
|
878
904
|
}
|
|
905
|
+
|
|
906
|
+
// ../vinyl-util/src/util/serialization/stringifyForPrint.ts
|
|
879
907
|
function stringifyForPrint(value, maxLength, indicator = "\u2026") {
|
|
880
908
|
let str = JSON.stringify(
|
|
881
909
|
toJson(value),
|
|
@@ -898,6 +926,8 @@
|
|
|
898
926
|
if (maxLength) str = truncate(str, maxLength, indicator);
|
|
899
927
|
return str;
|
|
900
928
|
}
|
|
929
|
+
|
|
930
|
+
// ../vinyl-util/src/util/serialization/primitives.ts
|
|
901
931
|
function parseBoolean(str) {
|
|
902
932
|
return str === "true" || str === "1";
|
|
903
933
|
}
|
|
@@ -912,10 +942,12 @@
|
|
|
912
942
|
if (!Number.isFinite(value)) return null;
|
|
913
943
|
return value;
|
|
914
944
|
}
|
|
945
|
+
|
|
946
|
+
// ../vinyl-util/src/util/collection/LinkedList.ts
|
|
915
947
|
var LinkedList = class {
|
|
916
948
|
constructor() {
|
|
917
|
-
|
|
918
|
-
|
|
949
|
+
__publicField(this, "_head", null);
|
|
950
|
+
__publicField(this, "_tail", null);
|
|
919
951
|
}
|
|
920
952
|
/**
|
|
921
953
|
* Returns the current head.
|
|
@@ -1218,9 +1250,11 @@
|
|
|
1218
1250
|
};
|
|
1219
1251
|
}
|
|
1220
1252
|
};
|
|
1253
|
+
|
|
1254
|
+
// ../vinyl-util/src/event/Signal.ts
|
|
1221
1255
|
var SignalImpl = class {
|
|
1222
1256
|
constructor() {
|
|
1223
|
-
|
|
1257
|
+
__publicField(this, "handlers", new LinkedList());
|
|
1224
1258
|
}
|
|
1225
1259
|
get empty() {
|
|
1226
1260
|
return this.handlers.empty;
|
|
@@ -1269,16 +1303,20 @@
|
|
|
1269
1303
|
function signal() {
|
|
1270
1304
|
return new SignalImpl();
|
|
1271
1305
|
}
|
|
1306
|
+
|
|
1307
|
+
// ../vinyl-util/src/logging/LogTarget.ts
|
|
1272
1308
|
var counter = 0;
|
|
1273
1309
|
function createLogPrefix(target) {
|
|
1274
1310
|
const name = typeof target === "string" ? target : target[Symbol.toStringTag];
|
|
1275
1311
|
return `${name}/${++counter}`;
|
|
1276
1312
|
}
|
|
1313
|
+
|
|
1314
|
+
// ../vinyl-util/src/event/EventHost.ts
|
|
1277
1315
|
var EventHostImpl = class {
|
|
1278
1316
|
constructor() {
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1317
|
+
__publicField(this, "logPrefix", createLogPrefix(this));
|
|
1318
|
+
__publicField(this, "signals", /* @__PURE__ */ new Map());
|
|
1319
|
+
__publicField(this, "__eventMapType", covariant());
|
|
1282
1320
|
}
|
|
1283
1321
|
get [Symbol.toStringTag]() {
|
|
1284
1322
|
return "EventHostImpl";
|
|
@@ -1306,6 +1344,8 @@
|
|
|
1306
1344
|
this.signals.clear();
|
|
1307
1345
|
}
|
|
1308
1346
|
};
|
|
1347
|
+
|
|
1348
|
+
// ../vinyl-util/src/util/collection/array.ts
|
|
1309
1349
|
function last(arrayLike) {
|
|
1310
1350
|
if (!arrayLike) return void 0;
|
|
1311
1351
|
return arrayLike[arrayLike.length - 1];
|
|
@@ -1316,6 +1356,8 @@
|
|
|
1316
1356
|
array.splice(index, 1);
|
|
1317
1357
|
return true;
|
|
1318
1358
|
}
|
|
1359
|
+
|
|
1360
|
+
// ../vinyl-util/src/util/collection/typedArray.ts
|
|
1319
1361
|
function cloneTypedArray(array) {
|
|
1320
1362
|
return new array.constructor(array);
|
|
1321
1363
|
}
|
|
@@ -1333,16 +1375,20 @@
|
|
|
1333
1375
|
function isTypedArray(value) {
|
|
1334
1376
|
return typedArrayTypes.some((type) => value instanceof type);
|
|
1335
1377
|
}
|
|
1378
|
+
|
|
1379
|
+
// ../vinyl-util/src/core/cloneable.ts
|
|
1336
1380
|
function isCloneable(value) {
|
|
1337
1381
|
return value != null && typeof value === "object" && "clone" in value && typeof value.clone === "function" && value.clone.length === 0;
|
|
1338
1382
|
}
|
|
1383
|
+
|
|
1384
|
+
// ../vinyl-util/src/util/object/mergeDeep.ts
|
|
1339
1385
|
var locale3 = {
|
|
1340
1386
|
cyclicRefError: "Cyclic reference found at: {path}",
|
|
1341
1387
|
mergeReferenceError: `No merge rule found at {path} for "{source}" and reference copy not allowed`
|
|
1342
1388
|
};
|
|
1343
1389
|
function mergeDeep(sources, options) {
|
|
1344
1390
|
if (!sources.length) return void 0;
|
|
1345
|
-
const finalOpts =
|
|
1391
|
+
const finalOpts = __spreadValues(__spreadValues({}, defaultMergeOptions), options);
|
|
1346
1392
|
const stack = new PropStack();
|
|
1347
1393
|
const n = sources.length;
|
|
1348
1394
|
if (n === 1)
|
|
@@ -1355,9 +1401,15 @@
|
|
|
1355
1401
|
}
|
|
1356
1402
|
var PropStack = class {
|
|
1357
1403
|
constructor() {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1404
|
+
/**
|
|
1405
|
+
* Object references for sourceA.
|
|
1406
|
+
*/
|
|
1407
|
+
__publicField(this, "refsA", /* @__PURE__ */ new Set());
|
|
1408
|
+
/**
|
|
1409
|
+
* Object references for sourceB.
|
|
1410
|
+
*/
|
|
1411
|
+
__publicField(this, "refsB", /* @__PURE__ */ new Set());
|
|
1412
|
+
__publicField(this, "propStack", []);
|
|
1361
1413
|
}
|
|
1362
1414
|
/**
|
|
1363
1415
|
* The property stack, joined by .
|
|
@@ -1387,7 +1439,7 @@
|
|
|
1387
1439
|
};
|
|
1388
1440
|
function _mergeDeep(sourceA, sourceB, propStack, prop, options) {
|
|
1389
1441
|
if (typeof sourceB !== "object" || sourceB === null) return sourceB;
|
|
1390
|
-
const
|
|
1442
|
+
const merge = (sourceA2, sourceB2, prop2) => {
|
|
1391
1443
|
return _mergeDeep(sourceA2, sourceB2, propStack, prop2, options);
|
|
1392
1444
|
};
|
|
1393
1445
|
for (const rule of options.rules) {
|
|
@@ -1396,7 +1448,7 @@
|
|
|
1396
1448
|
const result = rule.merge(
|
|
1397
1449
|
rule.matches(sourceA) ? sourceA : void 0,
|
|
1398
1450
|
sourceB,
|
|
1399
|
-
|
|
1451
|
+
merge
|
|
1400
1452
|
);
|
|
1401
1453
|
propStack.pop();
|
|
1402
1454
|
return result;
|
|
@@ -1431,15 +1483,15 @@
|
|
|
1431
1483
|
matches(object) {
|
|
1432
1484
|
return Array.isArray(object);
|
|
1433
1485
|
},
|
|
1434
|
-
merge(sourceA, sourceB,
|
|
1486
|
+
merge(sourceA, sourceB, merge) {
|
|
1435
1487
|
const out = [];
|
|
1436
1488
|
if (sourceA) {
|
|
1437
1489
|
for (const element2 of sourceA) {
|
|
1438
|
-
out.push(
|
|
1490
|
+
out.push(merge(void 0, element2, out.length));
|
|
1439
1491
|
}
|
|
1440
1492
|
}
|
|
1441
1493
|
for (const element2 of sourceB) {
|
|
1442
|
-
out.push(
|
|
1494
|
+
out.push(merge(void 0, element2, out.length));
|
|
1443
1495
|
}
|
|
1444
1496
|
return out;
|
|
1445
1497
|
}
|
|
@@ -1448,15 +1500,15 @@
|
|
|
1448
1500
|
matches(object) {
|
|
1449
1501
|
return isPlainObject(object);
|
|
1450
1502
|
},
|
|
1451
|
-
merge(sourceA, sourceB,
|
|
1503
|
+
merge(sourceA, sourceB, merge) {
|
|
1452
1504
|
const out = {};
|
|
1453
1505
|
for (const key of union(ownKeys(sourceA), ownKeys(sourceB))) {
|
|
1454
1506
|
if (sourceA && key in sourceB && key in sourceA) {
|
|
1455
|
-
out[key] =
|
|
1507
|
+
out[key] = merge(sourceA[key], sourceB[key], key);
|
|
1456
1508
|
} else if (sourceA && key in sourceA) {
|
|
1457
|
-
out[key] =
|
|
1509
|
+
out[key] = merge(void 0, sourceA[key], key);
|
|
1458
1510
|
} else {
|
|
1459
|
-
out[key] =
|
|
1511
|
+
out[key] = merge(void 0, sourceB[key], key);
|
|
1460
1512
|
}
|
|
1461
1513
|
}
|
|
1462
1514
|
return out;
|
|
@@ -1482,7 +1534,7 @@
|
|
|
1482
1534
|
matches(object) {
|
|
1483
1535
|
return object instanceof Map;
|
|
1484
1536
|
},
|
|
1485
|
-
merge(sourceA, sourceB,
|
|
1537
|
+
merge(sourceA, sourceB, merge) {
|
|
1486
1538
|
var _a3;
|
|
1487
1539
|
const out = /* @__PURE__ */ new Map();
|
|
1488
1540
|
for (const key of /* @__PURE__ */ new Set([
|
|
@@ -1490,11 +1542,11 @@
|
|
|
1490
1542
|
...sourceB.keys()
|
|
1491
1543
|
])) {
|
|
1492
1544
|
if (sourceB.has(key) && (sourceA == null ? void 0 : sourceA.has(key))) {
|
|
1493
|
-
out.set(key,
|
|
1545
|
+
out.set(key, merge(sourceA.get(key), sourceB.get(key), key));
|
|
1494
1546
|
} else if (sourceA == null ? void 0 : sourceA.has(key)) {
|
|
1495
|
-
out.set(key,
|
|
1547
|
+
out.set(key, merge(void 0, sourceA.get(key), key));
|
|
1496
1548
|
} else {
|
|
1497
|
-
out.set(key,
|
|
1549
|
+
out.set(key, merge(void 0, sourceB.get(key), key));
|
|
1498
1550
|
}
|
|
1499
1551
|
}
|
|
1500
1552
|
return out;
|
|
@@ -1504,12 +1556,12 @@
|
|
|
1504
1556
|
matches(object) {
|
|
1505
1557
|
return object instanceof Set;
|
|
1506
1558
|
},
|
|
1507
|
-
merge(sourceA, sourceB,
|
|
1559
|
+
merge(sourceA, sourceB, merge) {
|
|
1508
1560
|
var _a3;
|
|
1509
1561
|
return new Set(
|
|
1510
1562
|
[...(_a3 = sourceA == null ? void 0 : sourceA.values()) != null ? _a3 : [], ...sourceB.values()].map(
|
|
1511
1563
|
(element2, index) => {
|
|
1512
|
-
return
|
|
1564
|
+
return merge(void 0, element2, index);
|
|
1513
1565
|
}
|
|
1514
1566
|
)
|
|
1515
1567
|
);
|
|
@@ -1545,11 +1597,8 @@
|
|
|
1545
1597
|
urlMergeRule
|
|
1546
1598
|
]
|
|
1547
1599
|
};
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
if (Array.isArray(sources[0])) return Array.prototype.concat(...sources);
|
|
1551
|
-
return Object.assign({}, ...sources);
|
|
1552
|
-
}
|
|
1600
|
+
|
|
1601
|
+
// ../vinyl-util/src/error/IllegalStateError.ts
|
|
1553
1602
|
var IllegalStateError = class _IllegalStateError extends ReportableError {
|
|
1554
1603
|
get [Symbol.toStringTag]() {
|
|
1555
1604
|
return "IllegalStateError";
|
|
@@ -1559,6 +1608,8 @@
|
|
|
1559
1608
|
Object.setPrototypeOf(this, _IllegalStateError.prototype);
|
|
1560
1609
|
}
|
|
1561
1610
|
};
|
|
1611
|
+
|
|
1612
|
+
// ../vinyl-util/src/core/disposable.ts
|
|
1562
1613
|
function isDisposable(value) {
|
|
1563
1614
|
return value != null && typeof value.dispose === "function" && value.dispose.length === 0;
|
|
1564
1615
|
}
|
|
@@ -1571,16 +1622,18 @@
|
|
|
1571
1622
|
Object.setPrototypeOf(this, _DisposedError.prototype);
|
|
1572
1623
|
}
|
|
1573
1624
|
};
|
|
1625
|
+
|
|
1626
|
+
// ../vinyl-util/src/util/object/lazy.ts
|
|
1574
1627
|
var LazyImpl = class {
|
|
1575
1628
|
/**
|
|
1576
1629
|
* @param factory A factory function that will be invoked at most once.
|
|
1577
1630
|
*/
|
|
1578
1631
|
constructor(factory) {
|
|
1579
|
-
this
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1632
|
+
__publicField(this, "factory", factory);
|
|
1633
|
+
__publicField(this, "_constructing", false);
|
|
1634
|
+
__publicField(this, "_constructed", false);
|
|
1635
|
+
__publicField(this, "disposed", false);
|
|
1636
|
+
__publicField(this, "_value");
|
|
1584
1637
|
}
|
|
1585
1638
|
get constructed() {
|
|
1586
1639
|
return this._constructed;
|
|
@@ -1621,6 +1674,8 @@
|
|
|
1621
1674
|
function lazy(factory) {
|
|
1622
1675
|
return new LazyImpl(factory);
|
|
1623
1676
|
}
|
|
1677
|
+
|
|
1678
|
+
// ../vinyl-util/src/util/object/clone.ts
|
|
1624
1679
|
function clone(target, options) {
|
|
1625
1680
|
var _a3, _b, _c;
|
|
1626
1681
|
return mergeDeep([target], {
|
|
@@ -1631,16 +1686,18 @@
|
|
|
1631
1686
|
function toMergeRule(cloneRule) {
|
|
1632
1687
|
return {
|
|
1633
1688
|
matches: cloneRule.matches,
|
|
1634
|
-
merge(_sourceA, sourceB,
|
|
1689
|
+
merge(_sourceA, sourceB, merge) {
|
|
1635
1690
|
return cloneRule.clone(
|
|
1636
1691
|
sourceB,
|
|
1637
1692
|
(source, prop) => {
|
|
1638
|
-
return
|
|
1693
|
+
return merge(void 0, source, prop);
|
|
1639
1694
|
}
|
|
1640
1695
|
);
|
|
1641
1696
|
}
|
|
1642
1697
|
};
|
|
1643
1698
|
}
|
|
1699
|
+
|
|
1700
|
+
// ../vinyl-util/src/error/ValidationError.ts
|
|
1644
1701
|
var ValidationError = class _ValidationError extends ReportableError {
|
|
1645
1702
|
/**
|
|
1646
1703
|
* @param message The validation error message.
|
|
@@ -1649,19 +1706,21 @@
|
|
|
1649
1706
|
*/
|
|
1650
1707
|
constructor(message, origin = ErrorOrigin.API, path = []) {
|
|
1651
1708
|
super(message, origin);
|
|
1652
|
-
this
|
|
1709
|
+
__publicField(this, "path", path);
|
|
1653
1710
|
Object.setPrototypeOf(this, _ValidationError.prototype);
|
|
1654
1711
|
}
|
|
1655
1712
|
get [Symbol.toStringTag]() {
|
|
1656
1713
|
return "ValidationError";
|
|
1657
1714
|
}
|
|
1658
1715
|
toJSON() {
|
|
1659
|
-
return __spreadProps(
|
|
1716
|
+
return __spreadProps(__spreadValues({}, super.toJSON()), {
|
|
1660
1717
|
origin: this.origin,
|
|
1661
1718
|
path: this.path
|
|
1662
1719
|
});
|
|
1663
1720
|
}
|
|
1664
1721
|
};
|
|
1722
|
+
|
|
1723
|
+
// ../vinyl-util/src/util/iteration/iterable.ts
|
|
1665
1724
|
function mapIter(iterable, transform) {
|
|
1666
1725
|
const it2 = iterable[Symbol.iterator]();
|
|
1667
1726
|
return {
|
|
@@ -1678,13 +1737,34 @@
|
|
|
1678
1737
|
}
|
|
1679
1738
|
};
|
|
1680
1739
|
}
|
|
1740
|
+
|
|
1741
|
+
// ../vinyl-util/src/util/collection/LruCache.ts
|
|
1681
1742
|
var LruCache = class {
|
|
1682
1743
|
constructor(initialCapacity) {
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1744
|
+
/**
|
|
1745
|
+
* A map of the list nodes.
|
|
1746
|
+
*
|
|
1747
|
+
* @private
|
|
1748
|
+
*/
|
|
1749
|
+
__publicField(this, "cache", /* @__PURE__ */ new Map());
|
|
1750
|
+
/**
|
|
1751
|
+
* Most recently used elements are at the tail, least recently used are at the head.
|
|
1752
|
+
* @private
|
|
1753
|
+
*/
|
|
1754
|
+
__publicField(this, "list", new LinkedList());
|
|
1755
|
+
/**
|
|
1756
|
+
* An element is about to be removed. Should return true if the element may be evicted,
|
|
1757
|
+
* otherwise false.
|
|
1758
|
+
* If false is returned for all elements, an IllegalStateError is thrown.
|
|
1759
|
+
*/
|
|
1760
|
+
__publicField(this, "onEvicting", null);
|
|
1761
|
+
/**
|
|
1762
|
+
* When an element is added when at capacity, the least recently used element will be removed.
|
|
1763
|
+
* This callback can be set to be notified with the element being evicted, which may be used
|
|
1764
|
+
* for disposal.
|
|
1765
|
+
*/
|
|
1766
|
+
__publicField(this, "onEvict", null);
|
|
1767
|
+
__publicField(this, "_capacity", 0);
|
|
1688
1768
|
this._capacity = initialCapacity;
|
|
1689
1769
|
}
|
|
1690
1770
|
get capacity() {
|
|
@@ -1813,6 +1893,8 @@
|
|
|
1813
1893
|
return "LruCache";
|
|
1814
1894
|
}
|
|
1815
1895
|
};
|
|
1896
|
+
|
|
1897
|
+
// ../vinyl-util/src/util/fun/memoize.ts
|
|
1816
1898
|
function memoize(inner, keyProvider, capacity = 500) {
|
|
1817
1899
|
if (!keyProvider) {
|
|
1818
1900
|
let cached = false;
|
|
@@ -1879,6 +1961,8 @@
|
|
|
1879
1961
|
);
|
|
1880
1962
|
}
|
|
1881
1963
|
}
|
|
1964
|
+
|
|
1965
|
+
// ../vinyl-util/src/util/date/date.ts
|
|
1882
1966
|
var locale4 = {
|
|
1883
1967
|
invalidDateError: `"{value}" is an invalid date`
|
|
1884
1968
|
};
|
|
@@ -1897,6 +1981,8 @@
|
|
|
1897
1981
|
function stringifyDate(value) {
|
|
1898
1982
|
return value.toISOString();
|
|
1899
1983
|
}
|
|
1984
|
+
|
|
1985
|
+
// ../vinyl-util/src/global/environment.ts
|
|
1900
1986
|
function getLocation() {
|
|
1901
1987
|
return typeof location === "object" ? location : defaultLocation;
|
|
1902
1988
|
}
|
|
@@ -1905,7 +1991,9 @@
|
|
|
1905
1991
|
search: "",
|
|
1906
1992
|
href: ""
|
|
1907
1993
|
};
|
|
1908
|
-
|
|
1994
|
+
|
|
1995
|
+
// ../vinyl-util/src/util/browser/searchParams.ts
|
|
1996
|
+
var getSearchParams = memoize(
|
|
1909
1997
|
(search = getLocationSearch()) => {
|
|
1910
1998
|
const url = new URL("about:blank");
|
|
1911
1999
|
url.search = search;
|
|
@@ -1917,9 +2005,11 @@
|
|
|
1917
2005
|
function getLocationSearch() {
|
|
1918
2006
|
return getLocation().search;
|
|
1919
2007
|
}
|
|
2008
|
+
|
|
2009
|
+
// ../vinyl-util/src/global/globalRegistry.ts
|
|
1920
2010
|
var GlobalRegistry = class {
|
|
1921
2011
|
constructor() {
|
|
1922
|
-
|
|
2012
|
+
__publicField(this, "registry", []);
|
|
1923
2013
|
}
|
|
1924
2014
|
/**
|
|
1925
2015
|
* Returns the number of references currently in the registry.
|
|
@@ -1963,12 +2053,12 @@
|
|
|
1963
2053
|
var globalRefDebug = false;
|
|
1964
2054
|
var GlobalRefImpl = class {
|
|
1965
2055
|
constructor(defaultInitializer) {
|
|
1966
|
-
this
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
2056
|
+
__publicField(this, "defaultInitializer", defaultInitializer);
|
|
2057
|
+
__publicField(this, "_value");
|
|
2058
|
+
__publicField(this, "_initialized", false);
|
|
2059
|
+
__publicField(this, "constructing", false);
|
|
2060
|
+
__publicField(this, "initializer");
|
|
2061
|
+
__publicField(this, "lastInitStack", null);
|
|
1972
2062
|
this.initializer = defaultInitializer;
|
|
1973
2063
|
}
|
|
1974
2064
|
get initialized() {
|
|
@@ -2034,10 +2124,10 @@ ${this.lastInitStack}` : "";
|
|
|
2034
2124
|
};
|
|
2035
2125
|
var GlobalRefOverride = class _GlobalRefOverride {
|
|
2036
2126
|
constructor(original, defaultInitializer, setInitializer) {
|
|
2037
|
-
this
|
|
2038
|
-
this
|
|
2039
|
-
this
|
|
2040
|
-
|
|
2127
|
+
__publicField(this, "original", original);
|
|
2128
|
+
__publicField(this, "defaultInitializer", defaultInitializer);
|
|
2129
|
+
__publicField(this, "setInitializer", setInitializer);
|
|
2130
|
+
__publicField(this, "initializer");
|
|
2041
2131
|
this.initializer = defaultInitializer;
|
|
2042
2132
|
}
|
|
2043
2133
|
get initialized() {
|
|
@@ -2071,22 +2161,26 @@ ${this.lastInitStack}` : "";
|
|
|
2071
2161
|
function globalRef(init) {
|
|
2072
2162
|
return getGlobalRegistry().register(new GlobalRefImpl(init));
|
|
2073
2163
|
}
|
|
2074
|
-
|
|
2164
|
+
|
|
2165
|
+
// ../vinyl-util/src/logging/getLogLevelFromSearch.ts
|
|
2166
|
+
function getLogLevelFromSearch(search = getLocationSearch(), defaultLevel = 3 /* WARN */) {
|
|
2075
2167
|
var _a3;
|
|
2076
2168
|
const str = getSearchParams(search).get("vinylLogLevel");
|
|
2077
2169
|
if (!str) return defaultLevel;
|
|
2078
2170
|
return (_a3 = parseLogLevel(str)) != null ? _a3 : defaultLevel;
|
|
2079
2171
|
}
|
|
2172
|
+
|
|
2173
|
+
// ../vinyl-util/src/logging/Logger.ts
|
|
2080
2174
|
var LoggerImpl = class extends EventHostImpl {
|
|
2081
|
-
constructor(logLevel = 1) {
|
|
2175
|
+
constructor(logLevel = 1 /* DEBUG */) {
|
|
2082
2176
|
super();
|
|
2083
|
-
this
|
|
2177
|
+
__publicField(this, "logLevel", logLevel);
|
|
2084
2178
|
}
|
|
2085
2179
|
get [Symbol.toStringTag]() {
|
|
2086
2180
|
return "Logger";
|
|
2087
2181
|
}
|
|
2088
2182
|
log(target, level, ...messages) {
|
|
2089
|
-
if (level === 5 || level < this.logLevel) return;
|
|
2183
|
+
if (level === 5 /* NONE */ || level < this.logLevel) return;
|
|
2090
2184
|
this.dispatch("log", {
|
|
2091
2185
|
level,
|
|
2092
2186
|
messages: toJson(messages),
|
|
@@ -2094,25 +2188,23 @@ ${this.lastInitStack}` : "";
|
|
|
2094
2188
|
});
|
|
2095
2189
|
}
|
|
2096
2190
|
};
|
|
2097
|
-
var loggerRef =
|
|
2191
|
+
var loggerRef = globalRef(
|
|
2098
2192
|
() => new LoggerImpl(
|
|
2099
2193
|
// The logger is initialized to VERBOSE if vinylLogLevel=verbose is in the query string
|
|
2100
2194
|
// Otherwise use DEBUG.
|
|
2101
|
-
getLogLevelFromSearch() === 0 ? 0 : 1
|
|
2102
|
-
/* DEBUG */
|
|
2195
|
+
getLogLevelFromSearch() === 0 /* VERBOSE */ ? 0 /* VERBOSE */ : 1 /* DEBUG */
|
|
2103
2196
|
)
|
|
2104
2197
|
);
|
|
2105
2198
|
function logDebug(target, ...messages) {
|
|
2106
|
-
loggerRef.value.log(target, 1
|
|
2199
|
+
loggerRef.value.log(target, 1 /* DEBUG */, ...messages);
|
|
2107
2200
|
}
|
|
2108
2201
|
var strToLogLevel = {
|
|
2109
|
-
verbose: 0
|
|
2110
|
-
debug: 1
|
|
2111
|
-
info: 2
|
|
2112
|
-
warn: 3
|
|
2113
|
-
error: 4
|
|
2114
|
-
none: 5
|
|
2115
|
-
/* NONE */
|
|
2202
|
+
verbose: 0 /* VERBOSE */,
|
|
2203
|
+
debug: 1 /* DEBUG */,
|
|
2204
|
+
info: 2 /* INFO */,
|
|
2205
|
+
warn: 3 /* WARN */,
|
|
2206
|
+
error: 4 /* ERROR */,
|
|
2207
|
+
none: 5 /* NONE */
|
|
2116
2208
|
};
|
|
2117
2209
|
function parseLogLevel(str) {
|
|
2118
2210
|
var _a3;
|
|
@@ -2288,1870 +2380,1233 @@ ${this.lastInitStack}` : "";
|
|
|
2288
2380
|
});
|
|
2289
2381
|
});
|
|
2290
2382
|
|
|
2291
|
-
// ../vinyl-
|
|
2292
|
-
var
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
var
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
for (var prop in b || (b = {}))
|
|
2301
|
-
if (__hasOwnProp3.call(b, prop))
|
|
2302
|
-
__defNormalProp4(a, prop, b[prop]);
|
|
2303
|
-
if (__getOwnPropSymbols3)
|
|
2304
|
-
for (var prop of __getOwnPropSymbols3(b)) {
|
|
2305
|
-
if (__propIsEnum3.call(b, prop))
|
|
2306
|
-
__defNormalProp4(a, prop, b[prop]);
|
|
2307
|
-
}
|
|
2308
|
-
return a;
|
|
2309
|
-
};
|
|
2310
|
-
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
2311
|
-
var __publicField4 = (obj, key, value) => __defNormalProp4(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2312
|
-
var validatorLocale = {
|
|
2313
|
-
/**
|
|
2314
|
-
* The expectation template string with the following replacement tokens:
|
|
2315
|
-
*
|
|
2316
|
-
* `{expected}` - The expected description.
|
|
2317
|
-
* `{actual}` - The actual value.
|
|
2318
|
-
* `{path}` - The path, dot separated.
|
|
2319
|
-
*/
|
|
2320
|
-
template: "Expected: {expected}, but was: {actual}. At: {path}"
|
|
2321
|
-
};
|
|
2322
|
-
function createValidationExpectationMessage(expectationMessage, input, path, inputStringify = (input2) => stringifyForPrint(input2, 500)) {
|
|
2323
|
-
return substitute(validatorLocale.template, {
|
|
2324
|
-
expected: expectationMessage,
|
|
2325
|
-
actual: inputStringify(input),
|
|
2326
|
-
path: path.join(".")
|
|
2327
|
-
});
|
|
2383
|
+
// ../vinyl-mpd-parser/src/xmlns/mpeg/cenc/2013.ts
|
|
2384
|
+
var CENC_NAMESPACE_URI = "urn:mpeg:cenc:2013";
|
|
2385
|
+
|
|
2386
|
+
// ../vinyl-mpd-parser/src/xmlns/microsoft/playready.ts
|
|
2387
|
+
var PLAY_READY_NAMESPACE_URI = "urn:microsoft:playready";
|
|
2388
|
+
|
|
2389
|
+
// ../vinyl-mpd-parser/src/error/parsingError.ts
|
|
2390
|
+
function throwParsingError(message) {
|
|
2391
|
+
throw new ValidationError(message, ErrorOrigin.PARSING);
|
|
2328
2392
|
}
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
if (!isValid(input)) {
|
|
2337
|
-
return [
|
|
2338
|
-
{
|
|
2339
|
-
message: createValidationExpectationMessage(
|
|
2340
|
-
expectationMessage,
|
|
2341
|
-
input,
|
|
2342
|
-
path,
|
|
2343
|
-
inputStringify
|
|
2344
|
-
),
|
|
2345
|
-
path
|
|
2346
|
-
}
|
|
2347
|
-
];
|
|
2348
|
-
}
|
|
2349
|
-
return [];
|
|
2350
|
-
},
|
|
2351
|
-
assert: (input, origin, path = []) => {
|
|
2352
|
-
if (!isValid(input)) {
|
|
2353
|
-
throw new ValidationError(
|
|
2354
|
-
createValidationExpectationMessage(
|
|
2355
|
-
expectationMessage,
|
|
2356
|
-
input,
|
|
2357
|
-
path,
|
|
2358
|
-
inputStringify
|
|
2359
|
-
),
|
|
2360
|
-
origin,
|
|
2361
|
-
path
|
|
2362
|
-
);
|
|
2363
|
-
}
|
|
2364
|
-
}
|
|
2365
|
-
};
|
|
2393
|
+
|
|
2394
|
+
// ../vinyl-mpd-parser/src/media/ratio.ts
|
|
2395
|
+
var ratioRegExp = /^([0-9]*):([0-9]*)$/;
|
|
2396
|
+
function parseRatio(str) {
|
|
2397
|
+
const match = str ? ratioRegExp.exec(str) : null;
|
|
2398
|
+
if (!match) throwParsingError(`invalid ratio format: ${str}`);
|
|
2399
|
+
return [parseInt(match[1] || "1"), parseInt(match[2] || "1")];
|
|
2366
2400
|
}
|
|
2367
|
-
function
|
|
2368
|
-
return {
|
|
2369
|
-
description,
|
|
2370
|
-
isValid(input) {
|
|
2371
|
-
return validate(input, { all: false }, []).length === 0;
|
|
2372
|
-
},
|
|
2373
|
-
validate(input, options, path = []) {
|
|
2374
|
-
return validate(input, options != null ? options : { all: false }, path);
|
|
2375
|
-
},
|
|
2376
|
-
assert: (input, origin, path = []) => {
|
|
2377
|
-
const errors = validate(input, { all: false }, path);
|
|
2378
|
-
if (errors.length) {
|
|
2379
|
-
const error = errors[0];
|
|
2380
|
-
throw new ValidationError(error.message, origin, error.path);
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
};
|
|
2401
|
+
function stringifyRatio(value) {
|
|
2402
|
+
return `${value[0]}:${value[1]}`;
|
|
2384
2403
|
}
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
*/
|
|
2393
|
-
template: "{value}",
|
|
2394
|
-
/**
|
|
2395
|
-
* The separator with which to join child validator descriptions.
|
|
2396
|
-
*/
|
|
2397
|
-
separator: " & "
|
|
2398
|
-
};
|
|
2399
|
-
function andValidators(...validators) {
|
|
2400
|
-
return createDeepValidator(
|
|
2401
|
-
substitute(locale5.template, {
|
|
2402
|
-
value: validators.map((v) => v.description).join(locale5.separator)
|
|
2403
|
-
}),
|
|
2404
|
-
(input, options, path) => {
|
|
2405
|
-
for (const validator of validators) {
|
|
2406
|
-
const errors = validator.validate(input, options, path);
|
|
2407
|
-
if (errors.length) return errors;
|
|
2408
|
-
}
|
|
2409
|
-
return [];
|
|
2410
|
-
}
|
|
2411
|
-
);
|
|
2404
|
+
|
|
2405
|
+
// ../vinyl-mpd-parser/src/media/frameRate.ts
|
|
2406
|
+
var framerateRegexp = /^(\d+)(?:\/(\d+))?$/;
|
|
2407
|
+
function parseFrameRate(str) {
|
|
2408
|
+
const match = str ? framerateRegexp.exec(str) : null;
|
|
2409
|
+
if (!match) throwParsingError(`invalid frame rate: '${str}'`);
|
|
2410
|
+
return [parseInt(match[1]), parseInt(match[2] || "1")];
|
|
2412
2411
|
}
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2412
|
+
function stringifyFrameRate(value) {
|
|
2413
|
+
return value[1] === 1 ? value[0].toString() : `${value[0]}/${value[1]}`;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
// ../vinyl-mpd-parser/src/media/byteRange.ts
|
|
2417
|
+
var byteRangeExp = /^(-?[0-9]+)-(-?[0-9]*)$/;
|
|
2418
|
+
function parseByteRange(str) {
|
|
2419
|
+
const match = str ? byteRangeExp.exec(str) : null;
|
|
2420
|
+
if (!match) throwParsingError(`invalid byte range: '${str}'`);
|
|
2421
|
+
let start = parseInt(match[1]);
|
|
2422
|
+
if (start < 0) start >>>= 0;
|
|
2423
|
+
let end = parseIntSafe(match[2]);
|
|
2424
|
+
if (end != null && end < 0) end = end >>> 0;
|
|
2425
|
+
return [start, end];
|
|
2426
|
+
}
|
|
2427
|
+
function stringifyByteRange(value) {
|
|
2428
|
+
const end = value[1];
|
|
2429
|
+
return `${value[0]}-${end == null ? "" : end}`;
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
// ../vinyl-xml/src/xml/xmlRules.ts
|
|
2433
|
+
function element(rules, options) {
|
|
2434
|
+
return __spreadProps(__spreadValues({
|
|
2435
|
+
type: "element" /* ELEMENT */,
|
|
2436
|
+
localPart: void 0,
|
|
2437
|
+
namespaceUri: void 0,
|
|
2438
|
+
required: false
|
|
2439
|
+
}, options), {
|
|
2440
|
+
rules
|
|
2426
2441
|
});
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
longestErrors = errors;
|
|
2439
|
-
longestPath = pathLength;
|
|
2440
|
-
}
|
|
2441
|
-
}
|
|
2442
|
-
return longestPath > path.length ? longestErrors : [
|
|
2443
|
-
{
|
|
2444
|
-
message: createValidationExpectationMessage(
|
|
2445
|
-
description,
|
|
2446
|
-
input,
|
|
2447
|
-
path
|
|
2448
|
-
),
|
|
2449
|
-
path
|
|
2450
|
-
}
|
|
2451
|
-
];
|
|
2442
|
+
}
|
|
2443
|
+
function elements(rules, options) {
|
|
2444
|
+
return __spreadProps(__spreadValues({
|
|
2445
|
+
type: "elements" /* ELEMENTS */,
|
|
2446
|
+
localPart: void 0,
|
|
2447
|
+
namespaceUri: void 0,
|
|
2448
|
+
minOccurs: 0,
|
|
2449
|
+
maxOccurs: null,
|
|
2450
|
+
useEmptyArrays: false
|
|
2451
|
+
}, options), {
|
|
2452
|
+
rules
|
|
2452
2453
|
});
|
|
2453
2454
|
}
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
}
|
|
2457
|
-
var
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2455
|
+
function characters(parse, stringify2) {
|
|
2456
|
+
return { type: "characters" /* CHARACTERS */, parse, stringify: stringify2 };
|
|
2457
|
+
}
|
|
2458
|
+
var charactersString = characters((i) => i, stringify);
|
|
2459
|
+
function attr(parse, stringify2, options) {
|
|
2460
|
+
return __spreadProps(__spreadValues({
|
|
2461
|
+
type: "attribute" /* ATTRIBUTE */,
|
|
2462
|
+
localPart: void 0,
|
|
2463
|
+
namespaceUri: null,
|
|
2464
|
+
required: false,
|
|
2465
|
+
default: void 0
|
|
2466
|
+
}, options), {
|
|
2467
|
+
parse,
|
|
2468
|
+
stringify: stringify2
|
|
2469
|
+
});
|
|
2470
|
+
}
|
|
2471
|
+
function attrString(options) {
|
|
2472
|
+
return attr((i) => i, stringify, options);
|
|
2473
|
+
}
|
|
2474
|
+
function attrInt(options) {
|
|
2475
|
+
return attr(parseInt, stringify, options);
|
|
2476
|
+
}
|
|
2477
|
+
function attrFloat(options) {
|
|
2478
|
+
return attr(parseFloat, stringify, options);
|
|
2479
|
+
}
|
|
2480
|
+
function attrBoolean(options) {
|
|
2481
|
+
return attr(parseBoolean, stringify, options);
|
|
2482
|
+
}
|
|
2483
|
+
function attrDateTime(options) {
|
|
2484
|
+
return attr(parseDate, stringifyDate, options);
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
// ../vinyl-xml/src/xml/XmlSchemaError.ts
|
|
2488
|
+
var xmlSchemaErrorLocale = {
|
|
2489
|
+
atLeastElements: "Expected at least {expected} occurrences of {property} but was {actual}",
|
|
2490
|
+
atMostElements: "Expected at most {expected} occurrences of {property} but was {actual}",
|
|
2491
|
+
cyclicReferences: "Cyclic reference detected",
|
|
2492
|
+
requiredAttribute: `Attribute '{property}' is required`
|
|
2493
|
+
};
|
|
2494
|
+
var XmlSchemaError = class _XmlSchemaError extends ReportableError {
|
|
2495
|
+
get [Symbol.toStringTag]() {
|
|
2496
|
+
return "XmlSchemaError";
|
|
2474
2497
|
}
|
|
2475
|
-
|
|
2476
|
-
|
|
2498
|
+
constructor(message) {
|
|
2499
|
+
super(message, ErrorOrigin.PARSING);
|
|
2500
|
+
Object.setPrototypeOf(this, _XmlSchemaError.prototype);
|
|
2477
2501
|
}
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2502
|
+
};
|
|
2503
|
+
|
|
2504
|
+
// ../vinyl-xml/src/xml/parseXml.ts
|
|
2505
|
+
var XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
2506
|
+
var LT = char("<");
|
|
2507
|
+
var GT = char(">");
|
|
2508
|
+
var EQ = char("=");
|
|
2509
|
+
var SLASH = char("/");
|
|
2510
|
+
var COLON = char(":");
|
|
2511
|
+
var QMARK = char("?");
|
|
2512
|
+
var EXCL = char("!");
|
|
2513
|
+
var APOS = char("'");
|
|
2514
|
+
var QUOT = char('"');
|
|
2515
|
+
var QUOTES = /* @__PURE__ */ new Set([APOS, QUOT]);
|
|
2516
|
+
function parseXml(str, handler) {
|
|
2517
|
+
const c = new StringReader(str);
|
|
2518
|
+
let current = {
|
|
2519
|
+
qName: "#document",
|
|
2520
|
+
namespaceMap: /* @__PURE__ */ new Map(),
|
|
2521
|
+
defaultNamespaceUri: null
|
|
2522
|
+
};
|
|
2523
|
+
const stack = [current];
|
|
2524
|
+
const namespaceLookup = (prefix) => {
|
|
2525
|
+
if (!prefix) return current.defaultNamespaceUri;
|
|
2526
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
2527
|
+
const map = stack[i].namespaceMap;
|
|
2528
|
+
if (map.has(prefix)) return stack[i].namespaceMap.get(prefix);
|
|
2529
|
+
}
|
|
2530
|
+
return null;
|
|
2531
|
+
};
|
|
2532
|
+
try {
|
|
2533
|
+
handler.startDocument();
|
|
2534
|
+
} catch (e) {
|
|
2535
|
+
c.err(e.message);
|
|
2493
2536
|
}
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2537
|
+
while (c.hasNext()) {
|
|
2538
|
+
const charsStart = c.untilChar(LT);
|
|
2539
|
+
if (charsStart < c.position) {
|
|
2540
|
+
const chars = str.substring(charsStart, c.position);
|
|
2541
|
+
try {
|
|
2542
|
+
handler.textNode(chars);
|
|
2543
|
+
} catch (e) {
|
|
2544
|
+
c.err(e.message);
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
if (!c.hasNext()) break;
|
|
2548
|
+
c.next();
|
|
2549
|
+
if (c.charIf(SLASH)) {
|
|
2550
|
+
c.white();
|
|
2551
|
+
const name = readQName(c);
|
|
2552
|
+
if (name.qName !== current.qName)
|
|
2553
|
+
c.err(`Expected </${current.qName}> but was </${name.qName}>`);
|
|
2554
|
+
stack.pop();
|
|
2555
|
+
current = last(stack);
|
|
2556
|
+
c.white();
|
|
2557
|
+
c.readChar(GT);
|
|
2558
|
+
try {
|
|
2559
|
+
handler.endElement();
|
|
2560
|
+
} catch (e) {
|
|
2561
|
+
c.err(e.message);
|
|
2562
|
+
}
|
|
2563
|
+
} else if (c.charIf(QMARK)) {
|
|
2564
|
+
untilTagClose(c);
|
|
2565
|
+
} else if (c.charIf(EXCL)) {
|
|
2566
|
+
if (c.charIf(
|
|
2567
|
+
45
|
|
2568
|
+
/* - */
|
|
2569
|
+
)) {
|
|
2570
|
+
c.readChar(45);
|
|
2571
|
+
c.untilString("-->");
|
|
2572
|
+
c.read("-->");
|
|
2573
|
+
} else if (c.stringIf("[CDATA[")) {
|
|
2574
|
+
const charsStart2 = c.untilString("]]>");
|
|
2575
|
+
try {
|
|
2576
|
+
handler.cDataNode(str.substring(charsStart2, c.position));
|
|
2577
|
+
} catch (e) {
|
|
2578
|
+
c.err(e.message);
|
|
2579
|
+
}
|
|
2580
|
+
c.read("]]>");
|
|
2581
|
+
} else {
|
|
2582
|
+
untilTagClose(c);
|
|
2583
|
+
}
|
|
2584
|
+
} else {
|
|
2585
|
+
const name = readQName(c);
|
|
2586
|
+
current = {
|
|
2587
|
+
qName: name.qName,
|
|
2588
|
+
namespaceMap: /* @__PURE__ */ new Map(),
|
|
2589
|
+
defaultNamespaceUri: current.defaultNamespaceUri
|
|
2590
|
+
};
|
|
2591
|
+
stack.push(current);
|
|
2592
|
+
const attributes = xmlAttributes(c, current);
|
|
2593
|
+
name.namespaceUri = namespaceLookup(name.prefix);
|
|
2594
|
+
for (const attributesKey in attributes) {
|
|
2595
|
+
const value = attributes[attributesKey];
|
|
2596
|
+
const name2 = value.name;
|
|
2597
|
+
if (name2.prefix && !name2.namespaceUri) {
|
|
2598
|
+
name2.namespaceUri = namespaceLookup(name2.prefix);
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
try {
|
|
2602
|
+
handler.startElement(name, attributes);
|
|
2603
|
+
} catch (e) {
|
|
2604
|
+
c.err(e.message);
|
|
2605
|
+
}
|
|
2606
|
+
if (c.charIf(SLASH)) {
|
|
2607
|
+
c.readChar(GT);
|
|
2608
|
+
stack.pop();
|
|
2609
|
+
current = last(stack);
|
|
2610
|
+
try {
|
|
2611
|
+
handler.endElement();
|
|
2612
|
+
} catch (e) {
|
|
2613
|
+
c.err(e.message);
|
|
2614
|
+
}
|
|
2615
|
+
} else {
|
|
2616
|
+
c.readChar(GT);
|
|
2617
|
+
}
|
|
2499
2618
|
}
|
|
2500
|
-
return new this.constructor(current, previous, operation);
|
|
2501
2619
|
}
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
* @param nextValidator The validator to run after the current.
|
|
2507
|
-
* @return Returns a new Schema instance the same class with a new validator chaining the
|
|
2508
|
-
* current validator with the given next in an AND operation.
|
|
2509
|
-
*/
|
|
2510
|
-
chain(nextValidator) {
|
|
2511
|
-
return this.self(nextValidator, this, andValidators);
|
|
2620
|
+
try {
|
|
2621
|
+
return handler.endDocument();
|
|
2622
|
+
} catch (e) {
|
|
2623
|
+
return c.err(e.message);
|
|
2512
2624
|
}
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2625
|
+
}
|
|
2626
|
+
function readAttributeValue(c) {
|
|
2627
|
+
const quote = c.next();
|
|
2628
|
+
if (!QUOTES.has(quote)) c.err(`Expected ' or "`);
|
|
2629
|
+
const value = c.substringUntil((charCode) => charCode === quote);
|
|
2630
|
+
c.readChar(quote);
|
|
2631
|
+
return decodeEntities(value);
|
|
2632
|
+
}
|
|
2633
|
+
function untilTagClose(c) {
|
|
2634
|
+
while (true) {
|
|
2635
|
+
c.until((c2) => c2 === APOS || c2 === QUOT || c2 === GT);
|
|
2636
|
+
const char2 = c.next();
|
|
2637
|
+
if (QUOTES.has(char2)) {
|
|
2638
|
+
c.untilChar(char2);
|
|
2639
|
+
c.next();
|
|
2640
|
+
} else {
|
|
2641
|
+
break;
|
|
2642
|
+
}
|
|
2519
2643
|
}
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2644
|
+
}
|
|
2645
|
+
function isNameChar(charCode) {
|
|
2646
|
+
if (charCode >= 97) {
|
|
2647
|
+
if (charCode >= 183) {
|
|
2648
|
+
if (charCode >= 768) {
|
|
2649
|
+
if (charCode >= 8255) {
|
|
2650
|
+
return charCode <= 8256;
|
|
2651
|
+
} else {
|
|
2652
|
+
return charCode <= 879;
|
|
2653
|
+
}
|
|
2654
|
+
} else {
|
|
2655
|
+
return charCode === 183;
|
|
2656
|
+
}
|
|
2657
|
+
} else {
|
|
2658
|
+
return charCode <= 122;
|
|
2659
|
+
}
|
|
2660
|
+
} else {
|
|
2661
|
+
if (charCode >= 95) {
|
|
2662
|
+
return charCode === 95;
|
|
2663
|
+
} else {
|
|
2664
|
+
if (charCode >= 65) {
|
|
2665
|
+
return charCode <= 90;
|
|
2666
|
+
} else {
|
|
2667
|
+
if (charCode >= 45) {
|
|
2668
|
+
if (charCode >= 48) {
|
|
2669
|
+
return charCode <= 57;
|
|
2670
|
+
} else {
|
|
2671
|
+
return charCode <= 46;
|
|
2672
|
+
}
|
|
2673
|
+
} else {
|
|
2674
|
+
return false;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2526
2678
|
}
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2679
|
+
}
|
|
2680
|
+
function readQName(reader) {
|
|
2681
|
+
const prefixOrLocalName = reader.substringWhile(isNameChar);
|
|
2682
|
+
let prefix, localPart, name;
|
|
2683
|
+
if (reader.charIf(COLON)) {
|
|
2684
|
+
prefix = prefixOrLocalName;
|
|
2685
|
+
localPart = reader.substringWhile(isNameChar);
|
|
2686
|
+
name = `${prefix}:${localPart}`;
|
|
2687
|
+
} else {
|
|
2688
|
+
prefix = null;
|
|
2689
|
+
localPart = prefixOrLocalName;
|
|
2690
|
+
name = localPart;
|
|
2691
|
+
}
|
|
2692
|
+
return { prefix, localPart, qName: name, namespaceUri: null };
|
|
2693
|
+
}
|
|
2694
|
+
function xmlAttributes(reader, stackElement) {
|
|
2695
|
+
const attributes = {};
|
|
2696
|
+
while (true) {
|
|
2697
|
+
reader.white();
|
|
2698
|
+
if (!isNameChar(reader.peek)) break;
|
|
2699
|
+
const name = readQName(reader);
|
|
2700
|
+
reader.white();
|
|
2701
|
+
let value = "";
|
|
2702
|
+
if (reader.charIf(EQ)) {
|
|
2703
|
+
reader.white();
|
|
2704
|
+
value = readAttributeValue(reader);
|
|
2705
|
+
} else {
|
|
2706
|
+
}
|
|
2707
|
+
if (name.prefix === "xmlns") {
|
|
2708
|
+
name.namespaceUri = XMLNS;
|
|
2709
|
+
stackElement.namespaceMap.set(
|
|
2710
|
+
name.localPart,
|
|
2711
|
+
value === "" ? null : value
|
|
2712
|
+
);
|
|
2713
|
+
} else if (!name.prefix && name.localPart === "xmlns") {
|
|
2714
|
+
name.namespaceUri = XMLNS;
|
|
2715
|
+
stackElement.defaultNamespaceUri = !value ? null : value;
|
|
2716
|
+
}
|
|
2717
|
+
if (attributes[name.qName] != null)
|
|
2718
|
+
reader.err(`Attribute '${name.qName}' is already specified.`);
|
|
2719
|
+
attributes[name.qName] = { name, value };
|
|
2554
2720
|
}
|
|
2721
|
+
return attributes;
|
|
2722
|
+
}
|
|
2723
|
+
|
|
2724
|
+
// ../vinyl-xml/src/xml/mergeXmlRules.ts
|
|
2725
|
+
var locale5 = {
|
|
2726
|
+
illegalRuleOverrideTypeError: "Cannot override the rule {property} of type {sourceType} with a rule of type {overrideType}",
|
|
2727
|
+
illegalQNameOverrideError: "Cannot override the rule {property} with a different localPart or namespace"
|
|
2555
2728
|
};
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2729
|
+
function mergeXmlRules(...rules) {
|
|
2730
|
+
let finalRule = rules[0];
|
|
2731
|
+
for (let i = 1; i < rules.length; i++) {
|
|
2732
|
+
finalRule = plainObjectMergeRule.merge(
|
|
2733
|
+
finalRule,
|
|
2734
|
+
rules[i],
|
|
2735
|
+
mergeXmlRule
|
|
2736
|
+
);
|
|
2562
2737
|
}
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2738
|
+
return finalRule;
|
|
2739
|
+
}
|
|
2740
|
+
function mergeXmlRule(sourceA, sourceB, prop) {
|
|
2741
|
+
var _a3, _b, _c, _d;
|
|
2742
|
+
if (sourceA == null) return sourceB;
|
|
2743
|
+
const sourceAIsLazy = typeof sourceA === "function";
|
|
2744
|
+
const sourceBIsLazy = typeof sourceB === "function";
|
|
2745
|
+
if (sourceAIsLazy || sourceBIsLazy) {
|
|
2746
|
+
return () => {
|
|
2747
|
+
const a = sourceAIsLazy ? sourceA() : sourceA;
|
|
2748
|
+
const b = sourceBIsLazy ? sourceB() : sourceB;
|
|
2749
|
+
return mergeXmlRule(a, b, prop);
|
|
2750
|
+
};
|
|
2568
2751
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2752
|
+
if (sourceA.type !== sourceB.type) {
|
|
2753
|
+
throw new ValidationError(
|
|
2754
|
+
substitute(locale5.illegalRuleOverrideTypeError, {
|
|
2755
|
+
property: prop,
|
|
2756
|
+
sourceType: sourceA.type,
|
|
2757
|
+
overrideType: sourceB.type
|
|
2758
|
+
})
|
|
2759
|
+
);
|
|
2574
2760
|
}
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2761
|
+
switch (sourceA.type) {
|
|
2762
|
+
case "attribute" /* ATTRIBUTE */:
|
|
2763
|
+
case "element" /* ELEMENT */:
|
|
2764
|
+
case "elements" /* ELEMENTS */: {
|
|
2765
|
+
const b = sourceB;
|
|
2766
|
+
if (sourceA.namespaceUri !== b.namespaceUri || ((_a3 = sourceA.localPart) != null ? _a3 : prop) !== ((_b = b.localPart) != null ? _b : prop)) {
|
|
2767
|
+
throw new ValidationError(
|
|
2768
|
+
substitute(locale5.illegalQNameOverrideError, {
|
|
2769
|
+
property: prop
|
|
2770
|
+
})
|
|
2771
|
+
);
|
|
2772
|
+
}
|
|
2773
|
+
break;
|
|
2774
|
+
}
|
|
2585
2775
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2776
|
+
switch (sourceA.type) {
|
|
2777
|
+
case "attribute" /* ATTRIBUTE */: {
|
|
2778
|
+
const b = sourceB;
|
|
2779
|
+
return __spreadProps(__spreadValues({}, b), {
|
|
2780
|
+
default: (_c = b.default) != null ? _c : sourceA.default
|
|
2781
|
+
});
|
|
2782
|
+
}
|
|
2783
|
+
case "characters" /* CHARACTERS */:
|
|
2784
|
+
return sourceB;
|
|
2785
|
+
case "element" /* ELEMENT */: {
|
|
2786
|
+
const b = sourceB;
|
|
2787
|
+
return __spreadProps(__spreadValues({}, b), {
|
|
2788
|
+
required: sourceA.required || b.required,
|
|
2789
|
+
rules: mergeXmlRules(sourceA.rules, b.rules)
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
case "elements" /* ELEMENTS */: {
|
|
2793
|
+
const b = sourceB;
|
|
2794
|
+
const maxOccurs = sourceA.maxOccurs != null && b.maxOccurs != null ? Math.min(sourceA.maxOccurs, b.maxOccurs) : (_d = sourceA.maxOccurs) != null ? _d : b.maxOccurs;
|
|
2795
|
+
return __spreadProps(__spreadValues({}, b), {
|
|
2796
|
+
minOccurs: Math.max(sourceA.minOccurs, b.minOccurs),
|
|
2797
|
+
maxOccurs,
|
|
2798
|
+
useEmptyArrays: sourceA.useEmptyArrays || b.useEmptyArrays,
|
|
2799
|
+
rules: mergeXmlRules(sourceA.rules, b.rules)
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2598
2802
|
}
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
// ../vinyl-xml/src/xml/mappedXmlRules.ts
|
|
2806
|
+
var EmptyRules = {
|
|
2807
|
+
__type: invariant(),
|
|
2808
|
+
attributes: /* @__PURE__ */ new Map(),
|
|
2809
|
+
elements: /* @__PURE__ */ new Map(),
|
|
2810
|
+
characters: void 0
|
|
2599
2811
|
};
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
const errors = [];
|
|
2635
|
-
for (let i = 0; i < input.length; i++) {
|
|
2636
|
-
const element2 = input[i];
|
|
2637
|
-
errors.push(
|
|
2638
|
-
...elementValidator.validate(
|
|
2639
|
-
element2,
|
|
2640
|
-
options,
|
|
2641
|
-
path.concat(i.toString())
|
|
2642
|
-
)
|
|
2812
|
+
function mapXmlRules(rules, parentNamespaceUri = null) {
|
|
2813
|
+
var _a3, _b, _c;
|
|
2814
|
+
const attributeRules = /* @__PURE__ */ new Map();
|
|
2815
|
+
const elementRules = /* @__PURE__ */ new Map();
|
|
2816
|
+
let charactersRule = void 0;
|
|
2817
|
+
for (const property in rules) {
|
|
2818
|
+
const handlerOrFunction = rules[property];
|
|
2819
|
+
let handler;
|
|
2820
|
+
if (typeof handlerOrFunction === "function") {
|
|
2821
|
+
handler = handlerOrFunction();
|
|
2822
|
+
} else {
|
|
2823
|
+
handler = handlerOrFunction;
|
|
2824
|
+
}
|
|
2825
|
+
let key;
|
|
2826
|
+
switch (handler.type) {
|
|
2827
|
+
case "characters" /* CHARACTERS */:
|
|
2828
|
+
if (charactersRule !== void 0)
|
|
2829
|
+
throw new IllegalArgumentError(
|
|
2830
|
+
"characters handler already defined"
|
|
2831
|
+
);
|
|
2832
|
+
charactersRule = {
|
|
2833
|
+
property,
|
|
2834
|
+
parse: handler.parse,
|
|
2835
|
+
stringify: handler.stringify
|
|
2836
|
+
};
|
|
2837
|
+
break;
|
|
2838
|
+
case "element" /* ELEMENT */:
|
|
2839
|
+
case "elements" /* ELEMENTS */: {
|
|
2840
|
+
const localPart = (_a3 = handler.localPart) != null ? _a3 : property;
|
|
2841
|
+
const namespaceUri = handler.namespaceUri === void 0 ? parentNamespaceUri : handler.namespaceUri;
|
|
2842
|
+
key = xmlRuleKey(localPart, namespaceUri);
|
|
2843
|
+
if (elementRules.has(key)) {
|
|
2844
|
+
throw new IllegalArgumentError(
|
|
2845
|
+
`Multiple element rules for ${key}`
|
|
2643
2846
|
);
|
|
2644
|
-
if (!options.all && errors.length) return errors;
|
|
2645
2847
|
}
|
|
2646
|
-
|
|
2848
|
+
if (handler.type === "element" /* ELEMENT */) {
|
|
2849
|
+
const rules2 = handler.rules;
|
|
2850
|
+
elementRules.set(key, {
|
|
2851
|
+
array: false,
|
|
2852
|
+
property,
|
|
2853
|
+
minOccurs: handler.required ? 1 : 0,
|
|
2854
|
+
maxOccurs: 1,
|
|
2855
|
+
rules: memoize(() => mapXmlRules(rules2, namespaceUri)),
|
|
2856
|
+
useEmptyArrays: false,
|
|
2857
|
+
localPart,
|
|
2858
|
+
namespaceUri
|
|
2859
|
+
});
|
|
2860
|
+
} else {
|
|
2861
|
+
const rules2 = handler.rules;
|
|
2862
|
+
elementRules.set(key, {
|
|
2863
|
+
array: true,
|
|
2864
|
+
property,
|
|
2865
|
+
maxOccurs: handler.maxOccurs,
|
|
2866
|
+
minOccurs: handler.minOccurs,
|
|
2867
|
+
rules: memoize(() => mapXmlRules(rules2, namespaceUri)),
|
|
2868
|
+
useEmptyArrays: handler.useEmptyArrays,
|
|
2869
|
+
localPart,
|
|
2870
|
+
namespaceUri
|
|
2871
|
+
});
|
|
2872
|
+
}
|
|
2873
|
+
break;
|
|
2647
2874
|
}
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
*/
|
|
2656
|
-
tuple(...validators) {
|
|
2657
|
-
const lengthValidator = createValidator(
|
|
2658
|
-
substitute(locale42.exactlyLength, {
|
|
2659
|
-
value: validators.length
|
|
2660
|
-
}),
|
|
2661
|
-
(length) => length === validators.length
|
|
2662
|
-
);
|
|
2663
|
-
return createDeepValidator(
|
|
2664
|
-
substitute(locale42.tuple, { value: validators.join(", ") }),
|
|
2665
|
-
(input, options, path) => {
|
|
2666
|
-
const errors = [];
|
|
2667
|
-
errors.push(
|
|
2668
|
-
...lengthValidator.validate(input.length, options, path)
|
|
2669
|
-
);
|
|
2670
|
-
if (!options.all && errors.length) return errors;
|
|
2671
|
-
const n = Math.min(validators.length, input.length);
|
|
2672
|
-
for (let i = 0; i < n; i++) {
|
|
2673
|
-
const element2 = input[i];
|
|
2674
|
-
const validator = validators[i];
|
|
2675
|
-
errors.push(
|
|
2676
|
-
...validator.validate(
|
|
2677
|
-
element2,
|
|
2678
|
-
options,
|
|
2679
|
-
path.concat(i.toString())
|
|
2680
|
-
)
|
|
2875
|
+
case "attribute" /* ATTRIBUTE */: {
|
|
2876
|
+
const namespaceUri = handler.namespaceUri;
|
|
2877
|
+
const localPart = (_b = handler.localPart) != null ? _b : property;
|
|
2878
|
+
key = xmlRuleKey(localPart, namespaceUri);
|
|
2879
|
+
if (attributeRules.has(key)) {
|
|
2880
|
+
throw new IllegalArgumentError(
|
|
2881
|
+
`Multiple attribute rules for ${key}`
|
|
2681
2882
|
);
|
|
2682
|
-
if (!options.all && errors.length) return errors;
|
|
2683
2883
|
}
|
|
2684
|
-
|
|
2884
|
+
attributeRules.set(key, {
|
|
2885
|
+
property,
|
|
2886
|
+
default: handler.default,
|
|
2887
|
+
parse: handler.parse,
|
|
2888
|
+
stringify: handler.stringify,
|
|
2889
|
+
required: handler.required,
|
|
2890
|
+
localPart,
|
|
2891
|
+
namespaceUri: (_c = handler.namespaceUri) != null ? _c : null
|
|
2892
|
+
});
|
|
2893
|
+
break;
|
|
2685
2894
|
}
|
|
2686
|
-
|
|
2687
|
-
},
|
|
2688
|
-
/**
|
|
2689
|
-
* Creates a validator that validates the input array has the given minimum length.
|
|
2690
|
-
* @param min The minimum number of elements (inclusive)
|
|
2691
|
-
*/
|
|
2692
|
-
minLength(min) {
|
|
2693
|
-
return createValidator(
|
|
2694
|
-
substitute(locale42.minLength, { value: min }),
|
|
2695
|
-
(input) => input.length >= min,
|
|
2696
|
-
(input) => substitute(locale42.actualLength, { value: input.length })
|
|
2697
|
-
);
|
|
2698
|
-
},
|
|
2699
|
-
/**
|
|
2700
|
-
*
|
|
2701
|
-
* Creates a validator that validates the input array has the given maximum length.
|
|
2702
|
-
* @param max The maximum number of elements (inclusive)
|
|
2703
|
-
*/
|
|
2704
|
-
maxLength(max) {
|
|
2705
|
-
return createValidator(
|
|
2706
|
-
substitute(locale42.maxLength, { value: max }),
|
|
2707
|
-
(input) => input.length <= max,
|
|
2708
|
-
(input) => substitute(locale42.actualLength, { value: input.length })
|
|
2709
|
-
);
|
|
2710
|
-
}
|
|
2711
|
-
};
|
|
2712
|
-
var _ArraySchema = class _ArraySchema2 extends ValueSchema {
|
|
2713
|
-
/**
|
|
2714
|
-
* The base ArraySchema instance validating that the input is an Array.
|
|
2715
|
-
*/
|
|
2716
|
-
static get base() {
|
|
2717
|
-
if (this._base == null)
|
|
2718
|
-
this._base = new _ArraySchema2(arrayValidators.isArray());
|
|
2719
|
-
return this._base;
|
|
2720
|
-
}
|
|
2721
|
-
/**
|
|
2722
|
-
* Creates a validator that asserts that every element passes the given validator.
|
|
2723
|
-
*
|
|
2724
|
-
* @param elementValidator
|
|
2725
|
-
*/
|
|
2726
|
-
withElements(elementValidator) {
|
|
2727
|
-
return this.chain(arrayValidators.withElements(elementValidator));
|
|
2895
|
+
}
|
|
2728
2896
|
}
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2897
|
+
return {
|
|
2898
|
+
__type: invariant(),
|
|
2899
|
+
attributes: attributeRules,
|
|
2900
|
+
elements: elementRules,
|
|
2901
|
+
characters: charactersRule
|
|
2902
|
+
};
|
|
2903
|
+
}
|
|
2904
|
+
function xmlRuleKey(localPart, namespaceUri = null) {
|
|
2905
|
+
return `${namespaceUri != null ? namespaceUri : ""}:${localPart}`;
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
// ../vinyl-xml/src/xml/ParseXmlHandlerImpl.ts
|
|
2909
|
+
function getRule(name, rules) {
|
|
2910
|
+
return rules.get(xmlRuleKey(name.localPart, name.namespaceUri));
|
|
2911
|
+
}
|
|
2912
|
+
var ParseXmlHandlerImpl = class {
|
|
2913
|
+
constructor(rules, options) {
|
|
2914
|
+
__publicField(this, "rules", rules);
|
|
2915
|
+
__publicField(this, "stack", []);
|
|
2916
|
+
__publicField(this, "options");
|
|
2917
|
+
__publicField(this, "busy", false);
|
|
2918
|
+
this.options = __spreadValues({ validateRules: true }, options);
|
|
2737
2919
|
}
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2920
|
+
startDocument() {
|
|
2921
|
+
if (this.busy)
|
|
2922
|
+
throw new IllegalStateError("XML content handler is busy");
|
|
2923
|
+
this.busy = true;
|
|
2924
|
+
const rules = this.rules;
|
|
2925
|
+
this.stack.push({
|
|
2926
|
+
element: new XmlElementImpl(),
|
|
2927
|
+
rules,
|
|
2928
|
+
characters: ""
|
|
2929
|
+
});
|
|
2744
2930
|
}
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2931
|
+
startElement(name, attributes) {
|
|
2932
|
+
var _a3;
|
|
2933
|
+
const parent = last(this.stack);
|
|
2934
|
+
let element2 = null;
|
|
2935
|
+
const elementRule = getRule(name, parent.rules.elements);
|
|
2936
|
+
const rules = (_a3 = elementRule == null ? void 0 : elementRule.rules()) != null ? _a3 : EmptyRules;
|
|
2937
|
+
if (elementRule) {
|
|
2938
|
+
const prop = elementRule.property;
|
|
2939
|
+
element2 = new XmlElementImpl(parent.element);
|
|
2940
|
+
if (elementRule.array) {
|
|
2941
|
+
const arr = parent.element[prop];
|
|
2942
|
+
if (Array.isArray(arr)) {
|
|
2943
|
+
arr.push(element2);
|
|
2944
|
+
} else {
|
|
2945
|
+
parent.element[prop] = [element2];
|
|
2946
|
+
}
|
|
2947
|
+
} else {
|
|
2948
|
+
if (parent.element[prop]) {
|
|
2949
|
+
throw new XmlSchemaError(
|
|
2950
|
+
`Expected single element with name ${name.qName}`
|
|
2951
|
+
);
|
|
2952
|
+
} else {
|
|
2953
|
+
parent.element[prop] = element2;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
const attributeRules = rules.attributes;
|
|
2957
|
+
for (const k in attributes) {
|
|
2958
|
+
const attribute = attributes[k];
|
|
2959
|
+
const name2 = attribute.name;
|
|
2960
|
+
const attributeRule = getRule(name2, attributeRules);
|
|
2961
|
+
if (attributeRule) {
|
|
2962
|
+
element2[attributeRule.property] = attributeRule.parse(
|
|
2963
|
+
attribute.value
|
|
2964
|
+
);
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
attributeRules.forEach((_value, key) => {
|
|
2968
|
+
const rule = attributeRules.get(key);
|
|
2969
|
+
if (!(rule.property in element2)) {
|
|
2970
|
+
if (rule.default != null) {
|
|
2971
|
+
element2[rule.property] = rule.default;
|
|
2972
|
+
} else if (this.options.validateRules && rule.required) {
|
|
2973
|
+
throw new XmlSchemaError(
|
|
2974
|
+
substitute(xmlSchemaErrorLocale.requiredAttribute, {
|
|
2975
|
+
property: rule.property
|
|
2976
|
+
})
|
|
2977
|
+
);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
});
|
|
2981
|
+
}
|
|
2982
|
+
this.stack.push({
|
|
2983
|
+
element: element2,
|
|
2984
|
+
rules,
|
|
2985
|
+
characters: ""
|
|
2986
|
+
});
|
|
2752
2987
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
readonly() {
|
|
2758
|
-
return this;
|
|
2988
|
+
textNode(str) {
|
|
2989
|
+
const current = last(this.stack);
|
|
2990
|
+
if (!current.rules.characters) return;
|
|
2991
|
+
current.characters += decodeEntities(str.trim());
|
|
2759
2992
|
}
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
return this;
|
|
2993
|
+
cDataNode(str) {
|
|
2994
|
+
const current = last(this.stack);
|
|
2995
|
+
if (!current.rules.characters) return;
|
|
2996
|
+
current.characters += str;
|
|
2765
2997
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
if (!(type in typeOfValidatorCache)) {
|
|
2782
|
-
typeOfValidatorCache[type] = typeOfValidator(type);
|
|
2998
|
+
endElement() {
|
|
2999
|
+
const lastEl = this.stack.pop();
|
|
3000
|
+
const charactersRule = lastEl.rules.characters;
|
|
3001
|
+
if (charactersRule)
|
|
3002
|
+
lastEl.element[charactersRule.property] = charactersRule.parse(
|
|
3003
|
+
lastEl.characters
|
|
3004
|
+
);
|
|
3005
|
+
lastEl.rules.elements.forEach((rule) => {
|
|
3006
|
+
if (rule.array && !(rule.property in lastEl.element)) {
|
|
3007
|
+
if (rule.useEmptyArrays) {
|
|
3008
|
+
lastEl.element[rule.property] = [];
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
this.validate(lastEl);
|
|
2783
3013
|
}
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
return
|
|
2789
|
-
},
|
|
2790
|
-
get func() {
|
|
2791
|
-
return cachedTypeOfValidator("function");
|
|
2792
|
-
},
|
|
2793
|
-
get number() {
|
|
2794
|
-
return cachedTypeOfValidator("number");
|
|
2795
|
-
},
|
|
2796
|
-
get object() {
|
|
2797
|
-
return cachedTypeOfValidator("object");
|
|
2798
|
-
},
|
|
2799
|
-
get string() {
|
|
2800
|
-
return cachedTypeOfValidator("string");
|
|
2801
|
-
},
|
|
2802
|
-
get symbol() {
|
|
2803
|
-
return cachedTypeOfValidator("symbol");
|
|
3014
|
+
endDocument() {
|
|
3015
|
+
this.busy = false;
|
|
3016
|
+
const last2 = this.stack.pop();
|
|
3017
|
+
this.validate(last2);
|
|
3018
|
+
return last2.element;
|
|
2804
3019
|
}
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
3020
|
+
validate(current) {
|
|
3021
|
+
if (!this.options.validateRules) return;
|
|
3022
|
+
current.rules.elements.forEach((rule) => {
|
|
3023
|
+
var _a3, _b;
|
|
3024
|
+
const length = rule.array ? (_b = (_a3 = current.element[rule.property]) == null ? void 0 : _a3.length) != null ? _b : 0 : current.element[rule.property] ? 1 : 0;
|
|
3025
|
+
if (length < rule.minOccurs) {
|
|
3026
|
+
throw new XmlSchemaError(
|
|
3027
|
+
substitute(xmlSchemaErrorLocale.atLeastElements, {
|
|
3028
|
+
property: rule.property,
|
|
3029
|
+
expected: rule.minOccurs,
|
|
3030
|
+
actual: length
|
|
3031
|
+
})
|
|
3032
|
+
);
|
|
3033
|
+
}
|
|
3034
|
+
if (rule.maxOccurs != null && length > rule.maxOccurs) {
|
|
3035
|
+
throw new XmlSchemaError(
|
|
3036
|
+
substitute(xmlSchemaErrorLocale.atMostElements, {
|
|
3037
|
+
property: rule.property,
|
|
3038
|
+
expected: rule.maxOccurs,
|
|
3039
|
+
actual: length
|
|
3040
|
+
})
|
|
3041
|
+
);
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
2817
3044
|
}
|
|
2818
3045
|
};
|
|
2819
|
-
var
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
return this._base;
|
|
3046
|
+
var parentSymbol = /* @__PURE__ */ Symbol("parent");
|
|
3047
|
+
var _a;
|
|
3048
|
+
_a = parentSymbol;
|
|
3049
|
+
var _XmlElementImpl = class _XmlElementImpl {
|
|
3050
|
+
constructor(parent = null) {
|
|
3051
|
+
__publicField(this, _a);
|
|
3052
|
+
this[parentSymbol] = parent;
|
|
2827
3053
|
}
|
|
2828
|
-
|
|
2829
|
-
return this
|
|
3054
|
+
get parent() {
|
|
3055
|
+
return this[parentSymbol];
|
|
2830
3056
|
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
* Function signatures, except for their required number of parameters, cannot be
|
|
2834
|
-
* meaningfully validated.
|
|
2835
|
-
*/
|
|
2836
|
-
cast() {
|
|
2837
|
-
return this;
|
|
3057
|
+
set parent(value) {
|
|
3058
|
+
this[parentSymbol] = value;
|
|
2838
3059
|
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
/**
|
|
2847
|
-
* Creates a validator that asserts that the input is a set.
|
|
2848
|
-
*/
|
|
2849
|
-
isSet() {
|
|
2850
|
-
return createValidator(
|
|
2851
|
-
locale7.set,
|
|
2852
|
-
(input) => input instanceof Set
|
|
2853
|
-
);
|
|
2854
|
-
},
|
|
2855
|
-
/**
|
|
2856
|
-
* Creates a validator that asserts that every element passes the given validator.
|
|
2857
|
-
*
|
|
2858
|
-
* @param elementValidator
|
|
2859
|
-
*/
|
|
2860
|
-
withElements(elementValidator) {
|
|
2861
|
-
return createDeepValidator(
|
|
2862
|
-
substitute(locale7.withElements, {
|
|
2863
|
-
value: elementValidator.description
|
|
2864
|
-
}),
|
|
2865
|
-
(input, options, path) => {
|
|
2866
|
-
const errors = [];
|
|
2867
|
-
let i = 0;
|
|
2868
|
-
for (const element2 of input) {
|
|
2869
|
-
errors.push(
|
|
2870
|
-
...elementValidator.validate(
|
|
2871
|
-
element2,
|
|
2872
|
-
options,
|
|
2873
|
-
path.concat(i.toString())
|
|
2874
|
-
)
|
|
2875
|
-
);
|
|
2876
|
-
if (!options.all && errors.length) return errors;
|
|
2877
|
-
i++;
|
|
3060
|
+
clone() {
|
|
3061
|
+
const out = new _XmlElementImpl(this.parent);
|
|
3062
|
+
for (const key in this) {
|
|
3063
|
+
const child = clone(this[key]);
|
|
3064
|
+
if (Array.isArray(child)) {
|
|
3065
|
+
for (const e of child) {
|
|
3066
|
+
if (typeof e === "object" && "parent" in e) e.parent = out;
|
|
2878
3067
|
}
|
|
2879
|
-
|
|
3068
|
+
} else if (typeof child === "object" && "parent" in child) {
|
|
3069
|
+
child.parent = out;
|
|
2880
3070
|
}
|
|
2881
|
-
|
|
3071
|
+
out[key] = child;
|
|
3072
|
+
}
|
|
3073
|
+
return out;
|
|
3074
|
+
}
|
|
3075
|
+
toJSON() {
|
|
3076
|
+
const out = {};
|
|
3077
|
+
for (const key in this) {
|
|
3078
|
+
out[key] = toJson(this[key]);
|
|
3079
|
+
}
|
|
3080
|
+
return out;
|
|
2882
3081
|
}
|
|
2883
3082
|
};
|
|
2884
|
-
var
|
|
3083
|
+
var XmlElementImpl = _XmlElementImpl;
|
|
3084
|
+
|
|
3085
|
+
// ../vinyl-validation/src/validation/Validator.ts
|
|
3086
|
+
var validatorLocale = {
|
|
2885
3087
|
/**
|
|
2886
|
-
* The
|
|
3088
|
+
* The expectation template string with the following replacement tokens:
|
|
3089
|
+
*
|
|
3090
|
+
* `{expected}` - The expected description.
|
|
3091
|
+
* `{actual}` - The actual value.
|
|
3092
|
+
* `{path}` - The path, dot separated.
|
|
2887
3093
|
*/
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
3094
|
+
template: "Expected: {expected}, but was: {actual}. At: {path}"
|
|
3095
|
+
};
|
|
3096
|
+
function createValidationExpectationMessage(expectationMessage, input, path, inputStringify = (input2) => stringifyForPrint(input2, 500)) {
|
|
3097
|
+
return substitute(validatorLocale.template, {
|
|
3098
|
+
expected: expectationMessage,
|
|
3099
|
+
actual: inputStringify(input),
|
|
3100
|
+
path: path.join(".")
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
function createValidator(expectationMessage, isValid, inputStringify = (input) => stringifyForPrint(input, 500)) {
|
|
3104
|
+
return {
|
|
3105
|
+
description: expectationMessage,
|
|
3106
|
+
isValid(input) {
|
|
3107
|
+
return isValid(input);
|
|
3108
|
+
},
|
|
3109
|
+
validate(input, _, path = []) {
|
|
3110
|
+
if (!isValid(input)) {
|
|
3111
|
+
return [
|
|
3112
|
+
{
|
|
3113
|
+
message: createValidationExpectationMessage(
|
|
3114
|
+
expectationMessage,
|
|
3115
|
+
input,
|
|
3116
|
+
path,
|
|
3117
|
+
inputStringify
|
|
3118
|
+
),
|
|
3119
|
+
path
|
|
3120
|
+
}
|
|
3121
|
+
];
|
|
3122
|
+
}
|
|
3123
|
+
return [];
|
|
3124
|
+
},
|
|
3125
|
+
assert: (input, origin, path = []) => {
|
|
3126
|
+
if (!isValid(input)) {
|
|
3127
|
+
throw new ValidationError(
|
|
3128
|
+
createValidationExpectationMessage(
|
|
3129
|
+
expectationMessage,
|
|
3130
|
+
input,
|
|
3131
|
+
path,
|
|
3132
|
+
inputStringify
|
|
3133
|
+
),
|
|
3134
|
+
origin,
|
|
3135
|
+
path
|
|
3136
|
+
);
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
};
|
|
3140
|
+
}
|
|
3141
|
+
function createDeepValidator(description, validate) {
|
|
3142
|
+
return {
|
|
3143
|
+
description,
|
|
3144
|
+
isValid(input) {
|
|
3145
|
+
return validate(input, { all: false }, []).length === 0;
|
|
3146
|
+
},
|
|
3147
|
+
validate(input, options, path = []) {
|
|
3148
|
+
return validate(input, options != null ? options : { all: false }, path);
|
|
3149
|
+
},
|
|
3150
|
+
assert: (input, origin, path = []) => {
|
|
3151
|
+
const errors = validate(input, { all: false }, path);
|
|
3152
|
+
if (errors.length) {
|
|
3153
|
+
const error = errors[0];
|
|
3154
|
+
throw new ValidationError(error.message, origin, error.path);
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
// ../vinyl-validation/src/validation/andValidators.ts
|
|
3161
|
+
var locale6 = {
|
|
2893
3162
|
/**
|
|
2894
|
-
*
|
|
3163
|
+
* {value} The child validators' descriptions, joined with `separator`.
|
|
2895
3164
|
*
|
|
2896
|
-
*
|
|
3165
|
+
* groupings of and validators is unimportant,
|
|
3166
|
+
* and(and(a, b), c) is the same as and(a, and(b, c)), so `a & b & c` is an accurate
|
|
3167
|
+
* representation for either.
|
|
2897
3168
|
*/
|
|
2898
|
-
|
|
2899
|
-
return this.chain(setValidators.withElements(elementValidator));
|
|
2900
|
-
}
|
|
3169
|
+
template: "{value}",
|
|
2901
3170
|
/**
|
|
2902
|
-
*
|
|
2903
|
-
* This is a shallow cast, elements of the array will not be changed.
|
|
3171
|
+
* The separator with which to join child validator descriptions.
|
|
2904
3172
|
*/
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
3173
|
+
separator: " & "
|
|
3174
|
+
};
|
|
3175
|
+
function andValidators(...validators) {
|
|
3176
|
+
return createDeepValidator(
|
|
3177
|
+
substitute(locale6.template, {
|
|
3178
|
+
value: validators.map((v) => v.description).join(locale6.separator)
|
|
3179
|
+
}),
|
|
3180
|
+
(input, options, path) => {
|
|
3181
|
+
for (const validator of validators) {
|
|
3182
|
+
const errors = validator.validate(input, options, path);
|
|
3183
|
+
if (errors.length) return errors;
|
|
3184
|
+
}
|
|
3185
|
+
return [];
|
|
3186
|
+
}
|
|
3187
|
+
);
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
// ../vinyl-validation/src/validation/orValidators.ts
|
|
3191
|
+
var locale7 = {
|
|
2908
3192
|
/**
|
|
2909
|
-
*
|
|
3193
|
+
* {value} - The child validators' descriptions, joined with `separator`.
|
|
2910
3194
|
*/
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
3195
|
+
template: "({value})",
|
|
3196
|
+
/**
|
|
3197
|
+
* The separator with which to join child validator descriptions.
|
|
3198
|
+
*/
|
|
3199
|
+
separator: " | "
|
|
2914
3200
|
};
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
3201
|
+
function orValidators(...validators) {
|
|
3202
|
+
const description = substitute(locale7.template, {
|
|
3203
|
+
value: validators.map((v) => v.description).join(locale7.separator)
|
|
3204
|
+
});
|
|
3205
|
+
return createDeepValidator(description, (input, options, path) => {
|
|
3206
|
+
let longestErrors = [];
|
|
3207
|
+
let longestPath = 0;
|
|
3208
|
+
for (const validator of validators) {
|
|
3209
|
+
const errors = validator.validate(input, options, path);
|
|
3210
|
+
if (!errors.length) return errors;
|
|
3211
|
+
const pathLength = errors.reduce(
|
|
3212
|
+
(max, m) => Math.max(m.path.length, max),
|
|
3213
|
+
0
|
|
3214
|
+
);
|
|
3215
|
+
if (pathLength >= longestPath) {
|
|
3216
|
+
longestErrors = errors;
|
|
3217
|
+
longestPath = pathLength;
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3220
|
+
return longestPath > path.length ? longestErrors : [
|
|
3221
|
+
{
|
|
3222
|
+
message: createValidationExpectationMessage(
|
|
3223
|
+
description,
|
|
3224
|
+
input,
|
|
3225
|
+
path
|
|
3226
|
+
),
|
|
3227
|
+
path
|
|
3228
|
+
}
|
|
3229
|
+
];
|
|
3230
|
+
});
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
// ../vinyl-validation/src/validation/SchemaBase.ts
|
|
3234
|
+
var requiredValidationOptions = {
|
|
3235
|
+
optional: false
|
|
2924
3236
|
};
|
|
2925
|
-
var
|
|
3237
|
+
var SchemaBase = class {
|
|
3238
|
+
constructor(currentValidator, previousSchema, operation) {
|
|
3239
|
+
__publicField(this, "currentValidator", currentValidator);
|
|
3240
|
+
__publicField(this, "previousSchema", previousSchema);
|
|
3241
|
+
__publicField(this, "operation", operation);
|
|
3242
|
+
__publicField(this, "__type", invariant());
|
|
3243
|
+
__publicField(this, "validator");
|
|
3244
|
+
__publicField(this, "_options", requiredValidationOptions);
|
|
3245
|
+
__publicField(this, "assert", (input, origin, path) => {
|
|
3246
|
+
this.validator.assert(input, origin, path);
|
|
3247
|
+
});
|
|
3248
|
+
__publicField(this, "isValid", (input) => this.validator.isValid(input));
|
|
3249
|
+
__publicField(this, "validate", (input, options, path) => this.validator.validate(input, options, path));
|
|
3250
|
+
this.validator = operation == null ? currentValidator : operation(previousSchema, currentValidator);
|
|
3251
|
+
}
|
|
3252
|
+
get options() {
|
|
3253
|
+
return this._options;
|
|
3254
|
+
}
|
|
3255
|
+
get description() {
|
|
3256
|
+
return this.validator.description;
|
|
3257
|
+
}
|
|
2926
3258
|
/**
|
|
2927
|
-
*
|
|
2928
|
-
* value.
|
|
3259
|
+
* Clones this schema, transforming all validators with the given mutator.
|
|
2929
3260
|
*
|
|
2930
|
-
* @param
|
|
3261
|
+
* @param transform A transformer which takes an existing validator in the chain and returns
|
|
3262
|
+
* a new one. Validators should be considered to be immutable; transform should not change the
|
|
3263
|
+
* input but instead return a new validator.
|
|
2931
3264
|
*/
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
(
|
|
2936
|
-
|
|
2937
|
-
|
|
3265
|
+
clone(transform = (v) => v) {
|
|
3266
|
+
const cloned = this.operation ? this.self(
|
|
3267
|
+
transform(this.currentValidator),
|
|
3268
|
+
this.previousSchema.clone(transform),
|
|
3269
|
+
this.operation
|
|
3270
|
+
) : this.self(transform(this.currentValidator));
|
|
3271
|
+
cloned._options = this._options;
|
|
3272
|
+
return cloned;
|
|
3273
|
+
}
|
|
3274
|
+
self(current, previous, operation) {
|
|
3275
|
+
if (this.constructor.length > 3) {
|
|
3276
|
+
throw new IllegalArgumentError(
|
|
3277
|
+
"constructor should have at most three required arguments"
|
|
3278
|
+
);
|
|
3279
|
+
}
|
|
3280
|
+
return new this.constructor(current, previous, operation);
|
|
3281
|
+
}
|
|
2938
3282
|
/**
|
|
2939
|
-
*
|
|
2940
|
-
*
|
|
3283
|
+
* Constructs a new schema with a validator chaining the current validator with the
|
|
3284
|
+
* provided next in an AND operation.
|
|
2941
3285
|
*
|
|
2942
|
-
* @param
|
|
3286
|
+
* @param nextValidator The validator to run after the current.
|
|
3287
|
+
* @return Returns a new Schema instance the same class with a new validator chaining the
|
|
3288
|
+
* current validator with the given next in an AND operation.
|
|
2943
3289
|
*/
|
|
2944
|
-
|
|
2945
|
-
return
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
);
|
|
3290
|
+
chain(nextValidator) {
|
|
3291
|
+
return this.self(nextValidator, this, andValidators);
|
|
3292
|
+
}
|
|
3293
|
+
optional() {
|
|
3294
|
+
const cloned = this.clone();
|
|
3295
|
+
cloned._options = __spreadProps(__spreadValues({}, cloned.options), {
|
|
3296
|
+
optional: true
|
|
3297
|
+
});
|
|
3298
|
+
return cloned;
|
|
3299
|
+
}
|
|
3300
|
+
required() {
|
|
3301
|
+
const cloned = this.clone();
|
|
3302
|
+
cloned._options = __spreadProps(__spreadValues({}, cloned.options), {
|
|
3303
|
+
optional: false
|
|
3304
|
+
});
|
|
3305
|
+
return cloned;
|
|
3306
|
+
}
|
|
3307
|
+
};
|
|
3308
|
+
|
|
3309
|
+
// ../vinyl-validation/src/validation/ValueSchema.ts
|
|
3310
|
+
var locale8 = {
|
|
3311
|
+
null: "null",
|
|
3312
|
+
nullish: "nullish",
|
|
3313
|
+
undefined: "undefined"
|
|
3314
|
+
};
|
|
3315
|
+
var valueValidators = {
|
|
3316
|
+
any() {
|
|
3317
|
+
return createValidator("", () => true);
|
|
2949
3318
|
},
|
|
2950
3319
|
/**
|
|
2951
|
-
* Creates a validator that asserts that the input
|
|
2952
|
-
* value.
|
|
2953
|
-
*
|
|
2954
|
-
* @param max The maximum (inclusive) the value may be.
|
|
3320
|
+
* Creates a validator that asserts that the input is nullish.
|
|
2955
3321
|
*/
|
|
2956
|
-
|
|
2957
|
-
return createValidator(
|
|
2958
|
-
substitute(locale8.lte, { value: max }),
|
|
2959
|
-
(input) => input <= max
|
|
2960
|
-
);
|
|
3322
|
+
nullish() {
|
|
3323
|
+
return createValidator(locale8.nullish, (input) => input == null);
|
|
2961
3324
|
},
|
|
2962
3325
|
/**
|
|
2963
|
-
* Creates a validator that asserts that the input
|
|
2964
|
-
* value.
|
|
2965
|
-
*
|
|
2966
|
-
* @param max The maximum (exclusive) the value may be.
|
|
3326
|
+
* Creates a validator that asserts that the input is strictly null.
|
|
2967
3327
|
*/
|
|
2968
|
-
|
|
2969
|
-
return createValidator(
|
|
2970
|
-
substitute(locale8.lt, { value: max }),
|
|
2971
|
-
(input) => input < max
|
|
2972
|
-
);
|
|
3328
|
+
null() {
|
|
3329
|
+
return createValidator(locale8.null, (input) => input === null);
|
|
2973
3330
|
},
|
|
2974
3331
|
/**
|
|
2975
|
-
* Creates a validator that asserts that the input
|
|
2976
|
-
* and at most the provided maximum values.
|
|
2977
|
-
*
|
|
2978
|
-
* @param min The minimum (inclusive) value the input may be.
|
|
2979
|
-
* @param max The maximum (inclusive) value the input may be.
|
|
3332
|
+
* Creates a validator that asserts that the input is strictly undefined.
|
|
2980
3333
|
*/
|
|
2981
|
-
|
|
2982
|
-
return createValidator(
|
|
2983
|
-
substitute(locale8.within, { min, max }),
|
|
2984
|
-
(input) => input >= min && input <= max
|
|
2985
|
-
);
|
|
2986
|
-
},
|
|
2987
|
-
/**
|
|
2988
|
-
* Creates a validator that asserts that the input number is finite.
|
|
2989
|
-
*/
|
|
2990
|
-
finite() {
|
|
2991
|
-
return createValidator(locale8.finite, (input) => Number.isFinite(input));
|
|
2992
|
-
},
|
|
2993
|
-
/**
|
|
2994
|
-
* Creates a validator that asserts that the input number is a safe integer.
|
|
2995
|
-
*/
|
|
2996
|
-
safeInteger() {
|
|
2997
|
-
return createValidator(
|
|
2998
|
-
locale8.safeInteger,
|
|
2999
|
-
(input) => Number.isSafeInteger(input)
|
|
3000
|
-
);
|
|
3334
|
+
undefined() {
|
|
3335
|
+
return createValidator(locale8.undefined, (input) => input === void 0);
|
|
3001
3336
|
}
|
|
3002
3337
|
};
|
|
3003
|
-
var
|
|
3338
|
+
var ValueSchema = class _ValueSchema extends SchemaBase {
|
|
3004
3339
|
/**
|
|
3005
|
-
*
|
|
3340
|
+
* Prepends this validator allowing for null or undefined.
|
|
3006
3341
|
*/
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
this._base = new _NumberSchema2(typeOfValidators.number);
|
|
3010
|
-
return this._base;
|
|
3342
|
+
maybe() {
|
|
3343
|
+
return this.or(valueValidators.nullish());
|
|
3011
3344
|
}
|
|
3012
3345
|
/**
|
|
3013
|
-
*
|
|
3014
|
-
* value.
|
|
3015
|
-
*
|
|
3016
|
-
* @param min The minimum (inclusive) the value may be.
|
|
3346
|
+
* Prepends this validator allowing for null.
|
|
3017
3347
|
*/
|
|
3018
|
-
|
|
3019
|
-
return this.
|
|
3348
|
+
orNull() {
|
|
3349
|
+
return this.or(valueValidators.null());
|
|
3020
3350
|
}
|
|
3021
3351
|
/**
|
|
3022
|
-
*
|
|
3023
|
-
* value.
|
|
3024
|
-
*
|
|
3025
|
-
* @param min The minimum (exclusive) the value may be.
|
|
3352
|
+
* Prepends this validator allowing for undefined.
|
|
3026
3353
|
*/
|
|
3027
|
-
|
|
3028
|
-
return this.
|
|
3354
|
+
orUndefined() {
|
|
3355
|
+
return this.or(valueValidators.undefined());
|
|
3029
3356
|
}
|
|
3030
3357
|
/**
|
|
3031
|
-
*
|
|
3032
|
-
* value.
|
|
3358
|
+
* Returns a validator that asserts if this validator and the next passes.
|
|
3033
3359
|
*
|
|
3034
|
-
* @
|
|
3035
|
-
*/
|
|
3036
|
-
lte(max) {
|
|
3037
|
-
return this.chain(numberValidators.lte(max));
|
|
3038
|
-
}
|
|
3039
|
-
/**
|
|
3040
|
-
* Creates a validator that asserts that the input number is less than the provided maximum
|
|
3041
|
-
* value.
|
|
3360
|
+
* @see andValidators
|
|
3042
3361
|
*
|
|
3043
|
-
* @param
|
|
3362
|
+
* @param nextValidator The validator to run after the current.
|
|
3363
|
+
* @return Returns a new ValueSchema intersecting this validator and the next.
|
|
3044
3364
|
*/
|
|
3045
|
-
|
|
3046
|
-
return this
|
|
3365
|
+
and(nextValidator) {
|
|
3366
|
+
return new _ValueSchema(nextValidator, this, andValidators);
|
|
3047
3367
|
}
|
|
3048
3368
|
/**
|
|
3049
|
-
*
|
|
3050
|
-
* and at most the provided maximum values.
|
|
3369
|
+
* Returns a validator that asserts if this validator or the next passes.
|
|
3051
3370
|
*
|
|
3052
|
-
*
|
|
3053
|
-
*
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
/**
|
|
3059
|
-
* Creates a validator that asserts that the input number is finite.
|
|
3060
|
-
*/
|
|
3061
|
-
finite() {
|
|
3062
|
-
return this.chain(numberValidators.finite());
|
|
3063
|
-
}
|
|
3064
|
-
/**
|
|
3065
|
-
* Creates a validator that asserts that the input number is a safe integer.
|
|
3371
|
+
* Implementation note:
|
|
3372
|
+
* subclasses should not change the schema instance returned unless all chainable validators
|
|
3373
|
+
* accept input type 'unknown'.
|
|
3374
|
+
*
|
|
3375
|
+
* @param nextValidator The validator to run after the current.
|
|
3376
|
+
* @return Returns a new ValueSchema providing the union of this validator and the next.
|
|
3066
3377
|
*/
|
|
3067
|
-
|
|
3068
|
-
return this
|
|
3378
|
+
or(nextValidator) {
|
|
3379
|
+
return new _ValueSchema(nextValidator, this, orValidators);
|
|
3069
3380
|
}
|
|
3070
3381
|
};
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
function isValidatorWithPartial(validator) {
|
|
3074
|
-
return "partial" in validator && "partialDeep" in validator;
|
|
3075
|
-
}
|
|
3076
|
-
function maybeToDeepPartial(validator) {
|
|
3077
|
-
return isValidatorWithPartial(validator) ? validator.partialDeep() : validator;
|
|
3078
|
-
}
|
|
3079
|
-
function maybeToPartial(validator) {
|
|
3080
|
-
return isValidatorWithPartial(validator) ? validator.partial() : validator;
|
|
3081
|
-
}
|
|
3382
|
+
|
|
3383
|
+
// ../vinyl-validation/src/validation/typeOfValidators.ts
|
|
3082
3384
|
var locale9 = {
|
|
3083
|
-
|
|
3084
|
-
prop: "{key}: {value}",
|
|
3085
|
-
propSeparator: ",\n",
|
|
3086
|
-
indent: " ",
|
|
3087
|
-
required: `property '{key}' is required`
|
|
3385
|
+
template: "type {value}"
|
|
3088
3386
|
};
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
* @param propertyValidators
|
|
3095
|
-
*/
|
|
3096
|
-
properties(propertyValidators) {
|
|
3097
|
-
const propertiesDescriptions = [];
|
|
3098
|
-
const keys = ownKeys(propertyValidators);
|
|
3099
|
-
for (const key of keys) {
|
|
3100
|
-
const validator2 = propertyValidators[key];
|
|
3101
|
-
propertiesDescriptions.push(
|
|
3102
|
-
substitute(locale9.prop, {
|
|
3103
|
-
key: String(key) + (validator2.options.optional ? "?" : ""),
|
|
3104
|
-
value: validator2.description
|
|
3105
|
-
})
|
|
3106
|
-
);
|
|
3387
|
+
function typeOfValidator(expected) {
|
|
3388
|
+
return createValidator(
|
|
3389
|
+
substitute(locale9.template, { value: expected }),
|
|
3390
|
+
(input) => {
|
|
3391
|
+
return input != null && typeof input === expected;
|
|
3107
3392
|
}
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
const errors = [];
|
|
3115
|
-
for (const key of keys) {
|
|
3116
|
-
const validator2 = propertyValidators[key];
|
|
3117
|
-
if (key in input) {
|
|
3118
|
-
const value = input[key];
|
|
3119
|
-
errors.push(
|
|
3120
|
-
...validator2.validate(
|
|
3121
|
-
value,
|
|
3122
|
-
options,
|
|
3123
|
-
path.concat(String(key))
|
|
3124
|
-
)
|
|
3125
|
-
);
|
|
3126
|
-
} else {
|
|
3127
|
-
if (!validator2.options.optional) {
|
|
3128
|
-
errors.push({
|
|
3129
|
-
message: substitute(locale9.required, { key }),
|
|
3130
|
-
path: path.concat(String(key))
|
|
3131
|
-
});
|
|
3132
|
-
}
|
|
3133
|
-
}
|
|
3134
|
-
if (!options.all && errors.length) return errors;
|
|
3135
|
-
}
|
|
3136
|
-
return errors;
|
|
3137
|
-
}
|
|
3138
|
-
);
|
|
3139
|
-
return merge(validator, {
|
|
3140
|
-
partial() {
|
|
3141
|
-
const optionalPropertyValidators = {};
|
|
3142
|
-
for (const key of keys) {
|
|
3143
|
-
optionalPropertyValidators[key] = propertyValidators[key].optional();
|
|
3144
|
-
}
|
|
3145
|
-
return objectValidators.properties(
|
|
3146
|
-
optionalPropertyValidators
|
|
3147
|
-
);
|
|
3148
|
-
},
|
|
3149
|
-
partialDeep() {
|
|
3150
|
-
const optionalPropertyValidators = {};
|
|
3151
|
-
for (const key of keys) {
|
|
3152
|
-
optionalPropertyValidators[key] = maybeToDeepPartial(
|
|
3153
|
-
propertyValidators[key].optional()
|
|
3154
|
-
);
|
|
3155
|
-
}
|
|
3156
|
-
return objectValidators.properties(
|
|
3157
|
-
optionalPropertyValidators
|
|
3158
|
-
);
|
|
3159
|
-
}
|
|
3160
|
-
});
|
|
3161
|
-
}
|
|
3162
|
-
};
|
|
3163
|
-
var _ObjectSchema = class _ObjectSchema2 extends ValueSchema {
|
|
3164
|
-
/**
|
|
3165
|
-
* The base Object validator validating that the input is an object.
|
|
3166
|
-
*/
|
|
3167
|
-
static get base() {
|
|
3168
|
-
if (this._base == null)
|
|
3169
|
-
this._base = new _ObjectSchema2(typeOfValidators.object);
|
|
3170
|
-
return this._base;
|
|
3171
|
-
}
|
|
3172
|
-
/**
|
|
3173
|
-
* Creates a validator that validates the input has properties that pass their respective
|
|
3174
|
-
* validators.
|
|
3175
|
-
*
|
|
3176
|
-
* @param propertyValidators
|
|
3177
|
-
*/
|
|
3178
|
-
extend(propertyValidators) {
|
|
3179
|
-
return this.chain(objectValidators.properties(propertyValidators));
|
|
3180
|
-
}
|
|
3181
|
-
/**
|
|
3182
|
-
* Allows all properties to be undefined.
|
|
3183
|
-
*/
|
|
3184
|
-
partial() {
|
|
3185
|
-
return this.clone(maybeToPartial);
|
|
3186
|
-
}
|
|
3187
|
-
/**
|
|
3188
|
-
* Allows all recursive properties to be undefined.
|
|
3189
|
-
*/
|
|
3190
|
-
partialDeep() {
|
|
3191
|
-
return this.clone(maybeToDeepPartial);
|
|
3393
|
+
);
|
|
3394
|
+
}
|
|
3395
|
+
var typeOfValidatorCache = {};
|
|
3396
|
+
function cachedTypeOfValidator(type) {
|
|
3397
|
+
if (!(type in typeOfValidatorCache)) {
|
|
3398
|
+
typeOfValidatorCache[type] = typeOfValidator(type);
|
|
3192
3399
|
}
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
return
|
|
3400
|
+
return typeOfValidatorCache[type];
|
|
3401
|
+
}
|
|
3402
|
+
var typeOfValidators = {
|
|
3403
|
+
get boolean() {
|
|
3404
|
+
return cachedTypeOfValidator("boolean");
|
|
3405
|
+
},
|
|
3406
|
+
get func() {
|
|
3407
|
+
return cachedTypeOfValidator("function");
|
|
3408
|
+
},
|
|
3409
|
+
get number() {
|
|
3410
|
+
return cachedTypeOfValidator("number");
|
|
3411
|
+
},
|
|
3412
|
+
get object() {
|
|
3413
|
+
return cachedTypeOfValidator("object");
|
|
3414
|
+
},
|
|
3415
|
+
get string() {
|
|
3416
|
+
return cachedTypeOfValidator("string");
|
|
3417
|
+
},
|
|
3418
|
+
get symbol() {
|
|
3419
|
+
return cachedTypeOfValidator("symbol");
|
|
3198
3420
|
}
|
|
3199
3421
|
};
|
|
3200
|
-
|
|
3422
|
+
|
|
3423
|
+
// ../vinyl-validation/src/validation/NumberSchema.ts
|
|
3201
3424
|
var locale10 = {
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3425
|
+
gte: "at least {value}",
|
|
3426
|
+
gt: "greater than {value}",
|
|
3427
|
+
lte: "at most {value}",
|
|
3428
|
+
lt: "less than {value}",
|
|
3429
|
+
within: "within {min} and {max}",
|
|
3430
|
+
safeInteger: "safe integer",
|
|
3431
|
+
finite: "finite"
|
|
3207
3432
|
};
|
|
3208
|
-
var
|
|
3209
|
-
/**
|
|
3210
|
-
* Creates a validator that asserts that the input is not empty.
|
|
3211
|
-
*/
|
|
3212
|
-
notEmpty() {
|
|
3213
|
-
return createValidator(locale10.notEmpty, (input) => input !== "");
|
|
3214
|
-
},
|
|
3433
|
+
var numberValidators = {
|
|
3215
3434
|
/**
|
|
3216
|
-
* Creates a validator that asserts that the input
|
|
3217
|
-
*
|
|
3435
|
+
* Creates a validator that asserts that the input number is at least the provided minimum
|
|
3436
|
+
* value.
|
|
3218
3437
|
*
|
|
3219
|
-
* @param min The
|
|
3438
|
+
* @param min The minimum (inclusive) the value may be.
|
|
3220
3439
|
*/
|
|
3221
|
-
|
|
3440
|
+
gte(min) {
|
|
3222
3441
|
return createValidator(
|
|
3223
|
-
substitute(locale10.
|
|
3224
|
-
(input) => input
|
|
3442
|
+
substitute(locale10.gte, { value: min }),
|
|
3443
|
+
(input) => input >= min
|
|
3225
3444
|
);
|
|
3226
3445
|
},
|
|
3227
3446
|
/**
|
|
3228
|
-
* Creates a validator that asserts that the input
|
|
3229
|
-
*
|
|
3447
|
+
* Creates a validator that asserts that the input number is greater than the provided minimum
|
|
3448
|
+
* value.
|
|
3230
3449
|
*
|
|
3231
|
-
* @param
|
|
3450
|
+
* @param min The minimum (exclusive) the value may be.
|
|
3232
3451
|
*/
|
|
3233
|
-
|
|
3452
|
+
gt(min) {
|
|
3234
3453
|
return createValidator(
|
|
3235
|
-
substitute(locale10.
|
|
3236
|
-
(input) => input
|
|
3454
|
+
substitute(locale10.gt, { value: min }),
|
|
3455
|
+
(input) => input > min
|
|
3237
3456
|
);
|
|
3238
3457
|
},
|
|
3239
3458
|
/**
|
|
3240
|
-
* Creates a validator that asserts that the input
|
|
3241
|
-
*
|
|
3459
|
+
* Creates a validator that asserts that the input number is at most the provided maximum
|
|
3460
|
+
* value.
|
|
3461
|
+
*
|
|
3462
|
+
* @param max The maximum (inclusive) the value may be.
|
|
3242
3463
|
*/
|
|
3243
|
-
|
|
3464
|
+
lte(max) {
|
|
3244
3465
|
return createValidator(
|
|
3245
|
-
locale10.
|
|
3246
|
-
(input) => input
|
|
3466
|
+
substitute(locale10.lte, { value: max }),
|
|
3467
|
+
(input) => input <= max
|
|
3247
3468
|
);
|
|
3248
3469
|
},
|
|
3249
3470
|
/**
|
|
3250
|
-
* Creates a validator that asserts that the input
|
|
3251
|
-
*
|
|
3471
|
+
* Creates a validator that asserts that the input number is less than the provided maximum
|
|
3472
|
+
* value.
|
|
3473
|
+
*
|
|
3474
|
+
* @param max The maximum (exclusive) the value may be.
|
|
3252
3475
|
*/
|
|
3253
|
-
|
|
3476
|
+
lt(max) {
|
|
3254
3477
|
return createValidator(
|
|
3255
|
-
substitute(locale10.
|
|
3256
|
-
(input) =>
|
|
3257
|
-
return regex.test(input);
|
|
3258
|
-
}
|
|
3478
|
+
substitute(locale10.lt, { value: max }),
|
|
3479
|
+
(input) => input < max
|
|
3259
3480
|
);
|
|
3260
|
-
}
|
|
3261
|
-
};
|
|
3262
|
-
var _StringSchema = class _StringSchema2 extends ValueSchema {
|
|
3263
|
-
/**
|
|
3264
|
-
* The base SetSchema instance validating that the input is a Set.
|
|
3265
|
-
*/
|
|
3266
|
-
static get base() {
|
|
3267
|
-
if (this._base == null)
|
|
3268
|
-
this._base = new _StringSchema2(typeOfValidators.string);
|
|
3269
|
-
return this._base;
|
|
3270
|
-
}
|
|
3271
|
-
/**
|
|
3272
|
-
* Creates a validator that asserts that the input is not empty.
|
|
3273
|
-
*/
|
|
3274
|
-
notEmpty() {
|
|
3275
|
-
return this.chain(stringValidators.notEmpty());
|
|
3276
|
-
}
|
|
3277
|
-
/**
|
|
3278
|
-
* Creates a validator that asserts that the input string has at least the given minimum
|
|
3279
|
-
* length.
|
|
3280
|
-
*
|
|
3281
|
-
* @param min The string must be at least this length.
|
|
3282
|
-
*/
|
|
3283
|
-
minLength(min) {
|
|
3284
|
-
return this.chain(stringValidators.minLength(min));
|
|
3285
|
-
}
|
|
3286
|
-
/**
|
|
3287
|
-
* Creates a validator that asserts that the input string has at most the given maximum
|
|
3288
|
-
* length.
|
|
3289
|
-
*
|
|
3290
|
-
* @param max The string must be at most this length.
|
|
3291
|
-
*/
|
|
3292
|
-
maxLength(max) {
|
|
3293
|
-
return this.chain(stringValidators.maxLength(max));
|
|
3294
|
-
}
|
|
3295
|
-
/**
|
|
3296
|
-
* Creates a validator that asserts that the input string has no whitespace characters.
|
|
3297
|
-
* Whitespace characters include space, new line, carriage return, and tab.
|
|
3298
|
-
*/
|
|
3299
|
-
noWhitespace() {
|
|
3300
|
-
return this.chain(stringValidators.noWhitespace());
|
|
3301
|
-
}
|
|
3302
|
-
/**
|
|
3303
|
-
* Creates a validator that asserts that the input string matches the given regex.
|
|
3304
|
-
* @param regex
|
|
3305
|
-
*/
|
|
3306
|
-
matches(regex) {
|
|
3307
|
-
return this.chain(stringValidators.matches(regex));
|
|
3308
|
-
}
|
|
3309
|
-
};
|
|
3310
|
-
__publicField4(_StringSchema, "_base", null);
|
|
3311
|
-
var StringSchema = _StringSchema;
|
|
3312
|
-
var locale11 = {
|
|
3313
|
-
record: "{ [key: {key}]: {value} }"
|
|
3314
|
-
};
|
|
3315
|
-
var recordValidators = {
|
|
3481
|
+
},
|
|
3316
3482
|
/**
|
|
3317
|
-
*
|
|
3318
|
-
*
|
|
3319
|
-
*
|
|
3320
|
-
* Prototype members are not included.
|
|
3321
|
-
* Numeric keys are validated as strings. For example the object `{ [0]: 1 }` will be passed
|
|
3322
|
-
* to the key validator as '0'.
|
|
3483
|
+
* Creates a validator that asserts that the input number is at least the provided minimum
|
|
3484
|
+
* and at most the provided maximum values.
|
|
3323
3485
|
*
|
|
3324
|
-
* @param
|
|
3325
|
-
* @param
|
|
3486
|
+
* @param min The minimum (inclusive) value the input may be.
|
|
3487
|
+
* @param max The maximum (inclusive) value the input may be.
|
|
3326
3488
|
*/
|
|
3327
|
-
|
|
3328
|
-
return
|
|
3329
|
-
substitute(
|
|
3330
|
-
|
|
3331
|
-
value: valueValidator.description
|
|
3332
|
-
}),
|
|
3333
|
-
(input, options, path) => {
|
|
3334
|
-
const errors = [];
|
|
3335
|
-
for (const key of ownKeys(input)) {
|
|
3336
|
-
const keyStr = String(key);
|
|
3337
|
-
errors.push(
|
|
3338
|
-
...keyValidator.validate(
|
|
3339
|
-
key,
|
|
3340
|
-
options,
|
|
3341
|
-
path.concat(`[${keyStr}]`)
|
|
3342
|
-
)
|
|
3343
|
-
);
|
|
3344
|
-
if (!options.all && errors.length) return errors;
|
|
3345
|
-
const value = input[key];
|
|
3346
|
-
errors.push(
|
|
3347
|
-
...valueValidator.validate(
|
|
3348
|
-
value,
|
|
3349
|
-
options,
|
|
3350
|
-
path.concat(keyStr)
|
|
3351
|
-
)
|
|
3352
|
-
);
|
|
3353
|
-
if (!options.all && errors.length) return errors;
|
|
3354
|
-
}
|
|
3355
|
-
return errors;
|
|
3356
|
-
}
|
|
3489
|
+
within(min, max) {
|
|
3490
|
+
return createValidator(
|
|
3491
|
+
substitute(locale10.within, { min, max }),
|
|
3492
|
+
(input) => input >= min && input <= max
|
|
3357
3493
|
);
|
|
3358
|
-
}
|
|
3359
|
-
};
|
|
3360
|
-
var _RecordSchema = class _RecordSchema2 extends ValueSchema {
|
|
3361
|
-
/**
|
|
3362
|
-
* The base Object validator validating that the input is an object.
|
|
3363
|
-
*/
|
|
3364
|
-
static get base() {
|
|
3365
|
-
if (this._base == null)
|
|
3366
|
-
this._base = new _RecordSchema2(typeOfValidators.object);
|
|
3367
|
-
return this._base;
|
|
3368
|
-
}
|
|
3369
|
-
static get defaultKeyValidator() {
|
|
3370
|
-
return StringSchema.base;
|
|
3371
|
-
}
|
|
3372
|
-
/**
|
|
3373
|
-
* Returns a validator that asserts that the object's own enumerable properties has keys and
|
|
3374
|
-
* values that match their respective validators.
|
|
3375
|
-
*
|
|
3376
|
-
* Prototype members are not included.
|
|
3377
|
-
* Numeric keys are validated as strings. For example the object `{ [0]: 1 }` will be passed
|
|
3378
|
-
* to the key validator as '0'.
|
|
3379
|
-
*
|
|
3380
|
-
* @param keyValidator Validates each key.
|
|
3381
|
-
* @param valueValidator Validates each value.
|
|
3382
|
-
*/
|
|
3383
|
-
record(keyValidator, valueValidator) {
|
|
3384
|
-
return this.chain(recordValidators.record(keyValidator, valueValidator));
|
|
3385
|
-
}
|
|
3494
|
+
},
|
|
3386
3495
|
/**
|
|
3387
|
-
*
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
readonly() {
|
|
3401
|
-
return this;
|
|
3402
|
-
}
|
|
3403
|
-
/**
|
|
3404
|
-
* Casts the type parameter.
|
|
3405
|
-
*/
|
|
3406
|
-
cast() {
|
|
3407
|
-
return this;
|
|
3408
|
-
}
|
|
3409
|
-
};
|
|
3410
|
-
__publicField4(_RecordSchema, "_base", null);
|
|
3411
|
-
var locale12 = {
|
|
3412
|
-
isOneOf: "one of: {value}",
|
|
3413
|
-
instanceOf: "instance of {value}",
|
|
3414
|
-
oneOfSeparator: " | "
|
|
3415
|
-
};
|
|
3416
|
-
function isOneOf(...possibleValues) {
|
|
3417
|
-
return new ValueSchema(
|
|
3418
|
-
createValidator(
|
|
3419
|
-
substitute(locale12.isOneOf, {
|
|
3420
|
-
value: possibleValues.join(locale12.oneOfSeparator)
|
|
3421
|
-
}),
|
|
3422
|
-
(input) => possibleValues.includes(input)
|
|
3423
|
-
)
|
|
3424
|
-
);
|
|
3425
|
-
}
|
|
3426
|
-
function number() {
|
|
3427
|
-
return NumberSchema.base;
|
|
3428
|
-
}
|
|
3429
|
-
|
|
3430
|
-
// ../vinyl-xml/dist/index.js
|
|
3431
|
-
var __defProp5 = Object.defineProperty;
|
|
3432
|
-
var __defProps3 = Object.defineProperties;
|
|
3433
|
-
var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
|
|
3434
|
-
var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
|
|
3435
|
-
var __hasOwnProp4 = Object.prototype.hasOwnProperty;
|
|
3436
|
-
var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
|
|
3437
|
-
var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3438
|
-
var __spreadValues4 = (a, b) => {
|
|
3439
|
-
for (var prop in b || (b = {}))
|
|
3440
|
-
if (__hasOwnProp4.call(b, prop))
|
|
3441
|
-
__defNormalProp5(a, prop, b[prop]);
|
|
3442
|
-
if (__getOwnPropSymbols4)
|
|
3443
|
-
for (var prop of __getOwnPropSymbols4(b)) {
|
|
3444
|
-
if (__propIsEnum4.call(b, prop))
|
|
3445
|
-
__defNormalProp5(a, prop, b[prop]);
|
|
3446
|
-
}
|
|
3447
|
-
return a;
|
|
3448
|
-
};
|
|
3449
|
-
var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
|
|
3450
|
-
var __publicField5 = (obj, key, value) => __defNormalProp5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3451
|
-
function element(rules, options) {
|
|
3452
|
-
return __spreadProps3(__spreadValues4({
|
|
3453
|
-
type: "element",
|
|
3454
|
-
localPart: void 0,
|
|
3455
|
-
namespaceUri: void 0,
|
|
3456
|
-
required: false
|
|
3457
|
-
}, options), {
|
|
3458
|
-
rules
|
|
3459
|
-
});
|
|
3460
|
-
}
|
|
3461
|
-
function elements(rules, options) {
|
|
3462
|
-
return __spreadProps3(__spreadValues4({
|
|
3463
|
-
type: "elements",
|
|
3464
|
-
localPart: void 0,
|
|
3465
|
-
namespaceUri: void 0,
|
|
3466
|
-
minOccurs: 0,
|
|
3467
|
-
maxOccurs: null,
|
|
3468
|
-
useEmptyArrays: false
|
|
3469
|
-
}, options), {
|
|
3470
|
-
rules
|
|
3471
|
-
});
|
|
3472
|
-
}
|
|
3473
|
-
function characters(parse, stringify2) {
|
|
3474
|
-
return { type: "characters", parse, stringify: stringify2 };
|
|
3475
|
-
}
|
|
3476
|
-
var charactersString = /* @__PURE__ */ characters((i) => i, stringify);
|
|
3477
|
-
function attr(parse, stringify2, options) {
|
|
3478
|
-
return __spreadProps3(__spreadValues4({
|
|
3479
|
-
type: "attribute",
|
|
3480
|
-
localPart: void 0,
|
|
3481
|
-
namespaceUri: null,
|
|
3482
|
-
required: false,
|
|
3483
|
-
default: void 0
|
|
3484
|
-
}, options), {
|
|
3485
|
-
parse,
|
|
3486
|
-
stringify: stringify2
|
|
3487
|
-
});
|
|
3488
|
-
}
|
|
3489
|
-
function attrString(options) {
|
|
3490
|
-
return attr((i) => i, stringify, options);
|
|
3491
|
-
}
|
|
3492
|
-
function attrInt(options) {
|
|
3493
|
-
return attr(parseInt, stringify, options);
|
|
3494
|
-
}
|
|
3495
|
-
function attrFloat(options) {
|
|
3496
|
-
return attr(parseFloat, stringify, options);
|
|
3497
|
-
}
|
|
3498
|
-
function attrBoolean(options) {
|
|
3499
|
-
return attr(parseBoolean, stringify, options);
|
|
3500
|
-
}
|
|
3501
|
-
function attrDateTime(options) {
|
|
3502
|
-
return attr(parseDate, stringifyDate, options);
|
|
3503
|
-
}
|
|
3504
|
-
var xmlSchemaErrorLocale = {
|
|
3505
|
-
atLeastElements: "Expected at least {expected} occurrences of {property} but was {actual}",
|
|
3506
|
-
atMostElements: "Expected at most {expected} occurrences of {property} but was {actual}",
|
|
3507
|
-
cyclicReferences: "Cyclic reference detected",
|
|
3508
|
-
requiredAttribute: `Attribute '{property}' is required`
|
|
3509
|
-
};
|
|
3510
|
-
var XmlSchemaError = class _XmlSchemaError extends ReportableError {
|
|
3511
|
-
get [Symbol.toStringTag]() {
|
|
3512
|
-
return "XmlSchemaError";
|
|
3513
|
-
}
|
|
3514
|
-
constructor(message) {
|
|
3515
|
-
super(message, ErrorOrigin.PARSING);
|
|
3516
|
-
Object.setPrototypeOf(this, _XmlSchemaError.prototype);
|
|
3517
|
-
}
|
|
3518
|
-
};
|
|
3519
|
-
var XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
3520
|
-
var LT = /* @__PURE__ */ char("<");
|
|
3521
|
-
var GT = /* @__PURE__ */ char(">");
|
|
3522
|
-
var EQ = /* @__PURE__ */ char("=");
|
|
3523
|
-
var SLASH = /* @__PURE__ */ char("/");
|
|
3524
|
-
var COLON = /* @__PURE__ */ char(":");
|
|
3525
|
-
var QMARK = /* @__PURE__ */ char("?");
|
|
3526
|
-
var EXCL = /* @__PURE__ */ char("!");
|
|
3527
|
-
var APOS = /* @__PURE__ */ char("'");
|
|
3528
|
-
var QUOT = /* @__PURE__ */ char('"');
|
|
3529
|
-
var QUOTES = /* @__PURE__ */ new Set([APOS, QUOT]);
|
|
3530
|
-
function parseXml(str, handler) {
|
|
3531
|
-
const c = new StringReader(str);
|
|
3532
|
-
let current = {
|
|
3533
|
-
qName: "#document",
|
|
3534
|
-
namespaceMap: /* @__PURE__ */ new Map(),
|
|
3535
|
-
defaultNamespaceUri: null
|
|
3536
|
-
};
|
|
3537
|
-
const stack = [current];
|
|
3538
|
-
const namespaceLookup = (prefix) => {
|
|
3539
|
-
if (!prefix) return current.defaultNamespaceUri;
|
|
3540
|
-
for (let i = stack.length - 1; i >= 0; i--) {
|
|
3541
|
-
const map = stack[i].namespaceMap;
|
|
3542
|
-
if (map.has(prefix)) return stack[i].namespaceMap.get(prefix);
|
|
3543
|
-
}
|
|
3544
|
-
return null;
|
|
3545
|
-
};
|
|
3546
|
-
try {
|
|
3547
|
-
handler.startDocument();
|
|
3548
|
-
} catch (e) {
|
|
3549
|
-
c.err(e.message);
|
|
3550
|
-
}
|
|
3551
|
-
while (c.hasNext()) {
|
|
3552
|
-
const charsStart = c.untilChar(LT);
|
|
3553
|
-
if (charsStart < c.position) {
|
|
3554
|
-
const chars = str.substring(charsStart, c.position);
|
|
3555
|
-
try {
|
|
3556
|
-
handler.textNode(chars);
|
|
3557
|
-
} catch (e) {
|
|
3558
|
-
c.err(e.message);
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3561
|
-
if (!c.hasNext()) break;
|
|
3562
|
-
c.next();
|
|
3563
|
-
if (c.charIf(SLASH)) {
|
|
3564
|
-
c.white();
|
|
3565
|
-
const name = readQName(c);
|
|
3566
|
-
if (name.qName !== current.qName)
|
|
3567
|
-
c.err(`Expected </${current.qName}> but was </${name.qName}>`);
|
|
3568
|
-
stack.pop();
|
|
3569
|
-
current = last(stack);
|
|
3570
|
-
c.white();
|
|
3571
|
-
c.readChar(GT);
|
|
3572
|
-
try {
|
|
3573
|
-
handler.endElement();
|
|
3574
|
-
} catch (e) {
|
|
3575
|
-
c.err(e.message);
|
|
3576
|
-
}
|
|
3577
|
-
} else if (c.charIf(QMARK)) {
|
|
3578
|
-
untilTagClose(c);
|
|
3579
|
-
} else if (c.charIf(EXCL)) {
|
|
3580
|
-
if (c.charIf(
|
|
3581
|
-
45
|
|
3582
|
-
/* - */
|
|
3583
|
-
)) {
|
|
3584
|
-
c.readChar(45);
|
|
3585
|
-
c.untilString("-->");
|
|
3586
|
-
c.read("-->");
|
|
3587
|
-
} else if (c.stringIf("[CDATA[")) {
|
|
3588
|
-
const charsStart2 = c.untilString("]]>");
|
|
3589
|
-
try {
|
|
3590
|
-
handler.cDataNode(str.substring(charsStart2, c.position));
|
|
3591
|
-
} catch (e) {
|
|
3592
|
-
c.err(e.message);
|
|
3593
|
-
}
|
|
3594
|
-
c.read("]]>");
|
|
3595
|
-
} else {
|
|
3596
|
-
untilTagClose(c);
|
|
3597
|
-
}
|
|
3598
|
-
} else {
|
|
3599
|
-
const name = readQName(c);
|
|
3600
|
-
current = {
|
|
3601
|
-
qName: name.qName,
|
|
3602
|
-
namespaceMap: /* @__PURE__ */ new Map(),
|
|
3603
|
-
defaultNamespaceUri: current.defaultNamespaceUri
|
|
3604
|
-
};
|
|
3605
|
-
stack.push(current);
|
|
3606
|
-
const attributes = xmlAttributes(c, current);
|
|
3607
|
-
name.namespaceUri = namespaceLookup(name.prefix);
|
|
3608
|
-
for (const attributesKey in attributes) {
|
|
3609
|
-
const value = attributes[attributesKey];
|
|
3610
|
-
const name2 = value.name;
|
|
3611
|
-
if (name2.prefix && !name2.namespaceUri) {
|
|
3612
|
-
name2.namespaceUri = namespaceLookup(name2.prefix);
|
|
3613
|
-
}
|
|
3614
|
-
}
|
|
3615
|
-
try {
|
|
3616
|
-
handler.startElement(name, attributes);
|
|
3617
|
-
} catch (e) {
|
|
3618
|
-
c.err(e.message);
|
|
3619
|
-
}
|
|
3620
|
-
if (c.charIf(SLASH)) {
|
|
3621
|
-
c.readChar(GT);
|
|
3622
|
-
stack.pop();
|
|
3623
|
-
current = last(stack);
|
|
3624
|
-
try {
|
|
3625
|
-
handler.endElement();
|
|
3626
|
-
} catch (e) {
|
|
3627
|
-
c.err(e.message);
|
|
3628
|
-
}
|
|
3629
|
-
} else {
|
|
3630
|
-
c.readChar(GT);
|
|
3631
|
-
}
|
|
3632
|
-
}
|
|
3633
|
-
}
|
|
3634
|
-
try {
|
|
3635
|
-
return handler.endDocument();
|
|
3636
|
-
} catch (e) {
|
|
3637
|
-
return c.err(e.message);
|
|
3638
|
-
}
|
|
3639
|
-
}
|
|
3640
|
-
function readAttributeValue(c) {
|
|
3641
|
-
const quote = c.next();
|
|
3642
|
-
if (!QUOTES.has(quote)) c.err(`Expected ' or "`);
|
|
3643
|
-
const value = c.substringUntil((charCode) => charCode === quote);
|
|
3644
|
-
c.readChar(quote);
|
|
3645
|
-
return decodeEntities(value);
|
|
3646
|
-
}
|
|
3647
|
-
function untilTagClose(c) {
|
|
3648
|
-
while (true) {
|
|
3649
|
-
c.until((c2) => c2 === APOS || c2 === QUOT || c2 === GT);
|
|
3650
|
-
const char2 = c.next();
|
|
3651
|
-
if (QUOTES.has(char2)) {
|
|
3652
|
-
c.untilChar(char2);
|
|
3653
|
-
c.next();
|
|
3654
|
-
} else {
|
|
3655
|
-
break;
|
|
3656
|
-
}
|
|
3657
|
-
}
|
|
3658
|
-
}
|
|
3659
|
-
function isNameChar(charCode) {
|
|
3660
|
-
if (charCode >= 97) {
|
|
3661
|
-
if (charCode >= 183) {
|
|
3662
|
-
if (charCode >= 768) {
|
|
3663
|
-
if (charCode >= 8255) {
|
|
3664
|
-
return charCode <= 8256;
|
|
3665
|
-
} else {
|
|
3666
|
-
return charCode <= 879;
|
|
3667
|
-
}
|
|
3668
|
-
} else {
|
|
3669
|
-
return charCode === 183;
|
|
3670
|
-
}
|
|
3671
|
-
} else {
|
|
3672
|
-
return charCode <= 122;
|
|
3673
|
-
}
|
|
3674
|
-
} else {
|
|
3675
|
-
if (charCode >= 95) {
|
|
3676
|
-
return charCode === 95;
|
|
3677
|
-
} else {
|
|
3678
|
-
if (charCode >= 65) {
|
|
3679
|
-
return charCode <= 90;
|
|
3680
|
-
} else {
|
|
3681
|
-
if (charCode >= 45) {
|
|
3682
|
-
if (charCode >= 48) {
|
|
3683
|
-
return charCode <= 57;
|
|
3684
|
-
} else {
|
|
3685
|
-
return charCode <= 46;
|
|
3686
|
-
}
|
|
3687
|
-
} else {
|
|
3688
|
-
return false;
|
|
3689
|
-
}
|
|
3690
|
-
}
|
|
3691
|
-
}
|
|
3692
|
-
}
|
|
3693
|
-
}
|
|
3694
|
-
function readQName(reader) {
|
|
3695
|
-
const prefixOrLocalName = reader.substringWhile(isNameChar);
|
|
3696
|
-
let prefix, localPart, name;
|
|
3697
|
-
if (reader.charIf(COLON)) {
|
|
3698
|
-
prefix = prefixOrLocalName;
|
|
3699
|
-
localPart = reader.substringWhile(isNameChar);
|
|
3700
|
-
name = `${prefix}:${localPart}`;
|
|
3701
|
-
} else {
|
|
3702
|
-
prefix = null;
|
|
3703
|
-
localPart = prefixOrLocalName;
|
|
3704
|
-
name = localPart;
|
|
3705
|
-
}
|
|
3706
|
-
return { prefix, localPart, qName: name, namespaceUri: null };
|
|
3707
|
-
}
|
|
3708
|
-
function xmlAttributes(reader, stackElement) {
|
|
3709
|
-
const attributes = {};
|
|
3710
|
-
while (true) {
|
|
3711
|
-
reader.white();
|
|
3712
|
-
if (!isNameChar(reader.peek)) break;
|
|
3713
|
-
const name = readQName(reader);
|
|
3714
|
-
reader.white();
|
|
3715
|
-
let value = "";
|
|
3716
|
-
if (reader.charIf(EQ)) {
|
|
3717
|
-
reader.white();
|
|
3718
|
-
value = readAttributeValue(reader);
|
|
3719
|
-
} else {
|
|
3720
|
-
}
|
|
3721
|
-
if (name.prefix === "xmlns") {
|
|
3722
|
-
name.namespaceUri = XMLNS;
|
|
3723
|
-
stackElement.namespaceMap.set(
|
|
3724
|
-
name.localPart,
|
|
3725
|
-
value === "" ? null : value
|
|
3726
|
-
);
|
|
3727
|
-
} else if (!name.prefix && name.localPart === "xmlns") {
|
|
3728
|
-
name.namespaceUri = XMLNS;
|
|
3729
|
-
stackElement.defaultNamespaceUri = !value ? null : value;
|
|
3730
|
-
}
|
|
3731
|
-
if (attributes[name.qName] != null)
|
|
3732
|
-
reader.err(`Attribute '${name.qName}' is already specified.`);
|
|
3733
|
-
attributes[name.qName] = { name, value };
|
|
3734
|
-
}
|
|
3735
|
-
return attributes;
|
|
3736
|
-
}
|
|
3737
|
-
var locale23 = {
|
|
3738
|
-
illegalRuleOverrideTypeError: "Cannot override the rule {property} of type {sourceType} with a rule of type {overrideType}",
|
|
3739
|
-
illegalQNameOverrideError: "Cannot override the rule {property} with a different localPart or namespace"
|
|
3740
|
-
};
|
|
3741
|
-
function mergeXmlRules(...rules) {
|
|
3742
|
-
let finalRule = rules[0];
|
|
3743
|
-
for (let i = 1; i < rules.length; i++) {
|
|
3744
|
-
finalRule = plainObjectMergeRule.merge(
|
|
3745
|
-
finalRule,
|
|
3746
|
-
rules[i],
|
|
3747
|
-
mergeXmlRule
|
|
3748
|
-
);
|
|
3749
|
-
}
|
|
3750
|
-
return finalRule;
|
|
3751
|
-
}
|
|
3752
|
-
function mergeXmlRule(sourceA, sourceB, prop) {
|
|
3753
|
-
var _a22, _b, _c, _d;
|
|
3754
|
-
if (sourceA == null) return sourceB;
|
|
3755
|
-
const sourceAIsLazy = typeof sourceA === "function";
|
|
3756
|
-
const sourceBIsLazy = typeof sourceB === "function";
|
|
3757
|
-
if (sourceAIsLazy || sourceBIsLazy) {
|
|
3758
|
-
return () => {
|
|
3759
|
-
const a = sourceAIsLazy ? sourceA() : sourceA;
|
|
3760
|
-
const b = sourceBIsLazy ? sourceB() : sourceB;
|
|
3761
|
-
return mergeXmlRule(a, b, prop);
|
|
3762
|
-
};
|
|
3763
|
-
}
|
|
3764
|
-
if (sourceA.type !== sourceB.type) {
|
|
3765
|
-
throw new ValidationError(
|
|
3766
|
-
substitute(locale23.illegalRuleOverrideTypeError, {
|
|
3767
|
-
property: prop,
|
|
3768
|
-
sourceType: sourceA.type,
|
|
3769
|
-
overrideType: sourceB.type
|
|
3770
|
-
})
|
|
3771
|
-
);
|
|
3772
|
-
}
|
|
3773
|
-
switch (sourceA.type) {
|
|
3774
|
-
case "attribute":
|
|
3775
|
-
case "element":
|
|
3776
|
-
case "elements": {
|
|
3777
|
-
const b = sourceB;
|
|
3778
|
-
if (sourceA.namespaceUri !== b.namespaceUri || ((_a22 = sourceA.localPart) != null ? _a22 : prop) !== ((_b = b.localPart) != null ? _b : prop)) {
|
|
3779
|
-
throw new ValidationError(
|
|
3780
|
-
substitute(locale23.illegalQNameOverrideError, {
|
|
3781
|
-
property: prop
|
|
3782
|
-
})
|
|
3783
|
-
);
|
|
3784
|
-
}
|
|
3785
|
-
break;
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
switch (sourceA.type) {
|
|
3789
|
-
case "attribute": {
|
|
3790
|
-
const b = sourceB;
|
|
3791
|
-
return __spreadProps3(__spreadValues4({}, b), {
|
|
3792
|
-
default: (_c = b.default) != null ? _c : sourceA.default
|
|
3793
|
-
});
|
|
3794
|
-
}
|
|
3795
|
-
case "characters":
|
|
3796
|
-
return sourceB;
|
|
3797
|
-
case "element": {
|
|
3798
|
-
const b = sourceB;
|
|
3799
|
-
return __spreadProps3(__spreadValues4({}, b), {
|
|
3800
|
-
required: sourceA.required || b.required,
|
|
3801
|
-
rules: mergeXmlRules(sourceA.rules, b.rules)
|
|
3802
|
-
});
|
|
3803
|
-
}
|
|
3804
|
-
case "elements": {
|
|
3805
|
-
const b = sourceB;
|
|
3806
|
-
const maxOccurs = sourceA.maxOccurs != null && b.maxOccurs != null ? Math.min(sourceA.maxOccurs, b.maxOccurs) : (_d = sourceA.maxOccurs) != null ? _d : b.maxOccurs;
|
|
3807
|
-
return __spreadProps3(__spreadValues4({}, b), {
|
|
3808
|
-
minOccurs: Math.max(sourceA.minOccurs, b.minOccurs),
|
|
3809
|
-
maxOccurs,
|
|
3810
|
-
useEmptyArrays: sourceA.useEmptyArrays || b.useEmptyArrays,
|
|
3811
|
-
rules: mergeXmlRules(sourceA.rules, b.rules)
|
|
3812
|
-
});
|
|
3813
|
-
}
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
var EmptyRules = {
|
|
3817
|
-
__type: /* @__PURE__ */ invariant(),
|
|
3818
|
-
attributes: /* @__PURE__ */ new Map(),
|
|
3819
|
-
elements: /* @__PURE__ */ new Map(),
|
|
3820
|
-
characters: void 0
|
|
3821
|
-
};
|
|
3822
|
-
function mapXmlRules(rules, parentNamespaceUri = null) {
|
|
3823
|
-
var _a22, _b, _c;
|
|
3824
|
-
const attributeRules = /* @__PURE__ */ new Map();
|
|
3825
|
-
const elementRules = /* @__PURE__ */ new Map();
|
|
3826
|
-
let charactersRule = void 0;
|
|
3827
|
-
for (const property in rules) {
|
|
3828
|
-
const handlerOrFunction = rules[property];
|
|
3829
|
-
let handler;
|
|
3830
|
-
if (typeof handlerOrFunction === "function") {
|
|
3831
|
-
handler = handlerOrFunction();
|
|
3832
|
-
} else {
|
|
3833
|
-
handler = handlerOrFunction;
|
|
3834
|
-
}
|
|
3835
|
-
let key;
|
|
3836
|
-
switch (handler.type) {
|
|
3837
|
-
case "characters":
|
|
3838
|
-
if (charactersRule !== void 0)
|
|
3839
|
-
throw new IllegalArgumentError(
|
|
3840
|
-
"characters handler already defined"
|
|
3841
|
-
);
|
|
3842
|
-
charactersRule = {
|
|
3843
|
-
property,
|
|
3844
|
-
parse: handler.parse,
|
|
3845
|
-
stringify: handler.stringify
|
|
3846
|
-
};
|
|
3847
|
-
break;
|
|
3848
|
-
case "element":
|
|
3849
|
-
case "elements": {
|
|
3850
|
-
const localPart = (_a22 = handler.localPart) != null ? _a22 : property;
|
|
3851
|
-
const namespaceUri = handler.namespaceUri === void 0 ? parentNamespaceUri : handler.namespaceUri;
|
|
3852
|
-
key = xmlRuleKey(localPart, namespaceUri);
|
|
3853
|
-
if (elementRules.has(key)) {
|
|
3854
|
-
throw new IllegalArgumentError(
|
|
3855
|
-
`Multiple element rules for ${key}`
|
|
3856
|
-
);
|
|
3857
|
-
}
|
|
3858
|
-
if (handler.type === "element") {
|
|
3859
|
-
const rules2 = handler.rules;
|
|
3860
|
-
elementRules.set(key, {
|
|
3861
|
-
array: false,
|
|
3862
|
-
property,
|
|
3863
|
-
minOccurs: handler.required ? 1 : 0,
|
|
3864
|
-
maxOccurs: 1,
|
|
3865
|
-
rules: memoize(() => mapXmlRules(rules2, namespaceUri)),
|
|
3866
|
-
useEmptyArrays: false,
|
|
3867
|
-
localPart,
|
|
3868
|
-
namespaceUri
|
|
3869
|
-
});
|
|
3870
|
-
} else {
|
|
3871
|
-
const rules2 = handler.rules;
|
|
3872
|
-
elementRules.set(key, {
|
|
3873
|
-
array: true,
|
|
3874
|
-
property,
|
|
3875
|
-
maxOccurs: handler.maxOccurs,
|
|
3876
|
-
minOccurs: handler.minOccurs,
|
|
3877
|
-
rules: memoize(() => mapXmlRules(rules2, namespaceUri)),
|
|
3878
|
-
useEmptyArrays: handler.useEmptyArrays,
|
|
3879
|
-
localPart,
|
|
3880
|
-
namespaceUri
|
|
3881
|
-
});
|
|
3882
|
-
}
|
|
3883
|
-
break;
|
|
3884
|
-
}
|
|
3885
|
-
case "attribute": {
|
|
3886
|
-
const namespaceUri = handler.namespaceUri;
|
|
3887
|
-
const localPart = (_b = handler.localPart) != null ? _b : property;
|
|
3888
|
-
key = xmlRuleKey(localPart, namespaceUri);
|
|
3889
|
-
if (attributeRules.has(key)) {
|
|
3890
|
-
throw new IllegalArgumentError(
|
|
3891
|
-
`Multiple attribute rules for ${key}`
|
|
3892
|
-
);
|
|
3893
|
-
}
|
|
3894
|
-
attributeRules.set(key, {
|
|
3895
|
-
property,
|
|
3896
|
-
default: handler.default,
|
|
3897
|
-
parse: handler.parse,
|
|
3898
|
-
stringify: handler.stringify,
|
|
3899
|
-
required: handler.required,
|
|
3900
|
-
localPart,
|
|
3901
|
-
namespaceUri: (_c = handler.namespaceUri) != null ? _c : null
|
|
3902
|
-
});
|
|
3903
|
-
break;
|
|
3904
|
-
}
|
|
3905
|
-
}
|
|
3906
|
-
}
|
|
3907
|
-
return {
|
|
3908
|
-
__type: invariant(),
|
|
3909
|
-
attributes: attributeRules,
|
|
3910
|
-
elements: elementRules,
|
|
3911
|
-
characters: charactersRule
|
|
3912
|
-
};
|
|
3913
|
-
}
|
|
3914
|
-
function xmlRuleKey(localPart, namespaceUri = null) {
|
|
3915
|
-
return `${namespaceUri != null ? namespaceUri : ""}:${localPart}`;
|
|
3916
|
-
}
|
|
3917
|
-
function getRule(name, rules) {
|
|
3918
|
-
return rules.get(xmlRuleKey(name.localPart, name.namespaceUri));
|
|
3919
|
-
}
|
|
3920
|
-
var ParseXmlHandlerImpl = class {
|
|
3921
|
-
constructor(rules, options) {
|
|
3922
|
-
this.rules = rules;
|
|
3923
|
-
__publicField5(this, "stack", []);
|
|
3924
|
-
__publicField5(this, "options");
|
|
3925
|
-
__publicField5(this, "busy", false);
|
|
3926
|
-
this.options = __spreadValues4({ validateRules: true }, options);
|
|
3927
|
-
}
|
|
3928
|
-
startDocument() {
|
|
3929
|
-
if (this.busy)
|
|
3930
|
-
throw new IllegalStateError("XML content handler is busy");
|
|
3931
|
-
this.busy = true;
|
|
3932
|
-
const rules = this.rules;
|
|
3933
|
-
this.stack.push({
|
|
3934
|
-
element: new XmlElementImpl(),
|
|
3935
|
-
rules,
|
|
3936
|
-
characters: ""
|
|
3937
|
-
});
|
|
3938
|
-
}
|
|
3939
|
-
startElement(name, attributes) {
|
|
3940
|
-
var _a22;
|
|
3941
|
-
const parent = last(this.stack);
|
|
3942
|
-
let element2 = null;
|
|
3943
|
-
const elementRule = getRule(name, parent.rules.elements);
|
|
3944
|
-
const rules = (_a22 = elementRule == null ? void 0 : elementRule.rules()) != null ? _a22 : EmptyRules;
|
|
3945
|
-
if (elementRule) {
|
|
3946
|
-
const prop = elementRule.property;
|
|
3947
|
-
element2 = new XmlElementImpl(parent.element);
|
|
3948
|
-
if (elementRule.array) {
|
|
3949
|
-
const arr = parent.element[prop];
|
|
3950
|
-
if (Array.isArray(arr)) {
|
|
3951
|
-
arr.push(element2);
|
|
3952
|
-
} else {
|
|
3953
|
-
parent.element[prop] = [element2];
|
|
3954
|
-
}
|
|
3955
|
-
} else {
|
|
3956
|
-
if (parent.element[prop]) {
|
|
3957
|
-
throw new XmlSchemaError(
|
|
3958
|
-
`Expected single element with name ${name.qName}`
|
|
3959
|
-
);
|
|
3960
|
-
} else {
|
|
3961
|
-
parent.element[prop] = element2;
|
|
3962
|
-
}
|
|
3963
|
-
}
|
|
3964
|
-
const attributeRules = rules.attributes;
|
|
3965
|
-
for (const k in attributes) {
|
|
3966
|
-
const attribute = attributes[k];
|
|
3967
|
-
const name2 = attribute.name;
|
|
3968
|
-
const attributeRule = getRule(name2, attributeRules);
|
|
3969
|
-
if (attributeRule) {
|
|
3970
|
-
element2[attributeRule.property] = attributeRule.parse(
|
|
3971
|
-
attribute.value
|
|
3972
|
-
);
|
|
3973
|
-
}
|
|
3974
|
-
}
|
|
3975
|
-
attributeRules.forEach((_value, key) => {
|
|
3976
|
-
const rule = attributeRules.get(key);
|
|
3977
|
-
if (!(rule.property in element2)) {
|
|
3978
|
-
if (rule.default != null) {
|
|
3979
|
-
element2[rule.property] = rule.default;
|
|
3980
|
-
} else if (this.options.validateRules && rule.required) {
|
|
3981
|
-
throw new XmlSchemaError(
|
|
3982
|
-
substitute(xmlSchemaErrorLocale.requiredAttribute, {
|
|
3983
|
-
property: rule.property
|
|
3984
|
-
})
|
|
3985
|
-
);
|
|
3986
|
-
}
|
|
3987
|
-
}
|
|
3988
|
-
});
|
|
3989
|
-
}
|
|
3990
|
-
this.stack.push({
|
|
3991
|
-
element: element2,
|
|
3992
|
-
rules,
|
|
3993
|
-
characters: ""
|
|
3994
|
-
});
|
|
3995
|
-
}
|
|
3996
|
-
textNode(str) {
|
|
3997
|
-
const current = last(this.stack);
|
|
3998
|
-
if (!current.rules.characters) return;
|
|
3999
|
-
current.characters += decodeEntities(str.trim());
|
|
4000
|
-
}
|
|
4001
|
-
cDataNode(str) {
|
|
4002
|
-
const current = last(this.stack);
|
|
4003
|
-
if (!current.rules.characters) return;
|
|
4004
|
-
current.characters += str;
|
|
4005
|
-
}
|
|
4006
|
-
endElement() {
|
|
4007
|
-
const lastEl = this.stack.pop();
|
|
4008
|
-
const charactersRule = lastEl.rules.characters;
|
|
4009
|
-
if (charactersRule)
|
|
4010
|
-
lastEl.element[charactersRule.property] = charactersRule.parse(
|
|
4011
|
-
lastEl.characters
|
|
4012
|
-
);
|
|
4013
|
-
lastEl.rules.elements.forEach((rule) => {
|
|
4014
|
-
if (rule.array && !(rule.property in lastEl.element)) {
|
|
4015
|
-
if (rule.useEmptyArrays) {
|
|
4016
|
-
lastEl.element[rule.property] = [];
|
|
4017
|
-
}
|
|
4018
|
-
}
|
|
4019
|
-
});
|
|
4020
|
-
this.validate(lastEl);
|
|
3496
|
+
* Creates a validator that asserts that the input number is finite.
|
|
3497
|
+
*/
|
|
3498
|
+
finite() {
|
|
3499
|
+
return createValidator(locale10.finite, (input) => Number.isFinite(input));
|
|
3500
|
+
},
|
|
3501
|
+
/**
|
|
3502
|
+
* Creates a validator that asserts that the input number is a safe integer.
|
|
3503
|
+
*/
|
|
3504
|
+
safeInteger() {
|
|
3505
|
+
return createValidator(
|
|
3506
|
+
locale10.safeInteger,
|
|
3507
|
+
(input) => Number.isSafeInteger(input)
|
|
3508
|
+
);
|
|
4021
3509
|
}
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
3510
|
+
};
|
|
3511
|
+
var _NumberSchema = class _NumberSchema extends ValueSchema {
|
|
3512
|
+
/**
|
|
3513
|
+
* The base Object validator validating that the input is an object.
|
|
3514
|
+
*/
|
|
3515
|
+
static get base() {
|
|
3516
|
+
if (this._base == null)
|
|
3517
|
+
this._base = new _NumberSchema(typeOfValidators.number);
|
|
3518
|
+
return this._base;
|
|
4027
3519
|
}
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
property: rule.property,
|
|
4037
|
-
expected: rule.minOccurs,
|
|
4038
|
-
actual: length
|
|
4039
|
-
})
|
|
4040
|
-
);
|
|
4041
|
-
}
|
|
4042
|
-
if (rule.maxOccurs != null && length > rule.maxOccurs) {
|
|
4043
|
-
throw new XmlSchemaError(
|
|
4044
|
-
substitute(xmlSchemaErrorLocale.atMostElements, {
|
|
4045
|
-
property: rule.property,
|
|
4046
|
-
expected: rule.maxOccurs,
|
|
4047
|
-
actual: length
|
|
4048
|
-
})
|
|
4049
|
-
);
|
|
4050
|
-
}
|
|
4051
|
-
});
|
|
3520
|
+
/**
|
|
3521
|
+
* Creates a validator that asserts that the input number is at least the provided minimum
|
|
3522
|
+
* value.
|
|
3523
|
+
*
|
|
3524
|
+
* @param min The minimum (inclusive) the value may be.
|
|
3525
|
+
*/
|
|
3526
|
+
gte(min) {
|
|
3527
|
+
return this.chain(numberValidators.gte(min));
|
|
4052
3528
|
}
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
this
|
|
3529
|
+
/**
|
|
3530
|
+
* Creates a validator that asserts that the input number is greater than the provided minimum
|
|
3531
|
+
* value.
|
|
3532
|
+
*
|
|
3533
|
+
* @param min The minimum (exclusive) the value may be.
|
|
3534
|
+
*/
|
|
3535
|
+
gt(min) {
|
|
3536
|
+
return this.chain(numberValidators.gt(min));
|
|
4061
3537
|
}
|
|
4062
|
-
|
|
4063
|
-
|
|
3538
|
+
/**
|
|
3539
|
+
* Creates a validator that asserts that the input number is at most the provided maximum
|
|
3540
|
+
* value.
|
|
3541
|
+
*
|
|
3542
|
+
* @param max The maximum (inclusive) the value may be.
|
|
3543
|
+
*/
|
|
3544
|
+
lte(max) {
|
|
3545
|
+
return this.chain(numberValidators.lte(max));
|
|
4064
3546
|
}
|
|
4065
|
-
|
|
4066
|
-
|
|
3547
|
+
/**
|
|
3548
|
+
* Creates a validator that asserts that the input number is less than the provided maximum
|
|
3549
|
+
* value.
|
|
3550
|
+
*
|
|
3551
|
+
* @param max The maximum (exclusive) the value may be.
|
|
3552
|
+
*/
|
|
3553
|
+
lt(max) {
|
|
3554
|
+
return this.chain(numberValidators.lt(max));
|
|
4067
3555
|
}
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
child.parent = out;
|
|
4078
|
-
}
|
|
4079
|
-
out[key] = child;
|
|
4080
|
-
}
|
|
4081
|
-
return out;
|
|
3556
|
+
/**
|
|
3557
|
+
* Creates a validator that asserts that the input number is at least the provided minimum
|
|
3558
|
+
* and at most the provided maximum values.
|
|
3559
|
+
*
|
|
3560
|
+
* @param min The minimum (inclusive) value the input may be.
|
|
3561
|
+
* @param max The maximum (inclusive) value the input may be.
|
|
3562
|
+
*/
|
|
3563
|
+
within(min, max) {
|
|
3564
|
+
return this.chain(numberValidators.within(min, max));
|
|
4082
3565
|
}
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
3566
|
+
/**
|
|
3567
|
+
* Creates a validator that asserts that the input number is finite.
|
|
3568
|
+
*/
|
|
3569
|
+
finite() {
|
|
3570
|
+
return this.chain(numberValidators.finite());
|
|
3571
|
+
}
|
|
3572
|
+
/**
|
|
3573
|
+
* Creates a validator that asserts that the input number is a safe integer.
|
|
3574
|
+
*/
|
|
3575
|
+
safeInteger() {
|
|
3576
|
+
return this.chain(numberValidators.safeInteger());
|
|
4089
3577
|
}
|
|
4090
3578
|
};
|
|
4091
|
-
|
|
4092
|
-
var
|
|
4093
|
-
function assertActuateEnum(str) {
|
|
4094
|
-
actuateValidator.assert(str, ErrorOrigin.PARSING);
|
|
4095
|
-
return str;
|
|
4096
|
-
}
|
|
3579
|
+
__publicField(_NumberSchema, "_base", null);
|
|
3580
|
+
var NumberSchema = _NumberSchema;
|
|
4097
3581
|
|
|
4098
|
-
// ../vinyl-
|
|
4099
|
-
var
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
var __hasOwnProp5 = Object.prototype.hasOwnProperty;
|
|
4104
|
-
var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
|
|
4105
|
-
var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4106
|
-
var __spreadValues5 = (a, b) => {
|
|
4107
|
-
for (var prop in b || (b = {}))
|
|
4108
|
-
if (__hasOwnProp5.call(b, prop))
|
|
4109
|
-
__defNormalProp6(a, prop, b[prop]);
|
|
4110
|
-
if (__getOwnPropSymbols5)
|
|
4111
|
-
for (var prop of __getOwnPropSymbols5(b)) {
|
|
4112
|
-
if (__propIsEnum5.call(b, prop))
|
|
4113
|
-
__defNormalProp6(a, prop, b[prop]);
|
|
4114
|
-
}
|
|
4115
|
-
return a;
|
|
3582
|
+
// ../vinyl-validation/src/validation/validators.ts
|
|
3583
|
+
var locale11 = {
|
|
3584
|
+
isOneOf: "one of: {value}",
|
|
3585
|
+
instanceOf: "instance of {value}",
|
|
3586
|
+
oneOfSeparator: " | "
|
|
4116
3587
|
};
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
if (!match) throwParsingError(`invalid ratio format: ${str}`);
|
|
4127
|
-
return [parseInt(match[1] || "1"), parseInt(match[2] || "1")];
|
|
4128
|
-
}
|
|
4129
|
-
function stringifyRatio(value) {
|
|
4130
|
-
return `${value[0]}:${value[1]}`;
|
|
4131
|
-
}
|
|
4132
|
-
var framerateRegexp = /^(\d+)(?:\/(\d+))?$/;
|
|
4133
|
-
function parseFrameRate(str) {
|
|
4134
|
-
const match = str ? framerateRegexp.exec(str) : null;
|
|
4135
|
-
if (!match) throwParsingError(`invalid frame rate: '${str}'`);
|
|
4136
|
-
return [parseInt(match[1]), parseInt(match[2] || "1")];
|
|
4137
|
-
}
|
|
4138
|
-
function stringifyFrameRate(value) {
|
|
4139
|
-
return value[1] === 1 ? value[0].toString() : `${value[0]}/${value[1]}`;
|
|
3588
|
+
function isOneOf(...possibleValues) {
|
|
3589
|
+
return new ValueSchema(
|
|
3590
|
+
createValidator(
|
|
3591
|
+
substitute(locale11.isOneOf, {
|
|
3592
|
+
value: possibleValues.join(locale11.oneOfSeparator)
|
|
3593
|
+
}),
|
|
3594
|
+
(input) => possibleValues.includes(input)
|
|
3595
|
+
)
|
|
3596
|
+
);
|
|
4140
3597
|
}
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
const match = str ? byteRangeExp.exec(str) : null;
|
|
4144
|
-
if (!match) throwParsingError(`invalid byte range: '${str}'`);
|
|
4145
|
-
let start = parseInt(match[1]);
|
|
4146
|
-
if (start < 0) start >>>= 0;
|
|
4147
|
-
let end = parseIntSafe(match[2]);
|
|
4148
|
-
if (end != null && end < 0) end = end >>> 0;
|
|
4149
|
-
return [start, end];
|
|
3598
|
+
function number() {
|
|
3599
|
+
return NumberSchema.base;
|
|
4150
3600
|
}
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
3601
|
+
|
|
3602
|
+
// ../vinyl-xml/src/xlink/actuateValidator.ts
|
|
3603
|
+
var actuateValidator = isOneOf("onLoad", "onRequest");
|
|
3604
|
+
function assertActuateEnum(str) {
|
|
3605
|
+
actuateValidator.assert(str, ErrorOrigin.PARSING);
|
|
3606
|
+
return str;
|
|
4154
3607
|
}
|
|
3608
|
+
|
|
3609
|
+
// ../vinyl-mpd-parser/src/duration/duration.ts
|
|
4155
3610
|
var I = 60;
|
|
4156
3611
|
var H = 3600;
|
|
4157
3612
|
var D = 86400;
|
|
@@ -4188,6 +3643,8 @@ ${this.lastInitStack}` : "";
|
|
|
4188
3643
|
if (seconds > 0 || !value) isoString += `${roundToNearest(seconds, 1e-3)}S`;
|
|
4189
3644
|
return isoString;
|
|
4190
3645
|
}
|
|
3646
|
+
|
|
3647
|
+
// ../vinyl-mpd-parser/src/manifest/dashManifestXmlRules.ts
|
|
4191
3648
|
var dashNamespaceUri = "urn:mpeg:dash:schema:mpd:2011";
|
|
4192
3649
|
function dashManifestXmlRules() {
|
|
4193
3650
|
const attrActuateType = attr(assertActuateEnum, stringify, {
|
|
@@ -4239,7 +3696,7 @@ ${this.lastInitStack}` : "";
|
|
|
4239
3696
|
const segmentTimelineType = {
|
|
4240
3697
|
S: elements(segmentTimelineTypeSType)
|
|
4241
3698
|
};
|
|
4242
|
-
const multipleSegmentBaseType =
|
|
3699
|
+
const multipleSegmentBaseType = __spreadProps(__spreadValues({}, segmentBaseType), {
|
|
4243
3700
|
SegmentTimeline: element(segmentTimelineType),
|
|
4244
3701
|
BitstreamSwitching: element(urlType),
|
|
4245
3702
|
duration: attrInt,
|
|
@@ -4251,12 +3708,12 @@ ${this.lastInitStack}` : "";
|
|
|
4251
3708
|
media: attrString,
|
|
4252
3709
|
mediaRange: attr(parseByteRange, stringifyByteRange)
|
|
4253
3710
|
};
|
|
4254
|
-
const segmentListType =
|
|
3711
|
+
const segmentListType = __spreadProps(__spreadValues({}, multipleSegmentBaseType), {
|
|
4255
3712
|
actuate: attrActuateType,
|
|
4256
3713
|
href: attrString,
|
|
4257
3714
|
SegmentURL: elements(segmentURLType)
|
|
4258
3715
|
});
|
|
4259
|
-
const segmentTemplateType =
|
|
3716
|
+
const segmentTemplateType = __spreadProps(__spreadValues({}, multipleSegmentBaseType), {
|
|
4260
3717
|
bitstreamSwitching: attrString,
|
|
4261
3718
|
index: attrString,
|
|
4262
3719
|
initialization: attrString,
|
|
@@ -4308,13 +3765,13 @@ ${this.lastInitStack}` : "";
|
|
|
4308
3765
|
startWithSAP: attr(parseSap, stringify),
|
|
4309
3766
|
width: attrInt
|
|
4310
3767
|
};
|
|
4311
|
-
const subRepresentationType =
|
|
3768
|
+
const subRepresentationType = __spreadProps(__spreadValues({}, representationBaseType), {
|
|
4312
3769
|
bandwidth: attrInt,
|
|
4313
3770
|
contentComponent: attr(parseStringVector, stringifyStringVector),
|
|
4314
3771
|
dependencyLevel: attr(parseIntVector, stringifyIntVector),
|
|
4315
3772
|
level: attrInt
|
|
4316
3773
|
});
|
|
4317
|
-
const representationType =
|
|
3774
|
+
const representationType = __spreadProps(__spreadValues({}, representationBaseType), {
|
|
4318
3775
|
bandwidth: attrInt({ required: true }),
|
|
4319
3776
|
bitrate: attrInt,
|
|
4320
3777
|
dependencyId: attr(parseStringVector, stringifyStringVector),
|
|
@@ -4327,7 +3784,7 @@ ${this.lastInitStack}` : "";
|
|
|
4327
3784
|
SegmentTemplate: element(segmentTemplateType),
|
|
4328
3785
|
SubRepresentation: elements(subRepresentationType)
|
|
4329
3786
|
});
|
|
4330
|
-
const adaptationSetType =
|
|
3787
|
+
const adaptationSetType = __spreadProps(__spreadValues({}, representationBaseType), {
|
|
4331
3788
|
Accessibility: elements(descriptorType),
|
|
4332
3789
|
Role: elements(descriptorType),
|
|
4333
3790
|
Rating: elements(descriptorType),
|
|
@@ -4438,7 +3895,7 @@ ${this.lastInitStack}` : "";
|
|
|
4438
3895
|
function stringifyProfiles(value) {
|
|
4439
3896
|
return value.join(",");
|
|
4440
3897
|
}
|
|
4441
|
-
var videoScanTypeValidator =
|
|
3898
|
+
var videoScanTypeValidator = isOneOf(
|
|
4442
3899
|
"progressive",
|
|
4443
3900
|
"interlaced",
|
|
4444
3901
|
"unknown"
|
|
@@ -4447,7 +3904,7 @@ ${this.lastInitStack}` : "";
|
|
|
4447
3904
|
videoScanTypeValidator.assert(str, ErrorOrigin.PARSING);
|
|
4448
3905
|
return str;
|
|
4449
3906
|
}
|
|
4450
|
-
var switchingTypeTypeValidator =
|
|
3907
|
+
var switchingTypeTypeValidator = isOneOf(
|
|
4451
3908
|
"media",
|
|
4452
3909
|
"bitstream"
|
|
4453
3910
|
);
|
|
@@ -4455,7 +3912,7 @@ ${this.lastInitStack}` : "";
|
|
|
4455
3912
|
switchingTypeTypeValidator.assert(str, ErrorOrigin.PARSING);
|
|
4456
3913
|
return str;
|
|
4457
3914
|
}
|
|
4458
|
-
var validateSap =
|
|
3915
|
+
var validateSap = number().within(0, 6);
|
|
4459
3916
|
function parseSap(str) {
|
|
4460
3917
|
const number2 = parseInt(str);
|
|
4461
3918
|
validateSap.assert(number2, ErrorOrigin.PARSING);
|
|
@@ -4473,7 +3930,7 @@ ${this.lastInitStack}` : "";
|
|
|
4473
3930
|
function stringifyIntVector(value) {
|
|
4474
3931
|
return value.join(" ");
|
|
4475
3932
|
}
|
|
4476
|
-
var presentationTypeValidator =
|
|
3933
|
+
var presentationTypeValidator = isOneOf(
|
|
4477
3934
|
"static",
|
|
4478
3935
|
"dynamic"
|
|
4479
3936
|
);
|
|
@@ -4492,11 +3949,13 @@ ${this.lastInitStack}` : "";
|
|
|
4492
3949
|
return parseInt(str);
|
|
4493
3950
|
}
|
|
4494
3951
|
}
|
|
3952
|
+
|
|
3953
|
+
// ../vinyl-mpd-parser/src/manifest/ext/drm/cencXmlRules.ts
|
|
4495
3954
|
var cencXmlRules = {
|
|
4496
|
-
default_KID:
|
|
3955
|
+
default_KID: attr(parseStringVector, stringifyStringVector, {
|
|
4497
3956
|
namespaceUri: CENC_NAMESPACE_URI
|
|
4498
3957
|
}),
|
|
4499
|
-
pssh:
|
|
3958
|
+
pssh: element(
|
|
4500
3959
|
{
|
|
4501
3960
|
_content: charactersString
|
|
4502
3961
|
},
|
|
@@ -4505,6 +3964,8 @@ ${this.lastInitStack}` : "";
|
|
|
4505
3964
|
}
|
|
4506
3965
|
)
|
|
4507
3966
|
};
|
|
3967
|
+
|
|
3968
|
+
// ../vinyl-mpd-parser/src/manifest/ext/drm/contentProtection.ts
|
|
4508
3969
|
function createDashProtectionXmlRules(contentProtectionRules) {
|
|
4509
3970
|
const withProtections = {
|
|
4510
3971
|
ContentProtection: elements(contentProtectionRules)
|
|
@@ -4514,8 +3975,8 @@ ${this.lastInitStack}` : "";
|
|
|
4514
3975
|
{
|
|
4515
3976
|
Period: elements(
|
|
4516
3977
|
{
|
|
4517
|
-
AdaptationSet: elements(
|
|
4518
|
-
Representation: elements(
|
|
3978
|
+
AdaptationSet: elements(__spreadProps(__spreadValues({}, withProtections), {
|
|
3979
|
+
Representation: elements(__spreadProps(__spreadValues({}, withProtections), {
|
|
4519
3980
|
SubRepresentation: elements(
|
|
4520
3981
|
withProtections
|
|
4521
3982
|
)
|
|
@@ -4531,8 +3992,10 @@ ${this.lastInitStack}` : "";
|
|
|
4531
3992
|
)
|
|
4532
3993
|
};
|
|
4533
3994
|
}
|
|
3995
|
+
|
|
3996
|
+
// ../vinyl-mpd-parser/src/manifest/ext/drm/playreadyXmlRules.ts
|
|
4534
3997
|
var playreadyXmlRules = {
|
|
4535
|
-
pro:
|
|
3998
|
+
pro: element(
|
|
4536
3999
|
{
|
|
4537
4000
|
_content: charactersString
|
|
4538
4001
|
},
|
|
@@ -4541,12 +4004,14 @@ ${this.lastInitStack}` : "";
|
|
|
4541
4004
|
}
|
|
4542
4005
|
)
|
|
4543
4006
|
};
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4007
|
+
|
|
4008
|
+
// ../vinyl-mpd-parser/src/manifest/dashParser.ts
|
|
4009
|
+
var dashDrmRules = mergeXmlRules(
|
|
4010
|
+
dashManifestXmlRules(),
|
|
4011
|
+
createDashProtectionXmlRules(cencXmlRules),
|
|
4012
|
+
createDashProtectionXmlRules(playreadyXmlRules)
|
|
4548
4013
|
);
|
|
4549
|
-
var dashDrmRulesMapped =
|
|
4014
|
+
var dashDrmRulesMapped = mapXmlRules(dashDrmRules);
|
|
4550
4015
|
function dashManifestHandler() {
|
|
4551
4016
|
return new ParseXmlHandlerImpl(dashDrmRulesMapped);
|
|
4552
4017
|
}
|
|
@@ -4628,36 +4093,113 @@ ${this.lastInitStack}` : "";
|
|
|
4628
4093
|
((_a2 = getSearchParams().get("checkAudio")) != null ? _a2 : "0").toLowerCase()
|
|
4629
4094
|
);
|
|
4630
4095
|
|
|
4631
|
-
// test/
|
|
4096
|
+
// ../vinyl-util/test/testUtil/reporters/LogReporter.ts
|
|
4097
|
+
var consoleMethodLevels = {
|
|
4098
|
+
debug: 1 /* DEBUG */,
|
|
4099
|
+
log: 1 /* DEBUG */,
|
|
4100
|
+
warn: 3 /* WARN */,
|
|
4101
|
+
info: 2 /* INFO */,
|
|
4102
|
+
error: 4 /* ERROR */
|
|
4103
|
+
};
|
|
4104
|
+
|
|
4105
|
+
// ../vinyl-util/test/testUtil/mock/network/emptyRequestInfo.ts
|
|
4106
|
+
var emptyRequestInfo = {
|
|
4107
|
+
requestId: "",
|
|
4108
|
+
requestOptions: { readErrorBody: 0 /* DISABLED */, serviceId: null },
|
|
4109
|
+
init: {},
|
|
4110
|
+
input: "",
|
|
4111
|
+
maxRetries: 0,
|
|
4112
|
+
timestamp: 0
|
|
4113
|
+
};
|
|
4114
|
+
var emptyRequestAttemptInfo = {
|
|
4115
|
+
currentTry: 0,
|
|
4116
|
+
timestamp: 0
|
|
4117
|
+
};
|
|
4118
|
+
var emptyResponseInfo = {
|
|
4119
|
+
ok: false,
|
|
4120
|
+
redirected: false,
|
|
4121
|
+
status: 0,
|
|
4122
|
+
statusText: "",
|
|
4123
|
+
type: "default",
|
|
4124
|
+
url: "",
|
|
4125
|
+
contentLength: 0
|
|
4126
|
+
};
|
|
4127
|
+
var emptyInternalError = {
|
|
4128
|
+
ok: false,
|
|
4129
|
+
reason: null,
|
|
4130
|
+
requestInfo: emptyRequestInfo,
|
|
4131
|
+
retryAfter: null,
|
|
4132
|
+
timestamp: 0,
|
|
4133
|
+
type: "internal" /* INTERNAL */,
|
|
4134
|
+
willRetry: false
|
|
4135
|
+
};
|
|
4136
|
+
var emptyNetworkError = {
|
|
4137
|
+
ok: false,
|
|
4138
|
+
reason: null,
|
|
4139
|
+
requestInfo: emptyRequestInfo,
|
|
4140
|
+
retryAfter: null,
|
|
4141
|
+
timestamp: 0,
|
|
4142
|
+
type: "network" /* NETWORK */,
|
|
4143
|
+
willRetry: false,
|
|
4144
|
+
attemptInfo: emptyRequestAttemptInfo
|
|
4145
|
+
};
|
|
4146
|
+
var emptyResponseError = {
|
|
4147
|
+
ok: false,
|
|
4148
|
+
reason: null,
|
|
4149
|
+
requestInfo: emptyRequestInfo,
|
|
4150
|
+
retryAfter: null,
|
|
4151
|
+
timestamp: 0,
|
|
4152
|
+
type: "response" /* RESPONSE */,
|
|
4153
|
+
willRetry: false,
|
|
4154
|
+
attemptInfo: emptyRequestAttemptInfo,
|
|
4155
|
+
responseInfo: emptyResponseInfo
|
|
4156
|
+
};
|
|
4157
|
+
var emptyAbortError = __spreadProps(__spreadValues({}, emptyInternalError), {
|
|
4158
|
+
type: "abort" /* ABORT */
|
|
4159
|
+
});
|
|
4160
|
+
|
|
4161
|
+
// ../vinyl-util/test/testUtil/mock/network/MockRequester.ts
|
|
4632
4162
|
var spyFactory = createSpyFactory();
|
|
4633
4163
|
|
|
4634
|
-
// test/
|
|
4164
|
+
// ../vinyl-util/test/testUtil/mock/network/MockNetworkState.ts
|
|
4635
4165
|
var spyFactory2 = createSpyFactory();
|
|
4636
4166
|
|
|
4637
|
-
// test/
|
|
4167
|
+
// ../vinyl-util/test/testUtil/mock/network/MockNetworkMetricsController.ts
|
|
4638
4168
|
var spyFactory3 = createSpyFactory();
|
|
4639
4169
|
|
|
4640
|
-
// test/
|
|
4170
|
+
// ../vinyl-util/test/testUtil/mock/logging/MockLogger.ts
|
|
4641
4171
|
var spyFactory4 = createSpyFactory();
|
|
4642
4172
|
|
|
4643
|
-
// test/vinylTestUtil/mock/
|
|
4173
|
+
// test/vinylTestUtil/mock/track/MockTrackController.ts
|
|
4644
4174
|
var spyFactory5 = createSpyFactory();
|
|
4645
4175
|
|
|
4646
|
-
// test/vinylTestUtil/mock/
|
|
4176
|
+
// test/vinylTestUtil/mock/track/MockTrack.ts
|
|
4647
4177
|
var spyFactory6 = createSpyFactory();
|
|
4648
4178
|
|
|
4649
|
-
// test/vinylTestUtil/mock/
|
|
4179
|
+
// test/vinylTestUtil/mock/track/MockAutoResetController.ts
|
|
4650
4180
|
var spyFactory7 = createSpyFactory();
|
|
4651
4181
|
|
|
4652
|
-
// test/vinylTestUtil/mock/
|
|
4182
|
+
// test/vinylTestUtil/mock/hls/MockHlsManifestController.ts
|
|
4653
4183
|
var spyFactory8 = createSpyFactory();
|
|
4654
4184
|
|
|
4655
|
-
// test/vinylTestUtil/mock/
|
|
4185
|
+
// test/vinylTestUtil/mock/streaming/buffering/MockMediaSourceController.ts
|
|
4656
4186
|
var spyFactory9 = createSpyFactory();
|
|
4657
4187
|
|
|
4658
|
-
// test/vinylTestUtil/mock/
|
|
4188
|
+
// test/vinylTestUtil/mock/playback/MockPlaybackSource.ts
|
|
4659
4189
|
var spyFactory10 = createSpyFactory();
|
|
4660
4190
|
|
|
4191
|
+
// test/vinylTestUtil/mock/streaming/MockContentStream.ts
|
|
4192
|
+
var spyFactory11 = createSpyFactory();
|
|
4193
|
+
|
|
4194
|
+
// test/vinylTestUtil/mock/playback/MockPlaybackController.ts
|
|
4195
|
+
var spyFactory12 = createSpyFactory();
|
|
4196
|
+
|
|
4197
|
+
// test/vinylTestUtil/mock/drm/MockDrmController.ts
|
|
4198
|
+
var spyFactory13 = createSpyFactory();
|
|
4199
|
+
|
|
4200
|
+
// test/vinylTestUtil/mock/track/hls/createMockHlsDependencies.ts
|
|
4201
|
+
var spyFactory14 = createSpyFactory();
|
|
4202
|
+
|
|
4661
4203
|
// test/vinylTestUtil/mock/dash/mockDashManifest.ts
|
|
4662
4204
|
var mockDashManifest = parseDashManifest(
|
|
4663
4205
|
// language=XML
|
|
@@ -4672,69 +4214,69 @@ ${this.lastInitStack}` : "";
|
|
|
4672
4214
|
);
|
|
4673
4215
|
|
|
4674
4216
|
// test/vinylTestUtil/mock/dash/MockDashManifestController.ts
|
|
4675
|
-
var
|
|
4217
|
+
var spyFactory15 = createSpyFactory();
|
|
4676
4218
|
|
|
4677
4219
|
// test/vinylTestUtil/mock/track/dash/createMockDashDependencies.ts
|
|
4678
|
-
var
|
|
4220
|
+
var spyFactory16 = createSpyFactory();
|
|
4679
4221
|
|
|
4680
4222
|
// test/vinylTestUtil/mock/streaming/MockSegmentController.ts
|
|
4681
|
-
var
|
|
4223
|
+
var spyFactory17 = createSpyFactory();
|
|
4682
4224
|
|
|
4683
4225
|
// test/vinylTestUtil/mock/streaming/buffering/MockSourceBufferController.ts
|
|
4684
|
-
var
|
|
4226
|
+
var spyFactory18 = createSpyFactory();
|
|
4685
4227
|
|
|
4686
4228
|
// test/vinylTestUtil/mock/streaming/buffering/MockBufferingController.ts
|
|
4687
|
-
var
|
|
4229
|
+
var spyFactory19 = createSpyFactory();
|
|
4688
4230
|
|
|
4689
4231
|
// test/vinylTestUtil/mock/streaming/abr/MockQualitySelector.ts
|
|
4690
|
-
var
|
|
4232
|
+
var spyFactory20 = createSpyFactory();
|
|
4691
4233
|
|
|
4692
4234
|
// test/vinylTestUtil/mock/client/MockCapabilities.ts
|
|
4693
|
-
var
|
|
4235
|
+
var spyFactory21 = createSpyFactory();
|
|
4694
4236
|
|
|
4695
4237
|
// test/vinylTestUtil/mock/playback/MockLoudnessNormalizationController.ts
|
|
4696
|
-
var
|
|
4238
|
+
var spyFactory22 = createSpyFactory();
|
|
4697
4239
|
|
|
4698
4240
|
// test/vinylTestUtil/mock/logging/MockHistoryLogHandler.ts
|
|
4699
|
-
var
|
|
4241
|
+
var spyFactory23 = createSpyFactory();
|
|
4700
4242
|
|
|
4701
4243
|
// test/vinylTestUtil/mock/drm/MockCommonMediaKeys.ts
|
|
4702
|
-
var
|
|
4244
|
+
var spyFactory24 = createSpyFactory();
|
|
4703
4245
|
|
|
4704
4246
|
// test/vinylTestUtil/mock/drm/MockCommonMediaKeySystemAccess.ts
|
|
4705
|
-
var
|
|
4247
|
+
var spyFactory25 = createSpyFactory();
|
|
4706
4248
|
|
|
4707
4249
|
// test/vinylTestUtil/mock/drm/MockCommonMediaKeySession.ts
|
|
4708
|
-
var
|
|
4250
|
+
var spyFactory26 = createSpyFactory();
|
|
4709
4251
|
|
|
4710
4252
|
// test/vinylTestUtil/mock/drm/MockCommonEme.ts
|
|
4711
|
-
var
|
|
4253
|
+
var spyFactory27 = createSpyFactory();
|
|
4712
4254
|
|
|
4713
4255
|
// test/vinylTestUtil/mock/dom/webkit/MockWebKitMediaKeys.ts
|
|
4714
|
-
var
|
|
4256
|
+
var spyFactory28 = createSpyFactory();
|
|
4715
4257
|
var MockWebKitMediaKeys = class {
|
|
4716
4258
|
constructor(keySystem) {
|
|
4717
|
-
this
|
|
4718
|
-
__publicField(this, "createSession",
|
|
4259
|
+
__publicField(this, "keySystem", keySystem);
|
|
4260
|
+
__publicField(this, "createSession", spyFactory28("createSession"));
|
|
4719
4261
|
}
|
|
4720
4262
|
};
|
|
4721
|
-
__publicField(MockWebKitMediaKeys, "isTypeSupported",
|
|
4263
|
+
__publicField(MockWebKitMediaKeys, "isTypeSupported", spyFactory28("isTypeSupported"));
|
|
4722
4264
|
|
|
4723
4265
|
// test/vinylTestUtil/mock/dom/webkit/MockWebKitMediaKeySession.ts
|
|
4724
|
-
var
|
|
4266
|
+
var spyFactory29 = createSpyFactory();
|
|
4725
4267
|
|
|
4726
4268
|
// test/vinylTestUtil/mock/dom/ms/MockMSMediaKeys.ts
|
|
4727
|
-
var
|
|
4269
|
+
var spyFactory30 = createSpyFactory();
|
|
4728
4270
|
var MockMSMediaKeys = class {
|
|
4729
4271
|
constructor(keySystem) {
|
|
4730
|
-
this
|
|
4731
|
-
__publicField(this, "createSession",
|
|
4272
|
+
__publicField(this, "keySystem", keySystem);
|
|
4273
|
+
__publicField(this, "createSession", spyFactory30("createSession"));
|
|
4732
4274
|
}
|
|
4733
4275
|
};
|
|
4734
|
-
__publicField(MockMSMediaKeys, "isTypeSupported",
|
|
4276
|
+
__publicField(MockMSMediaKeys, "isTypeSupported", spyFactory30("isTypeSupported"));
|
|
4735
4277
|
|
|
4736
4278
|
// test/vinylTestUtil/mock/dom/ms/MockMSMediaKeySession.ts
|
|
4737
|
-
var
|
|
4279
|
+
var spyFactory31 = createSpyFactory();
|
|
4738
4280
|
|
|
4739
4281
|
// test/vinylTestUtil/assets/dash_segmentListMediaRange.ts
|
|
4740
4282
|
var dash_segmentListMediaRange = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|