lakutata 2.0.82 → 2.0.83
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/com/docker.cjs +1 -1
- package/com/docker.mjs +1 -1
- package/decorator/orm.cjs +84 -84
- package/decorator/orm.mjs +42 -128
- package/orm.cjs +871 -1408
- package/orm.mjs +712 -1462
- package/package.json +1 -1
- package/src/components/Database.cjs +2 -2
- package/src/components/Database.mjs +6 -6
- package/src/components/cacher/Cacher.cjs +129 -129
- package/src/components/cacher/Cacher.mjs +117 -117
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +303 -312
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +304 -313
- package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +12 -12
- package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +11 -11
- package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +16 -16
- package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +14 -14
- package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +11 -11
- package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +11 -11
- package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +12 -12
- package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +13 -13
- package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
- package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
- package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +10 -10
- package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +10 -10
- package/src/components/cacher/lib/IsDriverPackageInstalled.cjs +2 -2
- package/src/components/cacher/lib/IsDriverPackageInstalled.mjs +5 -5
- package/src/components/docker/ConnectionOptionsBuilder.cjs +11 -11
- package/src/components/docker/ConnectionOptionsBuilder.mjs +7 -7
- package/src/components/docker/Docker.cjs +5067 -4956
- package/src/components/docker/Docker.mjs +4982 -4871
- package/src/components/docker/lib/DockerContainer.cjs +1 -1
- package/src/components/docker/lib/DockerContainer.mjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
- package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
- package/src/components/docker/lib/ParseEnvToRecord.cjs +2 -2
- package/src/components/docker/lib/ParseEnvToRecord.mjs +12 -12
- package/src/components/docker/lib/ParseRepositoryTag.cjs +9 -9
- package/src/components/docker/lib/ParseRepositoryTag.mjs +11 -11
- package/src/components/entrypoint/Entrypoint.cjs +1678 -2168
- package/src/components/entrypoint/Entrypoint.mjs +1680 -2170
- package/src/components/monitor/AliveMonitor.cjs +2 -2
- package/src/components/monitor/AliveMonitor.mjs +2 -2
- package/src/components/monitor/MemoryMonitor.cjs +3 -3
- package/src/decorators/asst/After.cjs +3 -3
- package/src/decorators/asst/After.mjs +2 -2
- package/src/decorators/asst/Before.cjs +2 -2
- package/src/decorators/asst/Before.mjs +4 -4
- package/src/decorators/ctrl/CLIAction.cjs +2 -2
- package/src/decorators/ctrl/CLIAction.mjs +7 -7
- package/src/decorators/ctrl/HTTPAction.cjs +6 -6
- package/src/decorators/ctrl/HTTPAction.mjs +4 -4
- package/src/decorators/ctrl/ServiceAction.cjs +3 -3
- package/src/decorators/ctrl/ServiceAction.mjs +4 -4
- package/src/decorators/ctrl/http/DELETE.cjs +2 -2
- package/src/decorators/ctrl/http/DELETE.mjs +2 -2
- package/src/decorators/ctrl/http/GET.cjs +2 -2
- package/src/decorators/ctrl/http/GET.mjs +2 -2
- package/src/decorators/ctrl/http/HEAD.cjs +2 -2
- package/src/decorators/ctrl/http/HEAD.mjs +2 -2
- package/src/decorators/ctrl/http/OPTIONS.cjs +2 -2
- package/src/decorators/ctrl/http/OPTIONS.mjs +2 -2
- package/src/decorators/ctrl/http/PATCH.cjs +2 -2
- package/src/decorators/ctrl/http/PATCH.mjs +2 -2
- package/src/decorators/ctrl/http/POST.cjs +2 -2
- package/src/decorators/ctrl/http/POST.mjs +2 -2
- package/src/decorators/ctrl/http/PUT.cjs +2 -2
- package/src/decorators/ctrl/http/PUT.mjs +2 -2
- package/src/decorators/di/Autoload.cjs +2 -2
- package/src/decorators/di/Autoload.mjs +2 -2
- package/src/decorators/di/Configurable.cjs +3 -3
- package/src/decorators/di/Configurable.mjs +2 -2
- package/src/decorators/di/Inject.cjs +6 -6
- package/src/decorators/di/Inject.mjs +11 -11
- package/src/decorators/di/Lifetime.cjs +18 -18
- package/src/decorators/di/Lifetime.mjs +13 -13
- package/src/decorators/dto/Accept.cjs +3 -3
- package/src/decorators/dto/Accept.mjs +2 -2
- package/src/decorators/dto/Expect.cjs +2 -2
- package/src/decorators/dto/Expect.mjs +3 -3
- package/src/decorators/dto/IndexSignature.cjs +2 -2
- package/src/decorators/dto/IndexSignature.mjs +3 -3
- package/src/decorators/dto/Return.cjs +3 -3
- package/src/decorators/dto/Return.mjs +2 -2
- package/src/decorators/orm/AfterInsert.cjs +26 -4
- package/src/decorators/orm/AfterInsert.mjs +25 -5
- package/src/decorators/orm/AfterLoad.cjs +26 -4
- package/src/decorators/orm/AfterLoad.mjs +25 -5
- package/src/decorators/orm/AfterRecover.cjs +26 -4
- package/src/decorators/orm/AfterRecover.mjs +25 -5
- package/src/decorators/orm/AfterRemove.cjs +26 -4
- package/src/decorators/orm/AfterRemove.mjs +25 -5
- package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
- package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
- package/src/decorators/orm/AfterUpdate.cjs +26 -4
- package/src/decorators/orm/AfterUpdate.mjs +25 -5
- package/src/decorators/orm/BeforeInsert.cjs +26 -4
- package/src/decorators/orm/BeforeInsert.mjs +25 -5
- package/src/decorators/orm/BeforeRecover.cjs +26 -4
- package/src/decorators/orm/BeforeRecover.mjs +25 -5
- package/src/decorators/orm/BeforeRemove.cjs +26 -4
- package/src/decorators/orm/BeforeRemove.mjs +25 -5
- package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
- package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
- package/src/decorators/orm/BeforeUpdate.cjs +26 -4
- package/src/decorators/orm/BeforeUpdate.mjs +25 -5
- package/src/decorators/orm/Check.cjs +29 -4
- package/src/decorators/orm/Check.mjs +28 -5
- package/src/decorators/orm/ChildEntity.cjs +29 -4
- package/src/decorators/orm/ChildEntity.mjs +28 -5
- package/src/decorators/orm/Column.cjs +61 -4
- package/src/decorators/orm/Column.mjs +61 -6
- package/src/decorators/orm/CreateDateColumn.cjs +25 -4
- package/src/decorators/orm/CreateDateColumn.mjs +24 -5
- package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
- package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
- package/src/decorators/orm/Entity.cjs +35 -4
- package/src/decorators/orm/Entity.mjs +33 -4
- package/src/decorators/orm/EventSubscriber.cjs +22 -4
- package/src/decorators/orm/EventSubscriber.mjs +21 -5
- package/src/decorators/orm/Exclusion.cjs +29 -4
- package/src/decorators/orm/Exclusion.mjs +28 -5
- package/src/decorators/orm/Generated.cjs +24 -4
- package/src/decorators/orm/Generated.mjs +23 -5
- package/src/decorators/orm/Index.cjs +41 -4
- package/src/decorators/orm/Index.mjs +41 -6
- package/src/decorators/orm/JoinColumn.cjs +29 -4
- package/src/decorators/orm/JoinColumn.mjs +28 -5
- package/src/decorators/orm/JoinTable.cjs +30 -4
- package/src/decorators/orm/JoinTable.mjs +28 -4
- package/src/decorators/orm/ManyToMany.cjs +42 -4
- package/src/decorators/orm/ManyToMany.mjs +40 -4
- package/src/decorators/orm/ManyToOne.cjs +42 -4
- package/src/decorators/orm/ManyToOne.mjs +40 -4
- package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
- package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
- package/src/decorators/orm/OneToMany.cjs +34 -4
- package/src/decorators/orm/OneToMany.mjs +34 -6
- package/src/decorators/orm/OneToOne.cjs +42 -4
- package/src/decorators/orm/OneToOne.mjs +40 -4
- package/src/decorators/orm/PrimaryColumn.cjs +49 -4
- package/src/decorators/orm/PrimaryColumn.mjs +49 -6
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
- package/src/decorators/orm/RelationId.cjs +26 -4
- package/src/decorators/orm/RelationId.mjs +25 -5
- package/src/decorators/orm/TableInheritance.cjs +26 -4
- package/src/decorators/orm/TableInheritance.mjs +25 -5
- package/src/decorators/orm/Tree.cjs +24 -4
- package/src/decorators/orm/Tree.mjs +23 -5
- package/src/decorators/orm/TreeChildren.cjs +31 -4
- package/src/decorators/orm/TreeChildren.mjs +29 -4
- package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
- package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
- package/src/decorators/orm/TreeParent.cjs +31 -4
- package/src/decorators/orm/TreeParent.mjs +29 -4
- package/src/decorators/orm/Unique.cjs +44 -4
- package/src/decorators/orm/Unique.mjs +44 -6
- package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
- package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
- package/src/decorators/orm/VersionColumn.cjs +25 -4
- package/src/decorators/orm/VersionColumn.mjs +24 -5
- package/src/decorators/orm/ViewColumn.cjs +25 -4
- package/src/decorators/orm/ViewColumn.mjs +24 -5
- package/src/decorators/orm/ViewEntity.cjs +34 -4
- package/src/decorators/orm/ViewEntity.mjs +33 -5
- package/src/decorators/orm/VirtualColumn.cjs +42 -4
- package/src/decorators/orm/VirtualColumn.mjs +40 -4
- package/src/lib/base/EventEmitter.cjs +1195 -1202
- package/src/lib/base/EventEmitter.mjs +1195 -1202
- package/src/lib/base/async-constructor/Append.cjs +11 -11
- package/src/lib/base/async-constructor/Append.mjs +7 -7
- package/src/lib/base/internal/BasicInfo.cjs +10 -10
- package/src/lib/base/internal/BasicInfo.mjs +9 -9
- package/src/lib/base/internal/CamelCase.cjs +4 -4
- package/src/lib/base/internal/CamelCase.mjs +11 -11
- package/src/lib/base/internal/ConfigurableRecordsInjection.cjs +19 -19
- package/src/lib/base/internal/ConfigurableRecordsInjection.mjs +18 -18
- package/src/lib/base/internal/ConstructorSymbol.cjs +10 -10
- package/src/lib/base/internal/ConstructorSymbol.mjs +8 -8
- package/src/lib/base/internal/ControllerEntrypoint.cjs +65 -65
- package/src/lib/base/internal/ControllerEntrypoint.mjs +36 -36
- package/src/lib/base/internal/DataValidator.cjs +185 -174
- package/src/lib/base/internal/DataValidator.mjs +230 -219
- package/src/lib/base/internal/GetActionDTOAndOptions.cjs +9 -9
- package/src/lib/base/internal/GetActionDTOAndOptions.mjs +10 -10
- package/src/lib/base/internal/IEEE754.cjs +74 -74
- package/src/lib/base/internal/IEEE754.mjs +70 -70
- package/src/lib/base/internal/MethodAssistantFunction.cjs +28 -28
- package/src/lib/base/internal/MethodAssistantFunction.mjs +38 -38
- package/src/lib/base/internal/MethodValidation.cjs +25 -25
- package/src/lib/base/internal/MethodValidation.mjs +20 -20
- package/src/lib/base/internal/ObjectConfiguration.cjs +10 -10
- package/src/lib/base/internal/ObjectConfiguration.mjs +15 -15
- package/src/lib/base/internal/ObjectContainer.cjs +7 -7
- package/src/lib/base/internal/ObjectContainer.mjs +6 -6
- package/src/lib/base/internal/ObjectInjection.cjs +16 -16
- package/src/lib/base/internal/ObjectInjection.mjs +13 -13
- package/src/lib/base/internal/ObjectLifetime.cjs +10 -10
- package/src/lib/base/internal/ObjectLifetime.mjs +9 -9
- package/src/lib/base/internal/ObjectWeakRefs.cjs +11 -11
- package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
- package/src/lib/base/internal/PatternManager.cjs +739 -744
- package/src/lib/base/internal/PatternManager.mjs +743 -748
- package/src/lib/base/internal/StringifyPattern.cjs +26 -26
- package/src/lib/base/internal/StringifyPattern.mjs +26 -26
- package/src/lib/base/internal/ThrowWarning.cjs +2 -2
- package/src/lib/base/internal/ThrowWarning.mjs +2 -2
- package/src/lib/core/Alias.cjs +5 -5
- package/src/lib/core/Application.cjs +115 -128
- package/src/lib/core/Application.mjs +135 -148
- package/src/lib/helpers/ArrayToSet.cjs +2 -2
- package/src/lib/helpers/ArrayToSet.mjs +3 -3
- package/src/lib/helpers/As.cjs +2 -2
- package/src/lib/helpers/As.mjs +2 -2
- package/src/lib/helpers/ConvertArrayLikeToIterable.cjs +3 -3
- package/src/lib/helpers/ConvertArrayLikeToIterable.mjs +3 -3
- package/src/lib/helpers/ConvertArrayLikeToStream.cjs +2 -2
- package/src/lib/helpers/ConvertArrayLikeToStream.mjs +2 -2
- package/src/lib/helpers/Delay.cjs +2 -2
- package/src/lib/helpers/Delay.mjs +2 -2
- package/src/lib/helpers/DevNull.cjs +2 -2
- package/src/lib/helpers/DevNull.mjs +2 -2
- package/src/lib/helpers/GetObjectNestingDepth.cjs +12 -12
- package/src/lib/helpers/GetObjectNestingDepth.mjs +11 -11
- package/src/lib/helpers/GetObjectPropertyPaths.cjs +7 -7
- package/src/lib/helpers/GetObjectPropertyPaths.mjs +9 -9
- package/src/lib/helpers/Glob.cjs +890 -890
- package/src/lib/helpers/Glob.mjs +889 -889
- package/src/lib/helpers/GraceExit.cjs +3 -3
- package/src/lib/helpers/GraceExit.mjs +7 -7
- package/src/lib/helpers/HexToIEEE754.cjs +4 -4
- package/src/lib/helpers/HexToIEEE754.mjs +2 -2
- package/src/lib/helpers/HexToSigned.cjs +5 -5
- package/src/lib/helpers/HexToSigned.mjs +4 -4
- package/src/lib/helpers/HexToUnsigned.cjs +2 -2
- package/src/lib/helpers/HexToUnsigned.mjs +2 -2
- package/src/lib/helpers/IEEE754ToHex.cjs +5 -5
- package/src/lib/helpers/IEEE754ToHex.mjs +5 -5
- package/src/lib/helpers/IsAbortError.cjs +2 -2
- package/src/lib/helpers/IsAbortError.mjs +3 -3
- package/src/lib/helpers/IsEmptyObject.cjs +3 -3
- package/src/lib/helpers/IsEmptyObject.mjs +3 -3
- package/src/lib/helpers/IsExists.cjs +5 -5
- package/src/lib/helpers/IsExists.mjs +4 -4
- package/src/lib/helpers/IsHtml.cjs +8 -18
- package/src/lib/helpers/IsHtml.mjs +8 -18
- package/src/lib/helpers/IsNativeFunction.cjs +2 -2
- package/src/lib/helpers/IsNativeFunction.mjs +2 -2
- package/src/lib/helpers/IsPath.cjs +2 -2
- package/src/lib/helpers/IsPath.mjs +5 -5
- package/src/lib/helpers/IsPromise.cjs +2 -2
- package/src/lib/helpers/IsPromise.mjs +2 -2
- package/src/lib/helpers/IsPromiseLike.cjs +5 -5
- package/src/lib/helpers/IsPromiseLike.mjs +6 -6
- package/src/lib/helpers/IsXML.cjs +1531 -1525
- package/src/lib/helpers/IsXML.mjs +1527 -1521
- package/src/lib/helpers/MD5.cjs +2 -2
- package/src/lib/helpers/MD5.mjs +2 -2
- package/src/lib/helpers/MergeArray.cjs +3 -3
- package/src/lib/helpers/MergeArray.mjs +3 -3
- package/src/lib/helpers/MergeMap.cjs +3 -3
- package/src/lib/helpers/MergeMap.mjs +3 -3
- package/src/lib/helpers/MergeSet.cjs +2 -2
- package/src/lib/helpers/MergeSet.mjs +3 -3
- package/src/lib/helpers/NoCase.cjs +27 -27
- package/src/lib/helpers/NoCase.mjs +24 -24
- package/src/lib/helpers/NonceStr.cjs +2 -2
- package/src/lib/helpers/NonceStr.mjs +2 -2
- package/src/lib/helpers/ObjectConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectConstructor.mjs +4 -4
- package/src/lib/helpers/ObjectHash.cjs +377 -384
- package/src/lib/helpers/ObjectHash.mjs +373 -380
- package/src/lib/helpers/ObjectParentConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectParentConstructor.mjs +5 -5
- package/src/lib/helpers/ObjectParentConstructors.cjs +6 -6
- package/src/lib/helpers/ObjectParentConstructors.mjs +2 -2
- package/src/lib/helpers/ObjectPrototype.cjs +2 -2
- package/src/lib/helpers/ObjectPrototype.mjs +2 -2
- package/src/lib/helpers/ObjectToMap.cjs +2 -2
- package/src/lib/helpers/ObjectToMap.mjs +3 -3
- package/src/lib/helpers/Paginator.cjs +2 -2
- package/src/lib/helpers/Paginator.mjs +6 -6
- package/src/lib/helpers/RandomString.cjs +148 -169
- package/src/lib/helpers/RandomString.mjs +145 -166
- package/src/lib/helpers/SHA1.cjs +2 -2
- package/src/lib/helpers/SHA1.mjs +2 -2
- package/src/lib/helpers/SHA256.cjs +2 -2
- package/src/lib/helpers/SHA256.mjs +2 -2
- package/src/lib/helpers/SetToArray.cjs +2 -2
- package/src/lib/helpers/SetToArray.mjs +2 -2
- package/src/lib/helpers/SignedToHex.cjs +4 -4
- package/src/lib/helpers/SignedToHex.mjs +4 -4
- package/src/lib/helpers/SortArray.cjs +16 -16
- package/src/lib/helpers/SortArray.mjs +15 -15
- package/src/lib/helpers/SortKeys.cjs +41 -41
- package/src/lib/helpers/SortKeys.mjs +41 -41
- package/src/lib/helpers/SortObject.cjs +2 -2
- package/src/lib/helpers/SortObject.mjs +2 -2
- package/src/lib/helpers/Templating.cjs +25 -25
- package/src/lib/helpers/Templating.mjs +25 -25
- package/src/lib/helpers/URLBuilder.cjs +355 -355
- package/src/lib/helpers/URLBuilder.mjs +349 -349
- package/src/lib/helpers/UniqueArray.cjs +3 -3
- package/src/lib/helpers/UniqueArray.mjs +2 -2
- package/src/lib/helpers/UnsignedToHex.cjs +3 -3
- package/src/lib/helpers/UnsignedToHex.mjs +3 -3
- package/src/lib/ioc/DependencyInjectionContainer.cjs +106 -106
- package/src/lib/ioc/DependencyInjectionContainer.mjs +122 -122
- package/src/lib/ioc/FunctionTokenizer.cjs +115 -115
- package/src/lib/ioc/FunctionTokenizer.mjs +102 -102
- package/src/lib/ioc/Lifetime.cjs +5 -5
- package/src/lib/ioc/Lifetime.mjs +5 -5
- package/src/lib/ioc/ListModules.cjs +5298 -5221
- package/src/lib/ioc/ListModules.mjs +5258 -5181
- package/src/lib/ioc/LoadModules.cjs +56 -56
- package/src/lib/ioc/LoadModules.mjs +69 -69
- package/src/lib/ioc/ParamParser.cjs +30 -30
- package/src/lib/ioc/ParamParser.mjs +41 -41
- package/src/lib/ioc/Resolvers.cjs +87 -87
- package/src/lib/ioc/Resolvers.mjs +109 -109
- package/src/lib/ioc/Utils.cjs +12 -12
- package/src/lib/ioc/Utils.mjs +18 -18
- package/src/lib/validation/VLD.cjs +4025 -4202
- package/src/lib/validation/VLD.mjs +2972 -3149
- package/src/providers/Database.cjs +2 -2
- package/src/providers/Database.mjs +7 -7
- package/src/providers/PasswordHash.cjs +330 -330
- package/src/providers/PasswordHash.mjs +397 -397
- package/src/providers/migration/GenerateMigration.cjs +2 -2
- package/src/providers/migration/GenerateMigration.mjs +2 -2
- package/vendor/Package.1.cjs +256 -256
- package/vendor/Package.1.mjs +254 -254
- package/vendor/Package.112.cjs +42157 -42076
- package/vendor/Package.112.mjs +42222 -42081
- package/vendor/Package.13.cjs +36 -36
- package/vendor/Package.13.mjs +24 -24
- package/vendor/Package.16.cjs +12351 -12233
- package/vendor/Package.16.mjs +12348 -12230
- package/vendor/Package.17.cjs +924 -924
- package/vendor/Package.17.mjs +943 -943
- package/vendor/Package.18.cjs +48229 -20
- package/vendor/Package.18.mjs +48192 -24
- package/vendor/Package.2.cjs +5824 -5853
- package/vendor/Package.2.mjs +5780 -5809
- package/vendor/Package.3.cjs +60 -60
- package/vendor/Package.3.mjs +85 -85
- package/vendor/Package.4.cjs +874 -884
- package/vendor/Package.4.mjs +877 -887
- package/vendor/Package.5.cjs +15 -19
- package/vendor/Package.5.mjs +10 -14
- package/vendor/Package.6.cjs +2058 -2067
- package/vendor/Package.6.mjs +2064 -2073
- package/vendor/Package.610.cjs +9 -9
- package/vendor/Package.611.cjs +39 -39
- package/vendor/Package.611.mjs +22 -22
- package/vendor/Package.612.cjs +33 -33
- package/vendor/Package.612.mjs +17 -17
- package/vendor/Package.613.cjs +62 -62
- package/vendor/Package.613.mjs +29 -29
- package/vendor/Package.62.cjs +295 -298
- package/vendor/Package.62.mjs +278 -281
- package/vendor/Package.63.cjs +354 -354
- package/vendor/Package.63.mjs +229 -229
- package/vendor/Package.64.cjs +74 -74
- package/vendor/Package.64.mjs +74 -74
- package/vendor/Package.65.cjs +1851 -1858
- package/vendor/Package.65.mjs +1693 -1700
- package/vendor/Package.66.cjs +16 -16
- package/vendor/Package.66.mjs +16 -16
- package/vendor/Package.67.cjs +87 -87
- package/vendor/Package.67.mjs +85 -85
- package/vendor/Package.68.cjs +14 -14
- package/vendor/Package.68.mjs +6 -6
- package/vendor/Package.69.cjs +8 -8
- package/vendor/Package.7.cjs +3 -3
- package/vendor/Package.7.mjs +3 -3
- package/vendor/Package.9.cjs +124 -138
- package/vendor/Package.9.mjs +121 -135
- package/vendor/TypeDef.internal.3.d.ts +0 -14
- package/vendor/Package.19.cjs +0 -37
- package/vendor/Package.19.mjs +0 -35
- package/vendor/Package.20.cjs +0 -37
- package/vendor/Package.20.mjs +0 -35
- package/vendor/Package.21.cjs +0 -37
- package/vendor/Package.21.mjs +0 -35
- package/vendor/Package.22.cjs +0 -37
- package/vendor/Package.22.mjs +0 -35
- package/vendor/Package.23.cjs +0 -37
- package/vendor/Package.23.mjs +0 -35
- package/vendor/Package.24.cjs +0 -37
- package/vendor/Package.24.mjs +0 -35
- package/vendor/Package.25.cjs +0 -37
- package/vendor/Package.25.mjs +0 -35
- package/vendor/Package.26.cjs +0 -37
- package/vendor/Package.26.mjs +0 -35
- package/vendor/Package.27.cjs +0 -37
- package/vendor/Package.27.mjs +0 -35
- package/vendor/Package.28.cjs +0 -37
- package/vendor/Package.28.mjs +0 -35
- package/vendor/Package.29.cjs +0 -40
- package/vendor/Package.29.mjs +0 -38
- package/vendor/Package.30.cjs +0 -41
- package/vendor/Package.30.mjs +0 -39
- package/vendor/Package.31.cjs +0 -72
- package/vendor/Package.31.mjs +0 -70
- package/vendor/Package.32.cjs +0 -37
- package/vendor/Package.32.mjs +0 -35
- package/vendor/Package.33.cjs +0 -37
- package/vendor/Package.33.mjs +0 -35
- package/vendor/Package.34.cjs +0 -46
- package/vendor/Package.34.mjs +0 -44
- package/vendor/Package.35.cjs +0 -34
- package/vendor/Package.35.mjs +0 -32
- package/vendor/Package.36.cjs +0 -40
- package/vendor/Package.36.mjs +0 -38
- package/vendor/Package.37.cjs +0 -36
- package/vendor/Package.37.mjs +0 -34
- package/vendor/Package.38.cjs +0 -52
- package/vendor/Package.38.mjs +0 -50
- package/vendor/Package.39.cjs +0 -41
- package/vendor/Package.39.mjs +0 -39
- package/vendor/Package.40.cjs +0 -42
- package/vendor/Package.40.mjs +0 -40
- package/vendor/Package.41.cjs +0 -53
- package/vendor/Package.41.mjs +0 -51
- package/vendor/Package.42.cjs +0 -53
- package/vendor/Package.42.mjs +0 -51
- package/vendor/Package.43.cjs +0 -40
- package/vendor/Package.43.mjs +0 -38
- package/vendor/Package.44.cjs +0 -46
- package/vendor/Package.44.mjs +0 -44
- package/vendor/Package.45.cjs +0 -53
- package/vendor/Package.45.mjs +0 -51
- package/vendor/Package.46.cjs +0 -59
- package/vendor/Package.46.mjs +0 -57
- package/vendor/Package.47.cjs +0 -65
- package/vendor/Package.47.mjs +0 -63
- package/vendor/Package.48.cjs +0 -38
- package/vendor/Package.48.mjs +0 -36
- package/vendor/Package.49.cjs +0 -38
- package/vendor/Package.49.mjs +0 -36
- package/vendor/Package.50.cjs +0 -36
- package/vendor/Package.50.mjs +0 -34
- package/vendor/Package.51.cjs +0 -43
- package/vendor/Package.51.mjs +0 -41
- package/vendor/Package.52.cjs +0 -37
- package/vendor/Package.52.mjs +0 -35
- package/vendor/Package.53.cjs +0 -43
- package/vendor/Package.53.mjs +0 -41
- package/vendor/Package.54.cjs +0 -55
- package/vendor/Package.54.mjs +0 -53
- package/vendor/Package.55.cjs +0 -37
- package/vendor/Package.55.mjs +0 -35
- package/vendor/Package.56.cjs +0 -37
- package/vendor/Package.56.mjs +0 -35
- package/vendor/Package.57.cjs +0 -37
- package/vendor/Package.57.mjs +0 -35
- package/vendor/Package.58.cjs +0 -45
- package/vendor/Package.58.mjs +0 -43
- package/vendor/Package.59.cjs +0 -53
- package/vendor/Package.59.mjs +0 -51
- package/vendor/Package.60.cjs +0 -47649
- package/vendor/Package.60.mjs +0 -47606
package/src/lib/helpers/Glob.cjs
CHANGED
|
@@ -20,11 +20,11 @@ const o = require("node:stream");
|
|
|
20
20
|
|
|
21
21
|
const h = require("node:string_decoder");
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const a = t => t && t.__esModule ? t : {
|
|
24
24
|
default: t
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
function
|
|
27
|
+
function l(t) {
|
|
28
28
|
if (t && t.__esModule) return t;
|
|
29
29
|
const e = Object.create(null, {
|
|
30
30
|
[Symbol.toStringTag]: {
|
|
@@ -46,14 +46,14 @@ function _interopNamespace(t) {
|
|
|
46
46
|
return Object.freeze(e);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
const
|
|
49
|
+
const c = l(i);
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const f = a(o);
|
|
52
52
|
|
|
53
|
-
const
|
|
54
|
-
const i = t instanceof RegExp ?
|
|
55
|
-
const n = e instanceof RegExp ?
|
|
56
|
-
const r = i !== null && n != null &&
|
|
53
|
+
const u = (t, e, s) => {
|
|
54
|
+
const i = t instanceof RegExp ? d(t, s) : t;
|
|
55
|
+
const n = e instanceof RegExp ? d(e, s) : e;
|
|
56
|
+
const r = i !== null && n != null && p(i, n, s);
|
|
57
57
|
return r && {
|
|
58
58
|
start: r[0],
|
|
59
59
|
end: r[1],
|
|
@@ -63,12 +63,12 @@ const balanced = (t, e, s) => {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const d = (t, e) => {
|
|
67
67
|
const s = e.match(t);
|
|
68
68
|
return s ? s[0] : null;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
const
|
|
71
|
+
const p = (t, e, s) => {
|
|
72
72
|
let i, n, r, o = undefined, h;
|
|
73
73
|
let a = s.indexOf(t);
|
|
74
74
|
let l = s.indexOf(e, a + 1);
|
|
@@ -103,61 +103,61 @@ const range = (t, e, s) => {
|
|
|
103
103
|
return h;
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
const
|
|
106
|
+
const g = "\0SLASH" + Math.random() + "\0";
|
|
107
107
|
|
|
108
|
-
const
|
|
108
|
+
const m = "\0OPEN" + Math.random() + "\0";
|
|
109
109
|
|
|
110
|
-
const
|
|
110
|
+
const w = "\0CLOSE" + Math.random() + "\0";
|
|
111
111
|
|
|
112
|
-
const
|
|
112
|
+
const y = "\0COMMA" + Math.random() + "\0";
|
|
113
113
|
|
|
114
|
-
const
|
|
114
|
+
const b = "\0PERIOD" + Math.random() + "\0";
|
|
115
115
|
|
|
116
|
-
const
|
|
116
|
+
const S = new RegExp(g, "g");
|
|
117
117
|
|
|
118
|
-
const
|
|
118
|
+
const k = new RegExp(m, "g");
|
|
119
119
|
|
|
120
|
-
const
|
|
120
|
+
const v = new RegExp(w, "g");
|
|
121
121
|
|
|
122
|
-
const
|
|
122
|
+
const x = new RegExp(y, "g");
|
|
123
123
|
|
|
124
|
-
const
|
|
124
|
+
const E = new RegExp(b, "g");
|
|
125
125
|
|
|
126
|
-
const
|
|
126
|
+
const C = /\\\\/g;
|
|
127
127
|
|
|
128
|
-
const
|
|
128
|
+
const T = /\\{/g;
|
|
129
129
|
|
|
130
|
-
const
|
|
130
|
+
const L = /\\}/g;
|
|
131
131
|
|
|
132
|
-
const
|
|
132
|
+
const A = /\\,/g;
|
|
133
133
|
|
|
134
|
-
const
|
|
134
|
+
const M = /\\./g;
|
|
135
135
|
|
|
136
|
-
function
|
|
136
|
+
function P(t) {
|
|
137
137
|
return !isNaN(t) ? parseInt(t, 10) : t.charCodeAt(0);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function
|
|
141
|
-
return t.replace(
|
|
140
|
+
function F(t) {
|
|
141
|
+
return t.replace(C, g).replace(T, m).replace(L, w).replace(A, y).replace(M, b);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function
|
|
145
|
-
return t.replace(
|
|
144
|
+
function R(t) {
|
|
145
|
+
return t.replace(S, "\\").replace(k, "{").replace(v, "}").replace(x, ",").replace(E, ".");
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
function
|
|
148
|
+
function O(t) {
|
|
149
149
|
if (!t) {
|
|
150
150
|
return [ "" ];
|
|
151
151
|
}
|
|
152
152
|
const e = [];
|
|
153
|
-
const s =
|
|
153
|
+
const s = u("{", "}", t);
|
|
154
154
|
if (!s) {
|
|
155
155
|
return t.split(",");
|
|
156
156
|
}
|
|
157
157
|
const {pre: i, body: n, post: r} = s;
|
|
158
158
|
const o = i.split(",");
|
|
159
159
|
o[o.length - 1] += "{" + n + "}";
|
|
160
|
-
const h =
|
|
160
|
+
const h = O(r);
|
|
161
161
|
if (r.length) {
|
|
162
162
|
o[o.length - 1] += h.shift();
|
|
163
163
|
o.push.apply(o, h);
|
|
@@ -166,38 +166,38 @@ function parseCommaParts(t) {
|
|
|
166
166
|
return e;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
function
|
|
169
|
+
function z(t) {
|
|
170
170
|
if (!t) {
|
|
171
171
|
return [];
|
|
172
172
|
}
|
|
173
173
|
if (t.slice(0, 2) === "{}") {
|
|
174
174
|
t = "\\{\\}" + t.slice(2);
|
|
175
175
|
}
|
|
176
|
-
return
|
|
176
|
+
return I(F(t), true).map(R);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
function
|
|
179
|
+
function D(t) {
|
|
180
180
|
return "{" + t + "}";
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function
|
|
183
|
+
function N(t) {
|
|
184
184
|
return /^-?0\d/.test(t);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
function
|
|
187
|
+
function B(t, e) {
|
|
188
188
|
return t <= e;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
function
|
|
191
|
+
function W(t, e) {
|
|
192
192
|
return t >= e;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
function
|
|
195
|
+
function I(t, e) {
|
|
196
196
|
const s = [];
|
|
197
|
-
const i =
|
|
197
|
+
const i = u("{", "}", t);
|
|
198
198
|
if (!i) return [ t ];
|
|
199
199
|
const n = i.pre;
|
|
200
|
-
const r = i.post.length ?
|
|
200
|
+
const r = i.post.length ? I(i.post, false) : [ "" ];
|
|
201
201
|
if (/\$$/.test(i.pre)) {
|
|
202
202
|
for (let t = 0; t < r.length; t++) {
|
|
203
203
|
const e = n + "{" + i.body + "}" + r[t];
|
|
@@ -210,8 +210,8 @@ function expand_(t, e) {
|
|
|
210
210
|
const l = i.body.indexOf(",") >= 0;
|
|
211
211
|
if (!a && !l) {
|
|
212
212
|
if (i.post.match(/,(?!,).*\}/)) {
|
|
213
|
-
t = i.pre + "{" + i.body +
|
|
214
|
-
return
|
|
213
|
+
t = i.pre + "{" + i.body + w + i.post;
|
|
214
|
+
return I(t);
|
|
215
215
|
}
|
|
216
216
|
return [ t ];
|
|
217
217
|
}
|
|
@@ -219,9 +219,9 @@ function expand_(t, e) {
|
|
|
219
219
|
if (a) {
|
|
220
220
|
c = i.body.split(/\.\./);
|
|
221
221
|
} else {
|
|
222
|
-
c =
|
|
222
|
+
c = O(i.body);
|
|
223
223
|
if (c.length === 1 && c[0] !== undefined) {
|
|
224
|
-
c =
|
|
224
|
+
c = I(c[0], false).map(D);
|
|
225
225
|
if (c.length === 1) {
|
|
226
226
|
return r.map((t => i.pre + c[0] + t));
|
|
227
227
|
}
|
|
@@ -229,17 +229,17 @@ function expand_(t, e) {
|
|
|
229
229
|
}
|
|
230
230
|
let f;
|
|
231
231
|
if (a && c[0] !== undefined && c[1] !== undefined) {
|
|
232
|
-
const t =
|
|
233
|
-
const e =
|
|
232
|
+
const t = P(c[0]);
|
|
233
|
+
const e = P(c[1]);
|
|
234
234
|
const s = Math.max(c[0].length, c[1].length);
|
|
235
|
-
let i = c.length === 3 && c[2] !== undefined ? Math.abs(
|
|
236
|
-
let n =
|
|
235
|
+
let i = c.length === 3 && c[2] !== undefined ? Math.abs(P(c[2])) : 1;
|
|
236
|
+
let n = B;
|
|
237
237
|
const r = e < t;
|
|
238
238
|
if (r) {
|
|
239
239
|
i *= -1;
|
|
240
|
-
n =
|
|
240
|
+
n = W;
|
|
241
241
|
}
|
|
242
|
-
const o = c.some(
|
|
242
|
+
const o = c.some(N);
|
|
243
243
|
f = [];
|
|
244
244
|
for (let r = t; n(r, e); r += i) {
|
|
245
245
|
let t;
|
|
@@ -267,7 +267,7 @@ function expand_(t, e) {
|
|
|
267
267
|
} else {
|
|
268
268
|
f = [];
|
|
269
269
|
for (let t = 0; t < c.length; t++) {
|
|
270
|
-
f.push.apply(f,
|
|
270
|
+
f.push.apply(f, I(c[t], false));
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
for (let t = 0; t < f.length; t++) {
|
|
@@ -282,18 +282,18 @@ function expand_(t, e) {
|
|
|
282
282
|
return s;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
const
|
|
285
|
+
const _ = 1024 * 64;
|
|
286
286
|
|
|
287
|
-
const
|
|
287
|
+
const j = t => {
|
|
288
288
|
if (typeof t !== "string") {
|
|
289
289
|
throw new TypeError("invalid pattern");
|
|
290
290
|
}
|
|
291
|
-
if (t.length >
|
|
291
|
+
if (t.length > _) {
|
|
292
292
|
throw new TypeError("pattern is too long");
|
|
293
293
|
}
|
|
294
294
|
};
|
|
295
295
|
|
|
296
|
-
const
|
|
296
|
+
const $ = {
|
|
297
297
|
"[:alnum:]": [ "\\p{L}\\p{Nl}\\p{Nd}", true ],
|
|
298
298
|
"[:alpha:]": [ "\\p{L}\\p{Nl}", true ],
|
|
299
299
|
"[:ascii:]": [ "\\x" + "00-\\x" + "7f", false ],
|
|
@@ -310,13 +310,13 @@ const L = {
|
|
|
310
310
|
"[:xdigit:]": [ "A-Fa-f0-9", false ]
|
|
311
311
|
};
|
|
312
312
|
|
|
313
|
-
const
|
|
313
|
+
const U = t => t.replace(/[[\]\\-]/g, "\\$&");
|
|
314
314
|
|
|
315
|
-
const
|
|
315
|
+
const G = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
316
316
|
|
|
317
|
-
const
|
|
317
|
+
const q = t => t.join("");
|
|
318
318
|
|
|
319
|
-
const
|
|
319
|
+
const H = (t, e) => {
|
|
320
320
|
const s = e;
|
|
321
321
|
if (t.charAt(s) !== "[") {
|
|
322
322
|
throw new Error("not in a brace expression");
|
|
@@ -350,7 +350,7 @@ const parseClass = (t, e) => {
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
if (e === "[" && !a) {
|
|
353
|
-
for (const [e, [o, a, l]] of Object.entries(
|
|
353
|
+
for (const [e, [o, a, l]] of Object.entries($)) {
|
|
354
354
|
if (t.startsWith(e, r)) {
|
|
355
355
|
if (f) {
|
|
356
356
|
return [ "$.", false, t.length - s, true ];
|
|
@@ -365,16 +365,16 @@ const parseClass = (t, e) => {
|
|
|
365
365
|
a = false;
|
|
366
366
|
if (f) {
|
|
367
367
|
if (e > f) {
|
|
368
|
-
i.push(
|
|
368
|
+
i.push(U(f) + "-" + U(e));
|
|
369
369
|
} else if (e === f) {
|
|
370
|
-
i.push(
|
|
370
|
+
i.push(U(e));
|
|
371
371
|
}
|
|
372
372
|
f = "";
|
|
373
373
|
r++;
|
|
374
374
|
continue;
|
|
375
375
|
}
|
|
376
376
|
if (t.startsWith("-]", r + 1)) {
|
|
377
|
-
i.push(
|
|
377
|
+
i.push(U(e + "-"));
|
|
378
378
|
r += 2;
|
|
379
379
|
continue;
|
|
380
380
|
}
|
|
@@ -383,7 +383,7 @@ const parseClass = (t, e) => {
|
|
|
383
383
|
r += 2;
|
|
384
384
|
continue;
|
|
385
385
|
}
|
|
386
|
-
i.push(
|
|
386
|
+
i.push(U(e));
|
|
387
387
|
r++;
|
|
388
388
|
}
|
|
389
389
|
if (c < r) {
|
|
@@ -394,42 +394,42 @@ const parseClass = (t, e) => {
|
|
|
394
394
|
}
|
|
395
395
|
if (n.length === 0 && i.length === 1 && /^\\?.$/.test(i[0]) && !l) {
|
|
396
396
|
const t = i[0].length === 2 ? i[0].slice(-1) : i[0];
|
|
397
|
-
return [
|
|
397
|
+
return [ G(t), false, c - s, false ];
|
|
398
398
|
}
|
|
399
|
-
const u = "[" + (l ? "^" : "") +
|
|
400
|
-
const d = "[" + (l ? "" : "^") +
|
|
399
|
+
const u = "[" + (l ? "^" : "") + q(i) + "]";
|
|
400
|
+
const d = "[" + (l ? "" : "^") + q(n) + "]";
|
|
401
401
|
const p = i.length && n.length ? "(" + u + "|" + d + ")" : i.length ? u : d;
|
|
402
402
|
return [ p, h, c - s, true ];
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
-
const
|
|
405
|
+
const Z = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = true} = {}) => {
|
|
406
406
|
if (s) {
|
|
407
407
|
return e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
408
408
|
}
|
|
409
409
|
return e ? t.replace(/\[([^\/\\{}])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
410
410
|
};
|
|
411
411
|
|
|
412
|
-
const
|
|
412
|
+
const V = new Set([ "!", "?", "+", "*", "@" ]);
|
|
413
413
|
|
|
414
|
-
const
|
|
414
|
+
const J = t => V.has(t);
|
|
415
415
|
|
|
416
|
-
const
|
|
416
|
+
const K = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
417
417
|
|
|
418
|
-
const
|
|
418
|
+
const Y = "(?!\\.)";
|
|
419
419
|
|
|
420
|
-
const
|
|
420
|
+
const X = new Set([ "[", "." ]);
|
|
421
421
|
|
|
422
|
-
const
|
|
422
|
+
const Q = new Set([ "..", "." ]);
|
|
423
423
|
|
|
424
|
-
const
|
|
424
|
+
const tt = new Set("().*{}+?[]^$\\!");
|
|
425
425
|
|
|
426
|
-
const
|
|
426
|
+
const et = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
427
427
|
|
|
428
|
-
const
|
|
428
|
+
const st = "[^/]";
|
|
429
429
|
|
|
430
|
-
const
|
|
430
|
+
const it = st + "*?";
|
|
431
431
|
|
|
432
|
-
const
|
|
432
|
+
const nt = st + "+?";
|
|
433
433
|
|
|
434
434
|
class AST {
|
|
435
435
|
type;
|
|
@@ -575,7 +575,7 @@ class AST {
|
|
|
575
575
|
l += s;
|
|
576
576
|
continue;
|
|
577
577
|
}
|
|
578
|
-
if (!i.noext &&
|
|
578
|
+
if (!i.noext && J(s) && t.charAt(a) === "(") {
|
|
579
579
|
e.push(l);
|
|
580
580
|
l = "";
|
|
581
581
|
const n = new AST(s, e);
|
|
@@ -616,7 +616,7 @@ class AST {
|
|
|
616
616
|
f += s;
|
|
617
617
|
continue;
|
|
618
618
|
}
|
|
619
|
-
if (
|
|
619
|
+
if (J(s) && t.charAt(a) === "(") {
|
|
620
620
|
l.push(f);
|
|
621
621
|
f = "";
|
|
622
622
|
const e = new AST(s, l);
|
|
@@ -683,12 +683,12 @@ class AST {
|
|
|
683
683
|
let n = "";
|
|
684
684
|
if (this.isStart()) {
|
|
685
685
|
if (typeof this.#i[0] === "string") {
|
|
686
|
-
const s = this.#i.length === 1 &&
|
|
686
|
+
const s = this.#i.length === 1 && Q.has(this.#i[0]);
|
|
687
687
|
if (!s) {
|
|
688
|
-
const s =
|
|
688
|
+
const s = X;
|
|
689
689
|
const r = e && s.has(i.charAt(0)) || i.startsWith("\\.") && s.has(i.charAt(2)) || i.startsWith("\\.\\.") && s.has(i.charAt(4));
|
|
690
690
|
const o = !e && !t && s.has(i.charAt(0));
|
|
691
|
-
n = r ?
|
|
691
|
+
n = r ? K : o ? Y : "";
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
@@ -697,7 +697,7 @@ class AST {
|
|
|
697
697
|
r = "(?:$|\\/)";
|
|
698
698
|
}
|
|
699
699
|
const o = n + i + r;
|
|
700
|
-
return [ o,
|
|
700
|
+
return [ o, Z(i), this.#e = !!this.#e, this.#s ];
|
|
701
701
|
}
|
|
702
702
|
const s = this.type === "*" || this.type === "+";
|
|
703
703
|
const i = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
@@ -707,9 +707,9 @@ class AST {
|
|
|
707
707
|
this.#i = [ t ];
|
|
708
708
|
this.type = null;
|
|
709
709
|
this.#e = undefined;
|
|
710
|
-
return [ t,
|
|
710
|
+
return [ t, Z(this.toString()), false, false ];
|
|
711
711
|
}
|
|
712
|
-
let r = !s || t || e || !
|
|
712
|
+
let r = !s || t || e || !Y ? "" : this.#p(true);
|
|
713
713
|
if (r === n) {
|
|
714
714
|
r = "";
|
|
715
715
|
}
|
|
@@ -718,12 +718,12 @@ class AST {
|
|
|
718
718
|
}
|
|
719
719
|
let o = "";
|
|
720
720
|
if (this.type === "!" && this.#c) {
|
|
721
|
-
o = (this.isStart() && !e ?
|
|
721
|
+
o = (this.isStart() && !e ? Y : "") + nt;
|
|
722
722
|
} else {
|
|
723
|
-
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ?
|
|
723
|
+
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ? Y : "") + it + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && r ? ")" : this.type === "*" && r ? `)?` : `)${this.type}`;
|
|
724
724
|
o = i + n + s;
|
|
725
725
|
}
|
|
726
|
-
return [ o,
|
|
726
|
+
return [ o, Z(n), this.#e = !!this.#e, this.#s ];
|
|
727
727
|
}
|
|
728
728
|
#p(t) {
|
|
729
729
|
return this.#i.map((e => {
|
|
@@ -743,7 +743,7 @@ class AST {
|
|
|
743
743
|
const h = t.charAt(o);
|
|
744
744
|
if (i) {
|
|
745
745
|
i = false;
|
|
746
|
-
n += (
|
|
746
|
+
n += (tt.has(h) ? "\\" : "") + h;
|
|
747
747
|
continue;
|
|
748
748
|
}
|
|
749
749
|
if (h === "\\") {
|
|
@@ -755,7 +755,7 @@ class AST {
|
|
|
755
755
|
continue;
|
|
756
756
|
}
|
|
757
757
|
if (h === "[") {
|
|
758
|
-
const [s, i, h, a] =
|
|
758
|
+
const [s, i, h, a] = H(t, o);
|
|
759
759
|
if (h) {
|
|
760
760
|
n += s;
|
|
761
761
|
r = r || i;
|
|
@@ -765,107 +765,107 @@ class AST {
|
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
if (h === "*") {
|
|
768
|
-
n += s && t === "*" ?
|
|
768
|
+
n += s && t === "*" ? nt : it;
|
|
769
769
|
e = true;
|
|
770
770
|
continue;
|
|
771
771
|
}
|
|
772
772
|
if (h === "?") {
|
|
773
|
-
n +=
|
|
773
|
+
n += st;
|
|
774
774
|
e = true;
|
|
775
775
|
continue;
|
|
776
776
|
}
|
|
777
|
-
n +=
|
|
777
|
+
n += et(h);
|
|
778
778
|
}
|
|
779
|
-
return [ n,
|
|
779
|
+
return [ n, Z(t), !!e, r ];
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
const
|
|
783
|
+
const rt = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = false} = {}) => {
|
|
784
784
|
if (s) {
|
|
785
785
|
return e ? t.replace(/[?*()[\]{}]/g, "[$&]") : t.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
786
786
|
}
|
|
787
787
|
return e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&");
|
|
788
788
|
};
|
|
789
789
|
|
|
790
|
-
const
|
|
791
|
-
|
|
790
|
+
const ot = (t, e, s = {}) => {
|
|
791
|
+
j(e);
|
|
792
792
|
if (!s.nocomment && e.charAt(0) === "#") {
|
|
793
793
|
return false;
|
|
794
794
|
}
|
|
795
795
|
return new Minimatch(e, s).match(t);
|
|
796
796
|
};
|
|
797
797
|
|
|
798
|
-
const
|
|
798
|
+
const ht = /^\*+([^+@!?\*\[\(]*)$/;
|
|
799
799
|
|
|
800
|
-
const
|
|
800
|
+
const at = t => e => !e.startsWith(".") && e.endsWith(t);
|
|
801
801
|
|
|
802
|
-
const
|
|
802
|
+
const lt = t => e => e.endsWith(t);
|
|
803
803
|
|
|
804
|
-
const
|
|
804
|
+
const ct = t => {
|
|
805
805
|
t = t.toLowerCase();
|
|
806
806
|
return e => !e.startsWith(".") && e.toLowerCase().endsWith(t);
|
|
807
807
|
};
|
|
808
808
|
|
|
809
|
-
const
|
|
809
|
+
const ft = t => {
|
|
810
810
|
t = t.toLowerCase();
|
|
811
811
|
return e => e.toLowerCase().endsWith(t);
|
|
812
812
|
};
|
|
813
813
|
|
|
814
|
-
const
|
|
814
|
+
const ut = /^\*+\.\*+$/;
|
|
815
815
|
|
|
816
|
-
const
|
|
816
|
+
const dt = t => !t.startsWith(".") && t.includes(".");
|
|
817
817
|
|
|
818
|
-
const
|
|
818
|
+
const pt = t => t !== "." && t !== ".." && t.includes(".");
|
|
819
819
|
|
|
820
|
-
const
|
|
820
|
+
const gt = /^\.\*+$/;
|
|
821
821
|
|
|
822
|
-
const
|
|
822
|
+
const mt = t => t !== "." && t !== ".." && t.startsWith(".");
|
|
823
823
|
|
|
824
|
-
const
|
|
824
|
+
const wt = /^\*+$/;
|
|
825
825
|
|
|
826
|
-
const
|
|
826
|
+
const yt = t => t.length !== 0 && !t.startsWith(".");
|
|
827
827
|
|
|
828
|
-
const
|
|
828
|
+
const bt = t => t.length !== 0 && t !== "." && t !== "..";
|
|
829
829
|
|
|
830
|
-
const
|
|
830
|
+
const St = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
831
831
|
|
|
832
|
-
const
|
|
833
|
-
const s =
|
|
832
|
+
const kt = ([t, e = ""]) => {
|
|
833
|
+
const s = Ct([ t ]);
|
|
834
834
|
if (!e) return s;
|
|
835
835
|
e = e.toLowerCase();
|
|
836
836
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
837
837
|
};
|
|
838
838
|
|
|
839
|
-
const
|
|
840
|
-
const s =
|
|
839
|
+
const vt = ([t, e = ""]) => {
|
|
840
|
+
const s = Tt([ t ]);
|
|
841
841
|
if (!e) return s;
|
|
842
842
|
e = e.toLowerCase();
|
|
843
843
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
844
844
|
};
|
|
845
845
|
|
|
846
|
-
const
|
|
847
|
-
const s =
|
|
846
|
+
const xt = ([t, e = ""]) => {
|
|
847
|
+
const s = Tt([ t ]);
|
|
848
848
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
849
849
|
};
|
|
850
850
|
|
|
851
|
-
const
|
|
852
|
-
const s =
|
|
851
|
+
const Et = ([t, e = ""]) => {
|
|
852
|
+
const s = Ct([ t ]);
|
|
853
853
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
854
854
|
};
|
|
855
855
|
|
|
856
|
-
const
|
|
856
|
+
const Ct = ([t]) => {
|
|
857
857
|
const e = t.length;
|
|
858
858
|
return t => t.length === e && !t.startsWith(".");
|
|
859
859
|
};
|
|
860
860
|
|
|
861
|
-
const
|
|
861
|
+
const Tt = ([t]) => {
|
|
862
862
|
const e = t.length;
|
|
863
863
|
return t => t.length === e && t !== "." && t !== "..";
|
|
864
864
|
};
|
|
865
865
|
|
|
866
|
-
const
|
|
866
|
+
const Lt = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
867
867
|
|
|
868
|
-
const
|
|
868
|
+
const At = {
|
|
869
869
|
win32: {
|
|
870
870
|
sep: "\\"
|
|
871
871
|
},
|
|
@@ -874,80 +874,80 @@ const G = {
|
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
876
|
|
|
877
|
-
const
|
|
877
|
+
const Mt = Lt === "win32" ? At.win32.sep : At.posix.sep;
|
|
878
878
|
|
|
879
|
-
|
|
879
|
+
ot.sep = Mt;
|
|
880
880
|
|
|
881
|
-
const
|
|
881
|
+
const Pt = Symbol("globstar **");
|
|
882
882
|
|
|
883
|
-
|
|
883
|
+
ot.GLOBSTAR = Pt;
|
|
884
884
|
|
|
885
|
-
const
|
|
885
|
+
const Ft = "[^/]";
|
|
886
886
|
|
|
887
|
-
const
|
|
887
|
+
const Rt = Ft + "*?";
|
|
888
888
|
|
|
889
|
-
const
|
|
889
|
+
const Ot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
890
890
|
|
|
891
|
-
const
|
|
891
|
+
const zt = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
892
892
|
|
|
893
|
-
const
|
|
893
|
+
const Dt = (t, e = {}) => s => ot(s, t, e);
|
|
894
894
|
|
|
895
|
-
|
|
895
|
+
ot.filter = Dt;
|
|
896
896
|
|
|
897
|
-
const
|
|
897
|
+
const Nt = (t, e = {}) => Object.assign({}, t, e);
|
|
898
898
|
|
|
899
|
-
const
|
|
899
|
+
const Bt = t => {
|
|
900
900
|
if (!t || typeof t !== "object" || !Object.keys(t).length) {
|
|
901
|
-
return
|
|
901
|
+
return ot;
|
|
902
902
|
}
|
|
903
|
-
const e =
|
|
904
|
-
const
|
|
905
|
-
return Object.assign(
|
|
903
|
+
const e = ot;
|
|
904
|
+
const s = (s, i, n = {}) => e(s, i, Nt(t, n));
|
|
905
|
+
return Object.assign(s, {
|
|
906
906
|
Minimatch: class Minimatch extends e.Minimatch {
|
|
907
907
|
constructor(e, s = {}) {
|
|
908
|
-
super(e,
|
|
908
|
+
super(e, Nt(t, s));
|
|
909
909
|
}
|
|
910
910
|
static defaults(s) {
|
|
911
|
-
return e.defaults(
|
|
911
|
+
return e.defaults(Nt(t, s)).Minimatch;
|
|
912
912
|
}
|
|
913
913
|
},
|
|
914
914
|
AST: class AST extends e.AST {
|
|
915
915
|
constructor(e, s, i = {}) {
|
|
916
|
-
super(e, s,
|
|
916
|
+
super(e, s, Nt(t, i));
|
|
917
917
|
}
|
|
918
918
|
static fromGlob(s, i = {}) {
|
|
919
|
-
return e.AST.fromGlob(s,
|
|
919
|
+
return e.AST.fromGlob(s, Nt(t, i));
|
|
920
920
|
}
|
|
921
921
|
},
|
|
922
|
-
unescape: (s, i = {}) => e.unescape(s,
|
|
923
|
-
escape: (s, i = {}) => e.escape(s,
|
|
924
|
-
filter: (s, i = {}) => e.filter(s,
|
|
925
|
-
defaults: s => e.defaults(
|
|
926
|
-
makeRe: (s, i = {}) => e.makeRe(s,
|
|
927
|
-
braceExpand: (s, i = {}) => e.braceExpand(s,
|
|
928
|
-
match: (s, i, n = {}) => e.match(s, i,
|
|
922
|
+
unescape: (s, i = {}) => e.unescape(s, Nt(t, i)),
|
|
923
|
+
escape: (s, i = {}) => e.escape(s, Nt(t, i)),
|
|
924
|
+
filter: (s, i = {}) => e.filter(s, Nt(t, i)),
|
|
925
|
+
defaults: s => e.defaults(Nt(t, s)),
|
|
926
|
+
makeRe: (s, i = {}) => e.makeRe(s, Nt(t, i)),
|
|
927
|
+
braceExpand: (s, i = {}) => e.braceExpand(s, Nt(t, i)),
|
|
928
|
+
match: (s, i, n = {}) => e.match(s, i, Nt(t, n)),
|
|
929
929
|
sep: e.sep,
|
|
930
|
-
GLOBSTAR:
|
|
930
|
+
GLOBSTAR: Pt
|
|
931
931
|
});
|
|
932
932
|
};
|
|
933
933
|
|
|
934
|
-
|
|
934
|
+
ot.defaults = Bt;
|
|
935
935
|
|
|
936
|
-
const
|
|
937
|
-
|
|
936
|
+
const Wt = (t, e = {}) => {
|
|
937
|
+
j(t);
|
|
938
938
|
if (e.nobrace || !/\{(?:(?!\{).)*\}/.test(t)) {
|
|
939
939
|
return [ t ];
|
|
940
940
|
}
|
|
941
|
-
return
|
|
941
|
+
return z(t);
|
|
942
942
|
};
|
|
943
943
|
|
|
944
|
-
|
|
944
|
+
ot.braceExpand = Wt;
|
|
945
945
|
|
|
946
|
-
const
|
|
946
|
+
const It = (t, e = {}) => new Minimatch(t, e).makeRe();
|
|
947
947
|
|
|
948
|
-
|
|
948
|
+
ot.makeRe = It;
|
|
949
949
|
|
|
950
|
-
const
|
|
950
|
+
const _t = (t, e, s = {}) => {
|
|
951
951
|
const i = new Minimatch(e, s);
|
|
952
952
|
t = t.filter((t => i.match(t)));
|
|
953
953
|
if (i.options.nonull && !t.length) {
|
|
@@ -956,11 +956,11 @@ const match = (t, e, s = {}) => {
|
|
|
956
956
|
return t;
|
|
957
957
|
};
|
|
958
958
|
|
|
959
|
-
|
|
959
|
+
ot.match = _t;
|
|
960
960
|
|
|
961
|
-
const
|
|
961
|
+
const jt = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
962
962
|
|
|
963
|
-
const
|
|
963
|
+
const $t = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
964
964
|
|
|
965
965
|
class Minimatch {
|
|
966
966
|
options;
|
|
@@ -981,11 +981,11 @@ class Minimatch {
|
|
|
981
981
|
windowsNoMagicRoot;
|
|
982
982
|
regexp;
|
|
983
983
|
constructor(t, e = {}) {
|
|
984
|
-
|
|
984
|
+
j(t);
|
|
985
985
|
e = e || {};
|
|
986
986
|
this.options = e;
|
|
987
987
|
this.pattern = t;
|
|
988
|
-
this.platform = e.platform ||
|
|
988
|
+
this.platform = e.platform || Lt;
|
|
989
989
|
this.isWindows = this.platform === "win32";
|
|
990
990
|
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false;
|
|
991
991
|
if (this.windowsPathsNoEscape) {
|
|
@@ -1039,7 +1039,7 @@ class Minimatch {
|
|
|
1039
1039
|
this.debug(this.pattern, this.globParts);
|
|
1040
1040
|
let i = this.globParts.map(((t, e, s) => {
|
|
1041
1041
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1042
|
-
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !
|
|
1042
|
+
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !jt.test(t[2])) && !jt.test(t[3]);
|
|
1043
1043
|
const s = /^[a-z]:/i.test(t[0]);
|
|
1044
1044
|
if (e) {
|
|
1045
1045
|
return [ ...t.slice(0, 4), ...t.slice(4).map((t => this.parse(t))) ];
|
|
@@ -1306,7 +1306,7 @@ class Minimatch {
|
|
|
1306
1306
|
if (l === false) {
|
|
1307
1307
|
return false;
|
|
1308
1308
|
}
|
|
1309
|
-
if (l ===
|
|
1309
|
+
if (l === Pt) {
|
|
1310
1310
|
this.debug("GLOBSTAR", [ e, l, c ]);
|
|
1311
1311
|
var f = r;
|
|
1312
1312
|
var u = o + 1;
|
|
@@ -1361,25 +1361,25 @@ class Minimatch {
|
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
1363
|
braceExpand() {
|
|
1364
|
-
return
|
|
1364
|
+
return Wt(this.pattern, this.options);
|
|
1365
1365
|
}
|
|
1366
1366
|
parse(t) {
|
|
1367
|
-
|
|
1367
|
+
j(t);
|
|
1368
1368
|
const e = this.options;
|
|
1369
|
-
if (t === "**") return
|
|
1369
|
+
if (t === "**") return Pt;
|
|
1370
1370
|
if (t === "") return "";
|
|
1371
1371
|
let s;
|
|
1372
1372
|
let i = null;
|
|
1373
|
-
if (s = t.match(
|
|
1374
|
-
i = e.dot ?
|
|
1375
|
-
} else if (s = t.match(
|
|
1376
|
-
i = (e.nocase ? e.dot ?
|
|
1377
|
-
} else if (s = t.match(
|
|
1378
|
-
i = (e.nocase ? e.dot ?
|
|
1379
|
-
} else if (s = t.match(
|
|
1380
|
-
i = e.dot ?
|
|
1381
|
-
} else if (s = t.match(
|
|
1382
|
-
i =
|
|
1373
|
+
if (s = t.match(wt)) {
|
|
1374
|
+
i = e.dot ? bt : yt;
|
|
1375
|
+
} else if (s = t.match(ht)) {
|
|
1376
|
+
i = (e.nocase ? e.dot ? ft : ct : e.dot ? lt : at)(s[1]);
|
|
1377
|
+
} else if (s = t.match(St)) {
|
|
1378
|
+
i = (e.nocase ? e.dot ? vt : kt : e.dot ? xt : Et)(s);
|
|
1379
|
+
} else if (s = t.match(ut)) {
|
|
1380
|
+
i = e.dot ? pt : dt;
|
|
1381
|
+
} else if (s = t.match(gt)) {
|
|
1382
|
+
i = mt;
|
|
1383
1383
|
}
|
|
1384
1384
|
const n = AST.fromGlob(t, this.options).toMMPattern();
|
|
1385
1385
|
if (i && typeof n === "object") {
|
|
@@ -1397,35 +1397,35 @@ class Minimatch {
|
|
|
1397
1397
|
return this.regexp;
|
|
1398
1398
|
}
|
|
1399
1399
|
const e = this.options;
|
|
1400
|
-
const s = e.noglobstar ?
|
|
1400
|
+
const s = e.noglobstar ? Rt : e.dot ? Ot : zt;
|
|
1401
1401
|
const i = new Set(e.nocase ? [ "i" ] : []);
|
|
1402
1402
|
let n = t.map((t => {
|
|
1403
1403
|
const e = t.map((t => {
|
|
1404
1404
|
if (t instanceof RegExp) {
|
|
1405
1405
|
for (const e of t.flags.split("")) i.add(e);
|
|
1406
1406
|
}
|
|
1407
|
-
return typeof t === "string" ?
|
|
1407
|
+
return typeof t === "string" ? $t(t) : t === Pt ? Pt : t._src;
|
|
1408
1408
|
}));
|
|
1409
1409
|
e.forEach(((t, i) => {
|
|
1410
1410
|
const n = e[i + 1];
|
|
1411
1411
|
const r = e[i - 1];
|
|
1412
|
-
if (t !==
|
|
1412
|
+
if (t !== Pt || r === Pt) {
|
|
1413
1413
|
return;
|
|
1414
1414
|
}
|
|
1415
1415
|
if (r === undefined) {
|
|
1416
|
-
if (n !== undefined && n !==
|
|
1416
|
+
if (n !== undefined && n !== Pt) {
|
|
1417
1417
|
e[i + 1] = "(?:\\/|" + s + "\\/)?" + n;
|
|
1418
1418
|
} else {
|
|
1419
1419
|
e[i] = s;
|
|
1420
1420
|
}
|
|
1421
1421
|
} else if (n === undefined) {
|
|
1422
1422
|
e[i - 1] = r + "(?:\\/|\\/" + s + ")?";
|
|
1423
|
-
} else if (n !==
|
|
1423
|
+
} else if (n !== Pt) {
|
|
1424
1424
|
e[i - 1] = r + "(?:\\/|\\/" + s + "\\/)" + n;
|
|
1425
|
-
e[i + 1] =
|
|
1425
|
+
e[i + 1] = Pt;
|
|
1426
1426
|
}
|
|
1427
1427
|
}));
|
|
1428
|
-
const n = e.filter((t => t !==
|
|
1428
|
+
const n = e.filter((t => t !== Pt));
|
|
1429
1429
|
if (this.partial && n.length >= 1) {
|
|
1430
1430
|
const t = [];
|
|
1431
1431
|
for (let e = 1; e <= n.length; e++) {
|
|
@@ -1502,34 +1502,34 @@ class Minimatch {
|
|
|
1502
1502
|
return this.negate;
|
|
1503
1503
|
}
|
|
1504
1504
|
static defaults(t) {
|
|
1505
|
-
return
|
|
1505
|
+
return ot.defaults(t).Minimatch;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
|
-
|
|
1509
|
+
ot.AST = AST;
|
|
1510
1510
|
|
|
1511
|
-
|
|
1511
|
+
ot.Minimatch = Minimatch;
|
|
1512
1512
|
|
|
1513
|
-
|
|
1513
|
+
ot.escape = rt;
|
|
1514
1514
|
|
|
1515
|
-
|
|
1515
|
+
ot.unescape = Z;
|
|
1516
1516
|
|
|
1517
|
-
const
|
|
1517
|
+
const Ut = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
1518
1518
|
|
|
1519
|
-
const
|
|
1519
|
+
const Gt = new Set;
|
|
1520
1520
|
|
|
1521
|
-
const
|
|
1521
|
+
const qt = typeof process === "object" && !!process ? process : {};
|
|
1522
1522
|
|
|
1523
|
-
const
|
|
1524
|
-
typeof
|
|
1523
|
+
const Ht = (t, e, s, i) => {
|
|
1524
|
+
typeof qt.emitWarning === "function" ? qt.emitWarning(t, e, s, i) : console.error(`[${s}] ${e}: ${t}`);
|
|
1525
1525
|
};
|
|
1526
1526
|
|
|
1527
|
-
let
|
|
1527
|
+
let Zt = globalThis.AbortController;
|
|
1528
1528
|
|
|
1529
|
-
let
|
|
1529
|
+
let Vt = globalThis.AbortSignal;
|
|
1530
1530
|
|
|
1531
|
-
if (typeof
|
|
1532
|
-
|
|
1531
|
+
if (typeof Zt === "undefined") {
|
|
1532
|
+
Vt = class AbortSignal {
|
|
1533
1533
|
onabort;
|
|
1534
1534
|
_onabort=[];
|
|
1535
1535
|
reason;
|
|
@@ -1538,11 +1538,11 @@ if (typeof tt === "undefined") {
|
|
|
1538
1538
|
this._onabort.push(e);
|
|
1539
1539
|
}
|
|
1540
1540
|
};
|
|
1541
|
-
|
|
1541
|
+
Zt = class AbortController {
|
|
1542
1542
|
constructor() {
|
|
1543
|
-
|
|
1543
|
+
e();
|
|
1544
1544
|
}
|
|
1545
|
-
signal=new
|
|
1545
|
+
signal=new Vt;
|
|
1546
1546
|
abort(t) {
|
|
1547
1547
|
if (this.signal.aborted) return;
|
|
1548
1548
|
this.signal.reason = t;
|
|
@@ -1553,21 +1553,21 @@ if (typeof tt === "undefined") {
|
|
|
1553
1553
|
this.signal.onabort?.(t);
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
|
-
let t =
|
|
1557
|
-
const
|
|
1556
|
+
let t = qt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1557
|
+
const e = () => {
|
|
1558
1558
|
if (!t) return;
|
|
1559
1559
|
t = false;
|
|
1560
|
-
|
|
1560
|
+
Ht("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", e);
|
|
1561
1561
|
};
|
|
1562
1562
|
}
|
|
1563
1563
|
|
|
1564
|
-
const
|
|
1564
|
+
const Jt = t => !Gt.has(t);
|
|
1565
1565
|
|
|
1566
|
-
const
|
|
1566
|
+
const Kt = Symbol("type");
|
|
1567
1567
|
|
|
1568
|
-
const
|
|
1568
|
+
const Yt = t => t && t === Math.floor(t) && t > 0 && isFinite(t);
|
|
1569
1569
|
|
|
1570
|
-
const
|
|
1570
|
+
const Xt = t => !Yt(t) ? null : t <= Math.pow(2, 8) ? Uint8Array : t <= Math.pow(2, 16) ? Uint16Array : t <= Math.pow(2, 32) ? Uint32Array : t <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
|
|
1571
1571
|
|
|
1572
1572
|
class ZeroArray extends Array {
|
|
1573
1573
|
constructor(t) {
|
|
@@ -1581,7 +1581,7 @@ class Stack {
|
|
|
1581
1581
|
length;
|
|
1582
1582
|
static #g=false;
|
|
1583
1583
|
static create(t) {
|
|
1584
|
-
const e =
|
|
1584
|
+
const e = Xt(t);
|
|
1585
1585
|
if (!e) return [];
|
|
1586
1586
|
Stack.#g = true;
|
|
1587
1587
|
const s = new Stack(t, e);
|
|
@@ -1605,12 +1605,12 @@ class Stack {
|
|
|
1605
1605
|
|
|
1606
1606
|
class LRUCache {
|
|
1607
1607
|
#m;
|
|
1608
|
-
#y;
|
|
1609
1608
|
#w;
|
|
1609
|
+
#y;
|
|
1610
1610
|
#b;
|
|
1611
1611
|
#S;
|
|
1612
1612
|
#k;
|
|
1613
|
-
#
|
|
1613
|
+
#v;
|
|
1614
1614
|
ttl;
|
|
1615
1615
|
ttlResolution;
|
|
1616
1616
|
ttlAutopurge;
|
|
@@ -1626,7 +1626,7 @@ class LRUCache {
|
|
|
1626
1626
|
allowStaleOnFetchAbort;
|
|
1627
1627
|
allowStaleOnFetchRejection;
|
|
1628
1628
|
ignoreFetchAbort;
|
|
1629
|
-
#
|
|
1629
|
+
#x;
|
|
1630
1630
|
#E;
|
|
1631
1631
|
#C;
|
|
1632
1632
|
#T;
|
|
@@ -1641,9 +1641,9 @@ class LRUCache {
|
|
|
1641
1641
|
#D;
|
|
1642
1642
|
#N;
|
|
1643
1643
|
#B;
|
|
1644
|
-
#_;
|
|
1645
|
-
#I;
|
|
1646
1644
|
#W;
|
|
1645
|
+
#I;
|
|
1646
|
+
#_;
|
|
1647
1647
|
static unsafeExposeInternals(t) {
|
|
1648
1648
|
return {
|
|
1649
1649
|
starts: t.#D,
|
|
@@ -1663,8 +1663,8 @@ class LRUCache {
|
|
|
1663
1663
|
free: t.#R,
|
|
1664
1664
|
isBackgroundFetch: e => t.#j(e),
|
|
1665
1665
|
backgroundFetch: (e, s, i, n) => t.#$(e, s, i, n),
|
|
1666
|
-
moveToTail: e => t.#
|
|
1667
|
-
indexes: e => t.#
|
|
1666
|
+
moveToTail: e => t.#U(e),
|
|
1667
|
+
indexes: e => t.#G(e),
|
|
1668
1668
|
rindexes: e => t.#q(e),
|
|
1669
1669
|
isStale: e => t.#H(e)
|
|
1670
1670
|
};
|
|
@@ -1673,22 +1673,22 @@ class LRUCache {
|
|
|
1673
1673
|
return this.#m;
|
|
1674
1674
|
}
|
|
1675
1675
|
get maxSize() {
|
|
1676
|
-
return this.#
|
|
1676
|
+
return this.#w;
|
|
1677
1677
|
}
|
|
1678
1678
|
get calculatedSize() {
|
|
1679
1679
|
return this.#E;
|
|
1680
1680
|
}
|
|
1681
1681
|
get size() {
|
|
1682
|
-
return this.#
|
|
1682
|
+
return this.#x;
|
|
1683
1683
|
}
|
|
1684
1684
|
get fetchMethod() {
|
|
1685
1685
|
return this.#k;
|
|
1686
1686
|
}
|
|
1687
1687
|
get memoMethod() {
|
|
1688
|
-
return this.#
|
|
1688
|
+
return this.#v;
|
|
1689
1689
|
}
|
|
1690
1690
|
get dispose() {
|
|
1691
|
-
return this.#
|
|
1691
|
+
return this.#y;
|
|
1692
1692
|
}
|
|
1693
1693
|
get onInsert() {
|
|
1694
1694
|
return this.#b;
|
|
@@ -1697,20 +1697,20 @@ class LRUCache {
|
|
|
1697
1697
|
return this.#S;
|
|
1698
1698
|
}
|
|
1699
1699
|
constructor(t) {
|
|
1700
|
-
const {max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: h, dispose: a, onInsert: l, disposeAfter: c, noDisposeOnSet: f, noUpdateTTL: u, maxSize: d = 0, maxEntrySize: p = 0, sizeCalculation: g, fetchMethod:
|
|
1701
|
-
if (e !== 0 && !
|
|
1700
|
+
const {max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: h, dispose: a, onInsert: l, disposeAfter: c, noDisposeOnSet: f, noUpdateTTL: u, maxSize: d = 0, maxEntrySize: p = 0, sizeCalculation: g, fetchMethod: m, memoMethod: w, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: k, ignoreFetchAbort: v} = t;
|
|
1701
|
+
if (e !== 0 && !Yt(e)) {
|
|
1702
1702
|
throw new TypeError("max option must be a nonnegative integer");
|
|
1703
1703
|
}
|
|
1704
|
-
const
|
|
1705
|
-
if (!
|
|
1704
|
+
const x = e ? Xt(e) : Array;
|
|
1705
|
+
if (!x) {
|
|
1706
1706
|
throw new Error("invalid max value: " + e);
|
|
1707
1707
|
}
|
|
1708
1708
|
this.#m = e;
|
|
1709
|
-
this.#
|
|
1710
|
-
this.maxEntrySize = p || this.#
|
|
1709
|
+
this.#w = d;
|
|
1710
|
+
this.maxEntrySize = p || this.#w;
|
|
1711
1711
|
this.sizeCalculation = g;
|
|
1712
1712
|
if (this.sizeCalculation) {
|
|
1713
|
-
if (!this.#
|
|
1713
|
+
if (!this.#w && !this.maxEntrySize) {
|
|
1714
1714
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1715
1715
|
}
|
|
1716
1716
|
if (typeof this.sizeCalculation !== "function") {
|
|
@@ -1720,24 +1720,24 @@ class LRUCache {
|
|
|
1720
1720
|
if (w !== undefined && typeof w !== "function") {
|
|
1721
1721
|
throw new TypeError("memoMethod must be a function if defined");
|
|
1722
1722
|
}
|
|
1723
|
-
this.#
|
|
1724
|
-
if (
|
|
1723
|
+
this.#v = w;
|
|
1724
|
+
if (m !== undefined && typeof m !== "function") {
|
|
1725
1725
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
1726
1726
|
}
|
|
1727
|
-
this.#k =
|
|
1728
|
-
this.#
|
|
1727
|
+
this.#k = m;
|
|
1728
|
+
this.#W = !!m;
|
|
1729
1729
|
this.#C = new Map;
|
|
1730
1730
|
this.#T = new Array(e).fill(undefined);
|
|
1731
1731
|
this.#L = new Array(e).fill(undefined);
|
|
1732
|
-
this.#A = new
|
|
1733
|
-
this.#M = new
|
|
1732
|
+
this.#A = new x(e);
|
|
1733
|
+
this.#M = new x(e);
|
|
1734
1734
|
this.#P = 0;
|
|
1735
1735
|
this.#F = 0;
|
|
1736
1736
|
this.#R = Stack.create(e);
|
|
1737
|
-
this.#
|
|
1737
|
+
this.#x = 0;
|
|
1738
1738
|
this.#E = 0;
|
|
1739
1739
|
if (typeof a === "function") {
|
|
1740
|
-
this.#
|
|
1740
|
+
this.#y = a;
|
|
1741
1741
|
}
|
|
1742
1742
|
if (typeof l === "function") {
|
|
1743
1743
|
this.#b = l;
|
|
@@ -1749,48 +1749,48 @@ class LRUCache {
|
|
|
1749
1749
|
this.#S = undefined;
|
|
1750
1750
|
this.#O = undefined;
|
|
1751
1751
|
}
|
|
1752
|
-
this.#B = !!this.#
|
|
1753
|
-
this.#
|
|
1752
|
+
this.#B = !!this.#y;
|
|
1753
|
+
this.#_ = !!this.#b;
|
|
1754
1754
|
this.#I = !!this.#S;
|
|
1755
1755
|
this.noDisposeOnSet = !!f;
|
|
1756
1756
|
this.noUpdateTTL = !!u;
|
|
1757
|
-
this.noDeleteOnFetchRejection = !!
|
|
1758
|
-
this.allowStaleOnFetchRejection = !!
|
|
1759
|
-
this.allowStaleOnFetchAbort = !!
|
|
1757
|
+
this.noDeleteOnFetchRejection = !!y;
|
|
1758
|
+
this.allowStaleOnFetchRejection = !!S;
|
|
1759
|
+
this.allowStaleOnFetchAbort = !!k;
|
|
1760
1760
|
this.ignoreFetchAbort = !!v;
|
|
1761
1761
|
if (this.maxEntrySize !== 0) {
|
|
1762
|
-
if (this.#
|
|
1763
|
-
if (!
|
|
1762
|
+
if (this.#w !== 0) {
|
|
1763
|
+
if (!Yt(this.#w)) {
|
|
1764
1764
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
1765
1765
|
}
|
|
1766
1766
|
}
|
|
1767
|
-
if (!
|
|
1767
|
+
if (!Yt(this.maxEntrySize)) {
|
|
1768
1768
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1769
1769
|
}
|
|
1770
1770
|
this.#Z();
|
|
1771
1771
|
}
|
|
1772
1772
|
this.allowStale = !!h;
|
|
1773
|
-
this.noDeleteOnStaleGet = !!
|
|
1773
|
+
this.noDeleteOnStaleGet = !!b;
|
|
1774
1774
|
this.updateAgeOnGet = !!r;
|
|
1775
1775
|
this.updateAgeOnHas = !!o;
|
|
1776
|
-
this.ttlResolution =
|
|
1776
|
+
this.ttlResolution = Yt(i) || i === 0 ? i : 1;
|
|
1777
1777
|
this.ttlAutopurge = !!n;
|
|
1778
1778
|
this.ttl = s || 0;
|
|
1779
1779
|
if (this.ttl) {
|
|
1780
|
-
if (!
|
|
1780
|
+
if (!Yt(this.ttl)) {
|
|
1781
1781
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
1782
1782
|
}
|
|
1783
1783
|
this.#V();
|
|
1784
1784
|
}
|
|
1785
|
-
if (this.#m === 0 && this.ttl === 0 && this.#
|
|
1785
|
+
if (this.#m === 0 && this.ttl === 0 && this.#w === 0) {
|
|
1786
1786
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1787
1787
|
}
|
|
1788
|
-
if (!this.ttlAutopurge && !this.#m && !this.#
|
|
1788
|
+
if (!this.ttlAutopurge && !this.#m && !this.#w) {
|
|
1789
1789
|
const t = "LRU_CACHE_UNBOUNDED";
|
|
1790
|
-
if (
|
|
1791
|
-
|
|
1790
|
+
if (Jt(t)) {
|
|
1791
|
+
Gt.add(t);
|
|
1792
1792
|
const e = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
|
1793
|
-
|
|
1793
|
+
Ht(e, "UnboundedCacheWarning", t, LRUCache);
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
@@ -1802,7 +1802,7 @@ class LRUCache {
|
|
|
1802
1802
|
const e = new ZeroArray(this.#m);
|
|
1803
1803
|
this.#N = t;
|
|
1804
1804
|
this.#D = e;
|
|
1805
|
-
this.#J = (s, i, n =
|
|
1805
|
+
this.#J = (s, i, n = Ut.now()) => {
|
|
1806
1806
|
e[s] = i !== 0 ? n : 0;
|
|
1807
1807
|
t[s] = i;
|
|
1808
1808
|
if (i !== 0 && this.ttlAutopurge) {
|
|
@@ -1817,23 +1817,23 @@ class LRUCache {
|
|
|
1817
1817
|
}
|
|
1818
1818
|
};
|
|
1819
1819
|
this.#Y = s => {
|
|
1820
|
-
e[s] = t[s] !== 0 ?
|
|
1820
|
+
e[s] = t[s] !== 0 ? Ut.now() : 0;
|
|
1821
1821
|
};
|
|
1822
|
-
this.#X = (
|
|
1823
|
-
if (t[
|
|
1824
|
-
const
|
|
1825
|
-
const
|
|
1826
|
-
if (!
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
const
|
|
1831
|
-
|
|
1822
|
+
this.#X = (n, r) => {
|
|
1823
|
+
if (t[r]) {
|
|
1824
|
+
const o = t[r];
|
|
1825
|
+
const h = e[r];
|
|
1826
|
+
if (!o || !h) return;
|
|
1827
|
+
n.ttl = o;
|
|
1828
|
+
n.start = h;
|
|
1829
|
+
n.now = s || i();
|
|
1830
|
+
const a = n.now - h;
|
|
1831
|
+
n.remainingTTL = o - a;
|
|
1832
1832
|
}
|
|
1833
1833
|
};
|
|
1834
1834
|
let s = 0;
|
|
1835
|
-
const
|
|
1836
|
-
const t =
|
|
1835
|
+
const i = () => {
|
|
1836
|
+
const t = Ut.now();
|
|
1837
1837
|
if (this.ttlResolution > 0) {
|
|
1838
1838
|
s = t;
|
|
1839
1839
|
const e = setTimeout((() => s = 0), this.ttlResolution);
|
|
@@ -1843,23 +1843,23 @@ class LRUCache {
|
|
|
1843
1843
|
}
|
|
1844
1844
|
return t;
|
|
1845
1845
|
};
|
|
1846
|
-
this.getRemainingTTL =
|
|
1847
|
-
const
|
|
1848
|
-
if (
|
|
1846
|
+
this.getRemainingTTL = n => {
|
|
1847
|
+
const r = this.#C.get(n);
|
|
1848
|
+
if (r === undefined) {
|
|
1849
1849
|
return 0;
|
|
1850
1850
|
}
|
|
1851
|
-
const
|
|
1852
|
-
const
|
|
1853
|
-
if (!
|
|
1851
|
+
const o = t[r];
|
|
1852
|
+
const h = e[r];
|
|
1853
|
+
if (!o || !h) {
|
|
1854
1854
|
return Infinity;
|
|
1855
1855
|
}
|
|
1856
|
-
const
|
|
1857
|
-
return
|
|
1856
|
+
const a = (s || i()) - h;
|
|
1857
|
+
return o - a;
|
|
1858
1858
|
};
|
|
1859
|
-
this.#H =
|
|
1860
|
-
const
|
|
1861
|
-
const
|
|
1862
|
-
return !!
|
|
1859
|
+
this.#H = n => {
|
|
1860
|
+
const r = e[n];
|
|
1861
|
+
const o = t[n];
|
|
1862
|
+
return !!o && !!r && (s || i()) - r > o;
|
|
1863
1863
|
};
|
|
1864
1864
|
}
|
|
1865
1865
|
#Y=() => {};
|
|
@@ -1878,13 +1878,13 @@ class LRUCache {
|
|
|
1878
1878
|
if (this.#j(e)) {
|
|
1879
1879
|
return 0;
|
|
1880
1880
|
}
|
|
1881
|
-
if (!
|
|
1881
|
+
if (!Yt(s)) {
|
|
1882
1882
|
if (i) {
|
|
1883
1883
|
if (typeof i !== "function") {
|
|
1884
1884
|
throw new TypeError("sizeCalculation must be a function");
|
|
1885
1885
|
}
|
|
1886
1886
|
s = i(e, t);
|
|
1887
|
-
if (!
|
|
1887
|
+
if (!Yt(s)) {
|
|
1888
1888
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1889
1889
|
}
|
|
1890
1890
|
} else {
|
|
@@ -1895,8 +1895,8 @@ class LRUCache {
|
|
|
1895
1895
|
};
|
|
1896
1896
|
this.#et = (e, s, i) => {
|
|
1897
1897
|
t[e] = s;
|
|
1898
|
-
if (this.#
|
|
1899
|
-
const s = this.#
|
|
1898
|
+
if (this.#w) {
|
|
1899
|
+
const s = this.#w - t[e];
|
|
1900
1900
|
while (this.#E > s) {
|
|
1901
1901
|
this.#st(true);
|
|
1902
1902
|
}
|
|
@@ -1916,8 +1916,8 @@ class LRUCache {
|
|
|
1916
1916
|
}
|
|
1917
1917
|
return 0;
|
|
1918
1918
|
};
|
|
1919
|
-
* #
|
|
1920
|
-
if (this.#
|
|
1919
|
+
* #G({allowStale: t = this.allowStale} = {}) {
|
|
1920
|
+
if (this.#x) {
|
|
1921
1921
|
for (let e = this.#F; true; ) {
|
|
1922
1922
|
if (!this.#it(e)) {
|
|
1923
1923
|
break;
|
|
@@ -1934,7 +1934,7 @@ class LRUCache {
|
|
|
1934
1934
|
}
|
|
1935
1935
|
}
|
|
1936
1936
|
* #q({allowStale: t = this.allowStale} = {}) {
|
|
1937
|
-
if (this.#
|
|
1937
|
+
if (this.#x) {
|
|
1938
1938
|
for (let e = this.#P; true; ) {
|
|
1939
1939
|
if (!this.#it(e)) {
|
|
1940
1940
|
break;
|
|
@@ -1954,7 +1954,7 @@ class LRUCache {
|
|
|
1954
1954
|
return t !== undefined && this.#C.get(this.#T[t]) === t;
|
|
1955
1955
|
}
|
|
1956
1956
|
* entries() {
|
|
1957
|
-
for (const t of this.#
|
|
1957
|
+
for (const t of this.#G()) {
|
|
1958
1958
|
if (this.#L[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#L[t])) {
|
|
1959
1959
|
yield [ this.#T[t], this.#L[t] ];
|
|
1960
1960
|
}
|
|
@@ -1968,7 +1968,7 @@ class LRUCache {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
}
|
|
1970
1970
|
* keys() {
|
|
1971
|
-
for (const t of this.#
|
|
1971
|
+
for (const t of this.#G()) {
|
|
1972
1972
|
const e = this.#T[t];
|
|
1973
1973
|
if (e !== undefined && !this.#j(this.#L[t])) {
|
|
1974
1974
|
yield e;
|
|
@@ -1984,7 +1984,7 @@ class LRUCache {
|
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
1986
|
* values() {
|
|
1987
|
-
for (const t of this.#
|
|
1987
|
+
for (const t of this.#G()) {
|
|
1988
1988
|
const e = this.#L[t];
|
|
1989
1989
|
if (e !== undefined && !this.#j(this.#L[t])) {
|
|
1990
1990
|
yield this.#L[t];
|
|
@@ -2004,7 +2004,7 @@ class LRUCache {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
[Symbol.toStringTag]="LRUCache";
|
|
2006
2006
|
find(t, e = {}) {
|
|
2007
|
-
for (const s of this.#
|
|
2007
|
+
for (const s of this.#G()) {
|
|
2008
2008
|
const i = this.#L[s];
|
|
2009
2009
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
2010
2010
|
if (n === undefined) continue;
|
|
@@ -2014,7 +2014,7 @@ class LRUCache {
|
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
forEach(t, e = this) {
|
|
2017
|
-
for (const s of this.#
|
|
2017
|
+
for (const s of this.#G()) {
|
|
2018
2018
|
const i = this.#L[s];
|
|
2019
2019
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
2020
2020
|
if (n === undefined) continue;
|
|
@@ -2054,7 +2054,7 @@ class LRUCache {
|
|
|
2054
2054
|
const t = this.#N[e];
|
|
2055
2055
|
const s = this.#D[e];
|
|
2056
2056
|
if (t && s) {
|
|
2057
|
-
const e = t - (
|
|
2057
|
+
const e = t - (Ut.now() - s);
|
|
2058
2058
|
n.ttl = e;
|
|
2059
2059
|
n.start = Date.now();
|
|
2060
2060
|
}
|
|
@@ -2066,7 +2066,7 @@ class LRUCache {
|
|
|
2066
2066
|
}
|
|
2067
2067
|
dump() {
|
|
2068
2068
|
const t = [];
|
|
2069
|
-
for (const e of this.#
|
|
2069
|
+
for (const e of this.#G({
|
|
2070
2070
|
allowStale: true
|
|
2071
2071
|
})) {
|
|
2072
2072
|
const s = this.#T[e];
|
|
@@ -2078,7 +2078,7 @@ class LRUCache {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
if (this.#N && this.#D) {
|
|
2080
2080
|
r.ttl = this.#N[e];
|
|
2081
|
-
const t =
|
|
2081
|
+
const t = Ut.now() - this.#D[e];
|
|
2082
2082
|
r.start = Math.floor(Date.now() - t);
|
|
2083
2083
|
}
|
|
2084
2084
|
if (this.#z) {
|
|
@@ -2093,7 +2093,7 @@ class LRUCache {
|
|
|
2093
2093
|
for (const [e, s] of t) {
|
|
2094
2094
|
if (s.start) {
|
|
2095
2095
|
const t = Date.now() - s.start;
|
|
2096
|
-
s.start =
|
|
2096
|
+
s.start = Ut.now() - t;
|
|
2097
2097
|
}
|
|
2098
2098
|
this.set(e, s.value, s);
|
|
2099
2099
|
}
|
|
@@ -2114,32 +2114,32 @@ class LRUCache {
|
|
|
2114
2114
|
this.#K(t, "set");
|
|
2115
2115
|
return this;
|
|
2116
2116
|
}
|
|
2117
|
-
let c = this.#
|
|
2117
|
+
let c = this.#x === 0 ? undefined : this.#C.get(t);
|
|
2118
2118
|
if (c === undefined) {
|
|
2119
|
-
c = this.#
|
|
2119
|
+
c = this.#x === 0 ? this.#F : this.#R.length !== 0 ? this.#R.pop() : this.#x === this.#m ? this.#st(false) : this.#x;
|
|
2120
2120
|
this.#T[c] = t;
|
|
2121
2121
|
this.#L[c] = e;
|
|
2122
2122
|
this.#C.set(t, c);
|
|
2123
2123
|
this.#A[this.#F] = c;
|
|
2124
2124
|
this.#M[c] = this.#F;
|
|
2125
2125
|
this.#F = c;
|
|
2126
|
-
this.#
|
|
2126
|
+
this.#x++;
|
|
2127
2127
|
this.#et(c, l, h);
|
|
2128
2128
|
if (h) h.set = "add";
|
|
2129
2129
|
a = false;
|
|
2130
|
-
if (this.#
|
|
2130
|
+
if (this.#_) {
|
|
2131
2131
|
this.#b?.(e, t, "add");
|
|
2132
2132
|
}
|
|
2133
2133
|
} else {
|
|
2134
|
-
this.#
|
|
2134
|
+
this.#U(c);
|
|
2135
2135
|
const s = this.#L[c];
|
|
2136
2136
|
if (e !== s) {
|
|
2137
|
-
if (this.#
|
|
2137
|
+
if (this.#W && this.#j(s)) {
|
|
2138
2138
|
s.__abortController.abort(new Error("replaced"));
|
|
2139
2139
|
const {__staleWhileFetching: e} = s;
|
|
2140
2140
|
if (e !== undefined && !r) {
|
|
2141
2141
|
if (this.#B) {
|
|
2142
|
-
this.#
|
|
2142
|
+
this.#y?.(e, t, "set");
|
|
2143
2143
|
}
|
|
2144
2144
|
if (this.#I) {
|
|
2145
2145
|
this.#O?.push([ e, t, "set" ]);
|
|
@@ -2147,7 +2147,7 @@ class LRUCache {
|
|
|
2147
2147
|
}
|
|
2148
2148
|
} else if (!r) {
|
|
2149
2149
|
if (this.#B) {
|
|
2150
|
-
this.#
|
|
2150
|
+
this.#y?.(s, t, "set");
|
|
2151
2151
|
}
|
|
2152
2152
|
if (this.#I) {
|
|
2153
2153
|
this.#O?.push([ s, t, "set" ]);
|
|
@@ -2164,7 +2164,7 @@ class LRUCache {
|
|
|
2164
2164
|
} else if (h) {
|
|
2165
2165
|
h.set = "update";
|
|
2166
2166
|
}
|
|
2167
|
-
if (this.#
|
|
2167
|
+
if (this.#_) {
|
|
2168
2168
|
this.onInsert?.(e, t, e === s ? "update" : "replace");
|
|
2169
2169
|
}
|
|
2170
2170
|
}
|
|
@@ -2188,7 +2188,7 @@ class LRUCache {
|
|
|
2188
2188
|
}
|
|
2189
2189
|
pop() {
|
|
2190
2190
|
try {
|
|
2191
|
-
while (this.#
|
|
2191
|
+
while (this.#x) {
|
|
2192
2192
|
const t = this.#L[this.#P];
|
|
2193
2193
|
this.#st(true);
|
|
2194
2194
|
if (this.#j(t)) {
|
|
@@ -2213,11 +2213,11 @@ class LRUCache {
|
|
|
2213
2213
|
const e = this.#P;
|
|
2214
2214
|
const s = this.#T[e];
|
|
2215
2215
|
const i = this.#L[e];
|
|
2216
|
-
if (this.#
|
|
2216
|
+
if (this.#W && this.#j(i)) {
|
|
2217
2217
|
i.__abortController.abort(new Error("evicted"));
|
|
2218
2218
|
} else if (this.#B || this.#I) {
|
|
2219
2219
|
if (this.#B) {
|
|
2220
|
-
this.#
|
|
2220
|
+
this.#y?.(i, s, "evict");
|
|
2221
2221
|
}
|
|
2222
2222
|
if (this.#I) {
|
|
2223
2223
|
this.#O?.push([ i, s, "evict" ]);
|
|
@@ -2229,14 +2229,14 @@ class LRUCache {
|
|
|
2229
2229
|
this.#L[e] = undefined;
|
|
2230
2230
|
this.#R.push(e);
|
|
2231
2231
|
}
|
|
2232
|
-
if (this.#
|
|
2232
|
+
if (this.#x === 1) {
|
|
2233
2233
|
this.#P = this.#F = 0;
|
|
2234
2234
|
this.#R.length = 0;
|
|
2235
2235
|
} else {
|
|
2236
2236
|
this.#P = this.#A[e];
|
|
2237
2237
|
}
|
|
2238
2238
|
this.#C.delete(s);
|
|
2239
|
-
this.#
|
|
2239
|
+
this.#x--;
|
|
2240
2240
|
return e;
|
|
2241
2241
|
}
|
|
2242
2242
|
has(t, e = {}) {
|
|
@@ -2279,7 +2279,7 @@ class LRUCache {
|
|
|
2279
2279
|
if (this.#j(n)) {
|
|
2280
2280
|
return n;
|
|
2281
2281
|
}
|
|
2282
|
-
const r = new
|
|
2282
|
+
const r = new Zt;
|
|
2283
2283
|
const {signal: o} = s;
|
|
2284
2284
|
o?.addEventListener("abort", (() => r.abort(o.reason)), {
|
|
2285
2285
|
signal: r.signal
|
|
@@ -2289,26 +2289,26 @@ class LRUCache {
|
|
|
2289
2289
|
options: s,
|
|
2290
2290
|
context: i
|
|
2291
2291
|
};
|
|
2292
|
-
const
|
|
2292
|
+
const a = (i, n = false) => {
|
|
2293
2293
|
const {aborted: o} = r.signal;
|
|
2294
|
-
const
|
|
2294
|
+
const a = s.ignoreFetchAbort && i !== undefined;
|
|
2295
2295
|
if (s.status) {
|
|
2296
2296
|
if (o && !n) {
|
|
2297
2297
|
s.status.fetchAborted = true;
|
|
2298
2298
|
s.status.fetchError = r.signal.reason;
|
|
2299
|
-
if (
|
|
2299
|
+
if (a) s.status.fetchAbortIgnored = true;
|
|
2300
2300
|
} else {
|
|
2301
2301
|
s.status.fetchResolved = true;
|
|
2302
2302
|
}
|
|
2303
2303
|
}
|
|
2304
|
-
if (o && !
|
|
2305
|
-
return
|
|
2304
|
+
if (o && !a && !n) {
|
|
2305
|
+
return c(r.signal.reason);
|
|
2306
2306
|
}
|
|
2307
|
-
const
|
|
2308
|
-
if (this.#L[e] ===
|
|
2307
|
+
const l = u;
|
|
2308
|
+
if (this.#L[e] === u) {
|
|
2309
2309
|
if (i === undefined) {
|
|
2310
|
-
if (
|
|
2311
|
-
this.#L[e] =
|
|
2310
|
+
if (l.__staleWhileFetching) {
|
|
2311
|
+
this.#L[e] = l.__staleWhileFetching;
|
|
2312
2312
|
} else {
|
|
2313
2313
|
this.#K(t, "fetch");
|
|
2314
2314
|
}
|
|
@@ -2319,37 +2319,37 @@ class LRUCache {
|
|
|
2319
2319
|
}
|
|
2320
2320
|
return i;
|
|
2321
2321
|
};
|
|
2322
|
-
const
|
|
2322
|
+
const l = t => {
|
|
2323
2323
|
if (s.status) {
|
|
2324
2324
|
s.status.fetchRejected = true;
|
|
2325
2325
|
s.status.fetchError = t;
|
|
2326
2326
|
}
|
|
2327
|
-
return
|
|
2327
|
+
return c(t);
|
|
2328
2328
|
};
|
|
2329
|
-
const
|
|
2329
|
+
const c = i => {
|
|
2330
2330
|
const {aborted: n} = r.signal;
|
|
2331
2331
|
const o = n && s.allowStaleOnFetchAbort;
|
|
2332
2332
|
const h = o || s.allowStaleOnFetchRejection;
|
|
2333
|
-
const
|
|
2334
|
-
const
|
|
2335
|
-
if (this.#L[e] ===
|
|
2336
|
-
const s = !
|
|
2333
|
+
const a = h || s.noDeleteOnFetchRejection;
|
|
2334
|
+
const l = u;
|
|
2335
|
+
if (this.#L[e] === u) {
|
|
2336
|
+
const s = !a || l.__staleWhileFetching === undefined;
|
|
2337
2337
|
if (s) {
|
|
2338
2338
|
this.#K(t, "fetch");
|
|
2339
2339
|
} else if (!o) {
|
|
2340
|
-
this.#L[e] =
|
|
2340
|
+
this.#L[e] = l.__staleWhileFetching;
|
|
2341
2341
|
}
|
|
2342
2342
|
}
|
|
2343
2343
|
if (h) {
|
|
2344
|
-
if (s.status &&
|
|
2344
|
+
if (s.status && l.__staleWhileFetching !== undefined) {
|
|
2345
2345
|
s.status.returnedStale = true;
|
|
2346
2346
|
}
|
|
2347
|
-
return
|
|
2348
|
-
} else if (
|
|
2347
|
+
return l.__staleWhileFetching;
|
|
2348
|
+
} else if (l.__returned === l) {
|
|
2349
2349
|
throw i;
|
|
2350
2350
|
}
|
|
2351
2351
|
};
|
|
2352
|
-
const
|
|
2352
|
+
const f = (e, i) => {
|
|
2353
2353
|
const o = this.#k?.(t, n, h);
|
|
2354
2354
|
if (o && o instanceof Promise) {
|
|
2355
2355
|
o.then((t => e(t === undefined ? undefined : t)), i);
|
|
@@ -2358,46 +2358,46 @@ class LRUCache {
|
|
|
2358
2358
|
if (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) {
|
|
2359
2359
|
e(undefined);
|
|
2360
2360
|
if (s.allowStaleOnFetchAbort) {
|
|
2361
|
-
e = t =>
|
|
2361
|
+
e = t => a(t, true);
|
|
2362
2362
|
}
|
|
2363
2363
|
}
|
|
2364
2364
|
}));
|
|
2365
2365
|
};
|
|
2366
2366
|
if (s.status) s.status.fetchDispatched = true;
|
|
2367
|
-
const
|
|
2368
|
-
const
|
|
2367
|
+
const u = new Promise(f).then(a, l);
|
|
2368
|
+
const d = Object.assign(u, {
|
|
2369
2369
|
__abortController: r,
|
|
2370
2370
|
__staleWhileFetching: n,
|
|
2371
2371
|
__returned: undefined
|
|
2372
2372
|
});
|
|
2373
2373
|
if (e === undefined) {
|
|
2374
|
-
this.set(t,
|
|
2374
|
+
this.set(t, d, {
|
|
2375
2375
|
...h.options,
|
|
2376
2376
|
status: undefined
|
|
2377
2377
|
});
|
|
2378
2378
|
e = this.#C.get(t);
|
|
2379
2379
|
} else {
|
|
2380
|
-
this.#L[e] =
|
|
2380
|
+
this.#L[e] = d;
|
|
2381
2381
|
}
|
|
2382
|
-
return
|
|
2382
|
+
return d;
|
|
2383
2383
|
}
|
|
2384
2384
|
#j(t) {
|
|
2385
|
-
if (!this.#
|
|
2385
|
+
if (!this.#W) return false;
|
|
2386
2386
|
const e = t;
|
|
2387
|
-
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof
|
|
2387
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof Zt;
|
|
2388
2388
|
}
|
|
2389
2389
|
async fetch(t, e = {}) {
|
|
2390
|
-
const {allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: h = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: f = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: d = this.allowStaleOnFetchAbort, context: p, forceRefresh: g = false, status:
|
|
2391
|
-
if (!this.#
|
|
2392
|
-
if (
|
|
2390
|
+
const {allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: h = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: f = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: d = this.allowStaleOnFetchAbort, context: p, forceRefresh: g = false, status: m, signal: w} = e;
|
|
2391
|
+
if (!this.#W) {
|
|
2392
|
+
if (m) m.fetch = "get";
|
|
2393
2393
|
return this.get(t, {
|
|
2394
2394
|
allowStale: s,
|
|
2395
2395
|
updateAgeOnGet: i,
|
|
2396
2396
|
noDeleteOnStaleGet: n,
|
|
2397
|
-
status:
|
|
2397
|
+
status: m
|
|
2398
2398
|
});
|
|
2399
2399
|
}
|
|
2400
|
-
const
|
|
2400
|
+
const y = {
|
|
2401
2401
|
allowStale: s,
|
|
2402
2402
|
updateAgeOnGet: i,
|
|
2403
2403
|
noDeleteOnStaleGet: n,
|
|
@@ -2410,40 +2410,40 @@ class LRUCache {
|
|
|
2410
2410
|
allowStaleOnFetchRejection: f,
|
|
2411
2411
|
allowStaleOnFetchAbort: d,
|
|
2412
2412
|
ignoreFetchAbort: u,
|
|
2413
|
-
status:
|
|
2413
|
+
status: m,
|
|
2414
2414
|
signal: w
|
|
2415
2415
|
};
|
|
2416
|
-
let
|
|
2417
|
-
if (
|
|
2418
|
-
if (
|
|
2419
|
-
const e = this.#$(t,
|
|
2416
|
+
let b = this.#C.get(t);
|
|
2417
|
+
if (b === undefined) {
|
|
2418
|
+
if (m) m.fetch = "miss";
|
|
2419
|
+
const e = this.#$(t, b, y, p);
|
|
2420
2420
|
return e.__returned = e;
|
|
2421
2421
|
} else {
|
|
2422
|
-
const e = this.#L[
|
|
2422
|
+
const e = this.#L[b];
|
|
2423
2423
|
if (this.#j(e)) {
|
|
2424
2424
|
const t = s && e.__staleWhileFetching !== undefined;
|
|
2425
|
-
if (
|
|
2426
|
-
|
|
2427
|
-
if (t)
|
|
2425
|
+
if (m) {
|
|
2426
|
+
m.fetch = "inflight";
|
|
2427
|
+
if (t) m.returnedStale = true;
|
|
2428
2428
|
}
|
|
2429
2429
|
return t ? e.__staleWhileFetching : e.__returned = e;
|
|
2430
2430
|
}
|
|
2431
|
-
const n = this.#H(
|
|
2431
|
+
const n = this.#H(b);
|
|
2432
2432
|
if (!g && !n) {
|
|
2433
|
-
if (
|
|
2434
|
-
this.#
|
|
2433
|
+
if (m) m.fetch = "hit";
|
|
2434
|
+
this.#U(b);
|
|
2435
2435
|
if (i) {
|
|
2436
|
-
this.#Y(
|
|
2436
|
+
this.#Y(b);
|
|
2437
2437
|
}
|
|
2438
|
-
if (
|
|
2438
|
+
if (m) this.#X(m, b);
|
|
2439
2439
|
return e;
|
|
2440
2440
|
}
|
|
2441
|
-
const r = this.#$(t,
|
|
2441
|
+
const r = this.#$(t, b, y, p);
|
|
2442
2442
|
const o = r.__staleWhileFetching !== undefined;
|
|
2443
2443
|
const h = o && s;
|
|
2444
|
-
if (
|
|
2445
|
-
|
|
2446
|
-
if (h && n)
|
|
2444
|
+
if (m) {
|
|
2445
|
+
m.fetch = n ? "stale" : "refresh";
|
|
2446
|
+
if (h && n) m.returnedStale = true;
|
|
2447
2447
|
}
|
|
2448
2448
|
return h ? r.__staleWhileFetching : r.__returned = r;
|
|
2449
2449
|
}
|
|
@@ -2454,7 +2454,7 @@ class LRUCache {
|
|
|
2454
2454
|
return s;
|
|
2455
2455
|
}
|
|
2456
2456
|
memo(t, e = {}) {
|
|
2457
|
-
const s = this.#
|
|
2457
|
+
const s = this.#v;
|
|
2458
2458
|
if (!s) {
|
|
2459
2459
|
throw new Error("no memoMethod provided to constructor");
|
|
2460
2460
|
}
|
|
@@ -2494,7 +2494,7 @@ class LRUCache {
|
|
|
2494
2494
|
if (h) {
|
|
2495
2495
|
return e.__staleWhileFetching;
|
|
2496
2496
|
}
|
|
2497
|
-
this.#
|
|
2497
|
+
this.#U(o);
|
|
2498
2498
|
if (i) {
|
|
2499
2499
|
this.#Y(o);
|
|
2500
2500
|
}
|
|
@@ -2508,7 +2508,7 @@ class LRUCache {
|
|
|
2508
2508
|
this.#M[e] = t;
|
|
2509
2509
|
this.#A[t] = e;
|
|
2510
2510
|
}
|
|
2511
|
-
#
|
|
2511
|
+
#U(t) {
|
|
2512
2512
|
if (t !== this.#F) {
|
|
2513
2513
|
if (t === this.#P) {
|
|
2514
2514
|
this.#P = this.#A[t];
|
|
@@ -2524,11 +2524,11 @@ class LRUCache {
|
|
|
2524
2524
|
}
|
|
2525
2525
|
#K(t, e) {
|
|
2526
2526
|
let s = false;
|
|
2527
|
-
if (this.#
|
|
2527
|
+
if (this.#x !== 0) {
|
|
2528
2528
|
const i = this.#C.get(t);
|
|
2529
2529
|
if (i !== undefined) {
|
|
2530
2530
|
s = true;
|
|
2531
|
-
if (this.#
|
|
2531
|
+
if (this.#x === 1) {
|
|
2532
2532
|
this.#rt(e);
|
|
2533
2533
|
} else {
|
|
2534
2534
|
this.#Q(i);
|
|
@@ -2537,7 +2537,7 @@ class LRUCache {
|
|
|
2537
2537
|
s.__abortController.abort(new Error("deleted"));
|
|
2538
2538
|
} else if (this.#B || this.#I) {
|
|
2539
2539
|
if (this.#B) {
|
|
2540
|
-
this.#
|
|
2540
|
+
this.#y?.(s, t, e);
|
|
2541
2541
|
}
|
|
2542
2542
|
if (this.#I) {
|
|
2543
2543
|
this.#O?.push([ s, t, e ]);
|
|
@@ -2556,7 +2556,7 @@ class LRUCache {
|
|
|
2556
2556
|
const e = this.#A[i];
|
|
2557
2557
|
this.#M[e] = this.#M[i];
|
|
2558
2558
|
}
|
|
2559
|
-
this.#
|
|
2559
|
+
this.#x--;
|
|
2560
2560
|
this.#R.push(i);
|
|
2561
2561
|
}
|
|
2562
2562
|
}
|
|
@@ -2583,7 +2583,7 @@ class LRUCache {
|
|
|
2583
2583
|
} else {
|
|
2584
2584
|
const i = this.#T[e];
|
|
2585
2585
|
if (this.#B) {
|
|
2586
|
-
this.#
|
|
2586
|
+
this.#y?.(s, i, t);
|
|
2587
2587
|
}
|
|
2588
2588
|
if (this.#I) {
|
|
2589
2589
|
this.#O?.push([ s, i, t ]);
|
|
@@ -2604,7 +2604,7 @@ class LRUCache {
|
|
|
2604
2604
|
this.#F = 0;
|
|
2605
2605
|
this.#R.length = 0;
|
|
2606
2606
|
this.#E = 0;
|
|
2607
|
-
this.#
|
|
2607
|
+
this.#x = 0;
|
|
2608
2608
|
if (this.#I && this.#O) {
|
|
2609
2609
|
const t = this.#O;
|
|
2610
2610
|
let e;
|
|
@@ -2615,88 +2615,88 @@ class LRUCache {
|
|
|
2615
2615
|
}
|
|
2616
2616
|
}
|
|
2617
2617
|
|
|
2618
|
-
const
|
|
2618
|
+
const Qt = typeof process === "object" && process ? process : {
|
|
2619
2619
|
stdout: null,
|
|
2620
2620
|
stderr: null
|
|
2621
2621
|
};
|
|
2622
2622
|
|
|
2623
|
-
const
|
|
2623
|
+
const te = t => !!t && typeof t === "object" && (t instanceof Minipass || t instanceof f.default || ee(t) || se(t));
|
|
2624
2624
|
|
|
2625
|
-
const
|
|
2625
|
+
const ee = t => !!t && typeof t === "object" && t instanceof r.EventEmitter && typeof t.pipe === "function" && t.pipe !== f.default.Writable.prototype.pipe;
|
|
2626
2626
|
|
|
2627
|
-
const
|
|
2627
|
+
const se = t => !!t && typeof t === "object" && t instanceof r.EventEmitter && typeof t.write === "function" && typeof t.end === "function";
|
|
2628
2628
|
|
|
2629
|
-
const
|
|
2629
|
+
const ie = Symbol("EOF");
|
|
2630
2630
|
|
|
2631
|
-
const
|
|
2631
|
+
const ne = Symbol("maybeEmitEnd");
|
|
2632
2632
|
|
|
2633
|
-
const
|
|
2633
|
+
const re = Symbol("emittedEnd");
|
|
2634
2634
|
|
|
2635
|
-
const
|
|
2635
|
+
const oe = Symbol("emittingEnd");
|
|
2636
2636
|
|
|
2637
|
-
const
|
|
2637
|
+
const he = Symbol("emittedError");
|
|
2638
2638
|
|
|
2639
|
-
const
|
|
2639
|
+
const ae = Symbol("closed");
|
|
2640
2640
|
|
|
2641
|
-
const
|
|
2641
|
+
const le = Symbol("read");
|
|
2642
2642
|
|
|
2643
|
-
const
|
|
2643
|
+
const ce = Symbol("flush");
|
|
2644
2644
|
|
|
2645
|
-
const
|
|
2645
|
+
const fe = Symbol("flushChunk");
|
|
2646
2646
|
|
|
2647
|
-
const
|
|
2647
|
+
const ue = Symbol("encoding");
|
|
2648
2648
|
|
|
2649
|
-
const
|
|
2649
|
+
const de = Symbol("decoder");
|
|
2650
2650
|
|
|
2651
|
-
const
|
|
2651
|
+
const pe = Symbol("flowing");
|
|
2652
2652
|
|
|
2653
|
-
const
|
|
2653
|
+
const ge = Symbol("paused");
|
|
2654
2654
|
|
|
2655
|
-
const
|
|
2655
|
+
const me = Symbol("resume");
|
|
2656
2656
|
|
|
2657
|
-
const
|
|
2657
|
+
const we = Symbol("buffer");
|
|
2658
2658
|
|
|
2659
|
-
const
|
|
2659
|
+
const ye = Symbol("pipes");
|
|
2660
2660
|
|
|
2661
|
-
const
|
|
2661
|
+
const be = Symbol("bufferLength");
|
|
2662
2662
|
|
|
2663
|
-
const
|
|
2663
|
+
const Se = Symbol("bufferPush");
|
|
2664
2664
|
|
|
2665
|
-
const
|
|
2665
|
+
const ke = Symbol("bufferShift");
|
|
2666
2666
|
|
|
2667
|
-
const
|
|
2667
|
+
const ve = Symbol("objectMode");
|
|
2668
2668
|
|
|
2669
|
-
const
|
|
2669
|
+
const xe = Symbol("destroyed");
|
|
2670
2670
|
|
|
2671
|
-
const
|
|
2671
|
+
const Ee = Symbol("error");
|
|
2672
2672
|
|
|
2673
|
-
const
|
|
2673
|
+
const Ce = Symbol("emitData");
|
|
2674
2674
|
|
|
2675
|
-
const
|
|
2675
|
+
const Te = Symbol("emitEnd");
|
|
2676
2676
|
|
|
2677
|
-
const
|
|
2677
|
+
const Le = Symbol("emitEnd2");
|
|
2678
2678
|
|
|
2679
|
-
const
|
|
2679
|
+
const Ae = Symbol("async");
|
|
2680
2680
|
|
|
2681
|
-
const
|
|
2681
|
+
const Me = Symbol("abort");
|
|
2682
2682
|
|
|
2683
|
-
const
|
|
2683
|
+
const Pe = Symbol("aborted");
|
|
2684
2684
|
|
|
2685
|
-
const
|
|
2685
|
+
const Fe = Symbol("signal");
|
|
2686
2686
|
|
|
2687
|
-
const
|
|
2687
|
+
const Re = Symbol("dataListeners");
|
|
2688
2688
|
|
|
2689
|
-
const
|
|
2689
|
+
const Oe = Symbol("discarded");
|
|
2690
2690
|
|
|
2691
|
-
const
|
|
2691
|
+
const ze = t => Promise.resolve().then(t);
|
|
2692
2692
|
|
|
2693
|
-
const
|
|
2693
|
+
const De = t => t();
|
|
2694
2694
|
|
|
2695
|
-
const
|
|
2695
|
+
const Ne = t => t === "end" || t === "finish" || t === "prefinish";
|
|
2696
2696
|
|
|
2697
|
-
const
|
|
2697
|
+
const Be = t => t instanceof ArrayBuffer || !!t && typeof t === "object" && t.constructor && t.constructor.name === "ArrayBuffer" && t.byteLength >= 0;
|
|
2698
2698
|
|
|
2699
|
-
const
|
|
2699
|
+
const We = t => !Buffer.isBuffer(t) && ArrayBuffer.isView(t);
|
|
2700
2700
|
|
|
2701
2701
|
class Pipe {
|
|
2702
2702
|
src;
|
|
@@ -2707,7 +2707,7 @@ class Pipe {
|
|
|
2707
2707
|
this.src = t;
|
|
2708
2708
|
this.dest = e;
|
|
2709
2709
|
this.opts = s;
|
|
2710
|
-
this.ondrain = () => t[
|
|
2710
|
+
this.ondrain = () => t[me]();
|
|
2711
2711
|
this.dest.on("drain", this.ondrain);
|
|
2712
2712
|
}
|
|
2713
2713
|
unpipe() {
|
|
@@ -2732,30 +2732,30 @@ class PipeProxyErrors extends Pipe {
|
|
|
2732
2732
|
}
|
|
2733
2733
|
}
|
|
2734
2734
|
|
|
2735
|
-
const
|
|
2735
|
+
const Ie = t => !!t.objectMode;
|
|
2736
2736
|
|
|
2737
|
-
const
|
|
2737
|
+
const _e = t => !t.objectMode && !!t.encoding && t.encoding !== "buffer";
|
|
2738
2738
|
|
|
2739
2739
|
class Minipass extends r.EventEmitter {
|
|
2740
|
-
[
|
|
2741
|
-
[
|
|
2742
|
-
[
|
|
2743
|
-
[
|
|
2744
|
-
[
|
|
2745
|
-
[
|
|
2746
|
-
[
|
|
2747
|
-
[
|
|
2748
|
-
[
|
|
2749
|
-
[
|
|
2750
|
-
[
|
|
2751
|
-
[
|
|
2752
|
-
[
|
|
2753
|
-
[
|
|
2754
|
-
[
|
|
2755
|
-
[
|
|
2756
|
-
[
|
|
2757
|
-
[
|
|
2758
|
-
[
|
|
2740
|
+
[pe]=false;
|
|
2741
|
+
[ge]=false;
|
|
2742
|
+
[ye]=[];
|
|
2743
|
+
[we]=[];
|
|
2744
|
+
[ve];
|
|
2745
|
+
[ue];
|
|
2746
|
+
[Ae];
|
|
2747
|
+
[de];
|
|
2748
|
+
[ie]=false;
|
|
2749
|
+
[re]=false;
|
|
2750
|
+
[oe]=false;
|
|
2751
|
+
[ae]=false;
|
|
2752
|
+
[he]=null;
|
|
2753
|
+
[be]=0;
|
|
2754
|
+
[xe]=false;
|
|
2755
|
+
[Fe];
|
|
2756
|
+
[Pe]=false;
|
|
2757
|
+
[Re]=0;
|
|
2758
|
+
[Oe]=false;
|
|
2759
2759
|
writable=true;
|
|
2760
2760
|
readable=true;
|
|
2761
2761
|
constructor(...t) {
|
|
@@ -2764,43 +2764,43 @@ class Minipass extends r.EventEmitter {
|
|
|
2764
2764
|
if (e.objectMode && typeof e.encoding === "string") {
|
|
2765
2765
|
throw new TypeError("Encoding and objectMode may not be used together");
|
|
2766
2766
|
}
|
|
2767
|
-
if (
|
|
2768
|
-
this[
|
|
2769
|
-
this[
|
|
2770
|
-
} else if (
|
|
2771
|
-
this[
|
|
2772
|
-
this[
|
|
2767
|
+
if (Ie(e)) {
|
|
2768
|
+
this[ve] = true;
|
|
2769
|
+
this[ue] = null;
|
|
2770
|
+
} else if (_e(e)) {
|
|
2771
|
+
this[ue] = e.encoding;
|
|
2772
|
+
this[ve] = false;
|
|
2773
2773
|
} else {
|
|
2774
|
-
this[
|
|
2775
|
-
this[
|
|
2774
|
+
this[ve] = false;
|
|
2775
|
+
this[ue] = null;
|
|
2776
2776
|
}
|
|
2777
|
-
this[
|
|
2778
|
-
this[
|
|
2777
|
+
this[Ae] = !!e.async;
|
|
2778
|
+
this[de] = this[ue] ? new h.StringDecoder(this[ue]) : null;
|
|
2779
2779
|
if (e && e.debugExposeBuffer === true) {
|
|
2780
2780
|
Object.defineProperty(this, "buffer", {
|
|
2781
|
-
get: () => this[
|
|
2781
|
+
get: () => this[we]
|
|
2782
2782
|
});
|
|
2783
2783
|
}
|
|
2784
2784
|
if (e && e.debugExposePipes === true) {
|
|
2785
2785
|
Object.defineProperty(this, "pipes", {
|
|
2786
|
-
get: () => this[
|
|
2786
|
+
get: () => this[ye]
|
|
2787
2787
|
});
|
|
2788
2788
|
}
|
|
2789
2789
|
const {signal: s} = e;
|
|
2790
2790
|
if (s) {
|
|
2791
|
-
this[
|
|
2791
|
+
this[Fe] = s;
|
|
2792
2792
|
if (s.aborted) {
|
|
2793
|
-
this[
|
|
2793
|
+
this[Me]();
|
|
2794
2794
|
} else {
|
|
2795
|
-
s.addEventListener("abort", (() => this[
|
|
2795
|
+
s.addEventListener("abort", (() => this[Me]()));
|
|
2796
2796
|
}
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
2799
|
get bufferLength() {
|
|
2800
|
-
return this[
|
|
2800
|
+
return this[be];
|
|
2801
2801
|
}
|
|
2802
2802
|
get encoding() {
|
|
2803
|
-
return this[
|
|
2803
|
+
return this[ue];
|
|
2804
2804
|
}
|
|
2805
2805
|
set encoding(t) {
|
|
2806
2806
|
throw new Error("Encoding must be set at instantiation time");
|
|
@@ -2809,30 +2809,30 @@ class Minipass extends r.EventEmitter {
|
|
|
2809
2809
|
throw new Error("Encoding must be set at instantiation time");
|
|
2810
2810
|
}
|
|
2811
2811
|
get objectMode() {
|
|
2812
|
-
return this[
|
|
2812
|
+
return this[ve];
|
|
2813
2813
|
}
|
|
2814
2814
|
set objectMode(t) {
|
|
2815
2815
|
throw new Error("objectMode must be set at instantiation time");
|
|
2816
2816
|
}
|
|
2817
2817
|
get ["async"]() {
|
|
2818
|
-
return this[
|
|
2818
|
+
return this[Ae];
|
|
2819
2819
|
}
|
|
2820
2820
|
set ["async"](t) {
|
|
2821
|
-
this[
|
|
2821
|
+
this[Ae] = this[Ae] || !!t;
|
|
2822
2822
|
}
|
|
2823
|
-
[
|
|
2824
|
-
this[
|
|
2825
|
-
this.emit("abort", this[
|
|
2826
|
-
this.destroy(this[
|
|
2823
|
+
[Me]() {
|
|
2824
|
+
this[Pe] = true;
|
|
2825
|
+
this.emit("abort", this[Fe]?.reason);
|
|
2826
|
+
this.destroy(this[Fe]?.reason);
|
|
2827
2827
|
}
|
|
2828
2828
|
get aborted() {
|
|
2829
|
-
return this[
|
|
2829
|
+
return this[Pe];
|
|
2830
2830
|
}
|
|
2831
2831
|
set aborted(t) {}
|
|
2832
2832
|
write(t, e, s) {
|
|
2833
|
-
if (this[
|
|
2834
|
-
if (this[
|
|
2835
|
-
if (this[
|
|
2833
|
+
if (this[Pe]) return false;
|
|
2834
|
+
if (this[ie]) throw new Error("write after end");
|
|
2835
|
+
if (this[xe]) {
|
|
2836
2836
|
this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), {
|
|
2837
2837
|
code: "ERR_STREAM_DESTROYED"
|
|
2838
2838
|
}));
|
|
@@ -2843,70 +2843,70 @@ class Minipass extends r.EventEmitter {
|
|
|
2843
2843
|
e = "utf8";
|
|
2844
2844
|
}
|
|
2845
2845
|
if (!e) e = "utf8";
|
|
2846
|
-
const i = this[
|
|
2847
|
-
if (!this[
|
|
2848
|
-
if (
|
|
2846
|
+
const i = this[Ae] ? ze : De;
|
|
2847
|
+
if (!this[ve] && !Buffer.isBuffer(t)) {
|
|
2848
|
+
if (We(t)) {
|
|
2849
2849
|
t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2850
|
-
} else if (
|
|
2850
|
+
} else if (Be(t)) {
|
|
2851
2851
|
t = Buffer.from(t);
|
|
2852
2852
|
} else if (typeof t !== "string") {
|
|
2853
2853
|
throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2854
2854
|
}
|
|
2855
2855
|
}
|
|
2856
|
-
if (this[
|
|
2857
|
-
if (this[
|
|
2858
|
-
if (this[
|
|
2859
|
-
if (this[
|
|
2856
|
+
if (this[ve]) {
|
|
2857
|
+
if (this[pe] && this[be] !== 0) this[ce](true);
|
|
2858
|
+
if (this[pe]) this.emit("data", t); else this[Se](t);
|
|
2859
|
+
if (this[be] !== 0) this.emit("readable");
|
|
2860
2860
|
if (s) i(s);
|
|
2861
|
-
return this[
|
|
2861
|
+
return this[pe];
|
|
2862
2862
|
}
|
|
2863
2863
|
if (!t.length) {
|
|
2864
|
-
if (this[
|
|
2864
|
+
if (this[be] !== 0) this.emit("readable");
|
|
2865
2865
|
if (s) i(s);
|
|
2866
|
-
return this[
|
|
2866
|
+
return this[pe];
|
|
2867
2867
|
}
|
|
2868
|
-
if (typeof t === "string" && !(e === this[
|
|
2868
|
+
if (typeof t === "string" && !(e === this[ue] && !this[de]?.lastNeed)) {
|
|
2869
2869
|
t = Buffer.from(t, e);
|
|
2870
2870
|
}
|
|
2871
|
-
if (Buffer.isBuffer(t) && this[
|
|
2872
|
-
t = this[
|
|
2871
|
+
if (Buffer.isBuffer(t) && this[ue]) {
|
|
2872
|
+
t = this[de].write(t);
|
|
2873
2873
|
}
|
|
2874
|
-
if (this[
|
|
2875
|
-
if (this[
|
|
2876
|
-
if (this[
|
|
2874
|
+
if (this[pe] && this[be] !== 0) this[ce](true);
|
|
2875
|
+
if (this[pe]) this.emit("data", t); else this[Se](t);
|
|
2876
|
+
if (this[be] !== 0) this.emit("readable");
|
|
2877
2877
|
if (s) i(s);
|
|
2878
|
-
return this[
|
|
2878
|
+
return this[pe];
|
|
2879
2879
|
}
|
|
2880
2880
|
read(t) {
|
|
2881
|
-
if (this[
|
|
2882
|
-
this[
|
|
2883
|
-
if (this[
|
|
2884
|
-
this[
|
|
2881
|
+
if (this[xe]) return null;
|
|
2882
|
+
this[Oe] = false;
|
|
2883
|
+
if (this[be] === 0 || t === 0 || t && t > this[be]) {
|
|
2884
|
+
this[ne]();
|
|
2885
2885
|
return null;
|
|
2886
2886
|
}
|
|
2887
|
-
if (this[
|
|
2888
|
-
if (this[
|
|
2889
|
-
this[
|
|
2887
|
+
if (this[ve]) t = null;
|
|
2888
|
+
if (this[we].length > 1 && !this[ve]) {
|
|
2889
|
+
this[we] = [ this[ue] ? this[we].join("") : Buffer.concat(this[we], this[be]) ];
|
|
2890
2890
|
}
|
|
2891
|
-
const e = this[
|
|
2892
|
-
this[
|
|
2891
|
+
const e = this[le](t || null, this[we][0]);
|
|
2892
|
+
this[ne]();
|
|
2893
2893
|
return e;
|
|
2894
2894
|
}
|
|
2895
|
-
[
|
|
2896
|
-
if (this[
|
|
2895
|
+
[le](t, e) {
|
|
2896
|
+
if (this[ve]) this[ke](); else {
|
|
2897
2897
|
const s = e;
|
|
2898
|
-
if (t === s.length || t === null) this[
|
|
2899
|
-
this[
|
|
2898
|
+
if (t === s.length || t === null) this[ke](); else if (typeof s === "string") {
|
|
2899
|
+
this[we][0] = s.slice(t);
|
|
2900
2900
|
e = s.slice(0, t);
|
|
2901
|
-
this[
|
|
2901
|
+
this[be] -= t;
|
|
2902
2902
|
} else {
|
|
2903
|
-
this[
|
|
2903
|
+
this[we][0] = s.subarray(t);
|
|
2904
2904
|
e = s.subarray(0, t);
|
|
2905
|
-
this[
|
|
2905
|
+
this[be] -= t;
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
2908
|
this.emit("data", e);
|
|
2909
|
-
if (!this[
|
|
2909
|
+
if (!this[we].length && !this[ie]) this.emit("drain");
|
|
2910
2910
|
return e;
|
|
2911
2911
|
}
|
|
2912
2912
|
end(t, e, s) {
|
|
@@ -2920,78 +2920,78 @@ class Minipass extends r.EventEmitter {
|
|
|
2920
2920
|
}
|
|
2921
2921
|
if (t !== undefined) this.write(t, e);
|
|
2922
2922
|
if (s) this.once("end", s);
|
|
2923
|
-
this[
|
|
2923
|
+
this[ie] = true;
|
|
2924
2924
|
this.writable = false;
|
|
2925
|
-
if (this[
|
|
2925
|
+
if (this[pe] || !this[ge]) this[ne]();
|
|
2926
2926
|
return this;
|
|
2927
2927
|
}
|
|
2928
|
-
[
|
|
2929
|
-
if (this[
|
|
2930
|
-
if (!this[
|
|
2931
|
-
this[
|
|
2928
|
+
[me]() {
|
|
2929
|
+
if (this[xe]) return;
|
|
2930
|
+
if (!this[Re] && !this[ye].length) {
|
|
2931
|
+
this[Oe] = true;
|
|
2932
2932
|
}
|
|
2933
|
-
this[
|
|
2934
|
-
this[
|
|
2933
|
+
this[ge] = false;
|
|
2934
|
+
this[pe] = true;
|
|
2935
2935
|
this.emit("resume");
|
|
2936
|
-
if (this[
|
|
2936
|
+
if (this[we].length) this[ce](); else if (this[ie]) this[ne](); else this.emit("drain");
|
|
2937
2937
|
}
|
|
2938
2938
|
resume() {
|
|
2939
|
-
return this[
|
|
2939
|
+
return this[me]();
|
|
2940
2940
|
}
|
|
2941
2941
|
pause() {
|
|
2942
|
-
this[
|
|
2943
|
-
this[
|
|
2944
|
-
this[
|
|
2942
|
+
this[pe] = false;
|
|
2943
|
+
this[ge] = true;
|
|
2944
|
+
this[Oe] = false;
|
|
2945
2945
|
}
|
|
2946
2946
|
get destroyed() {
|
|
2947
|
-
return this[
|
|
2947
|
+
return this[xe];
|
|
2948
2948
|
}
|
|
2949
2949
|
get flowing() {
|
|
2950
|
-
return this[
|
|
2950
|
+
return this[pe];
|
|
2951
2951
|
}
|
|
2952
2952
|
get paused() {
|
|
2953
|
-
return this[
|
|
2953
|
+
return this[ge];
|
|
2954
2954
|
}
|
|
2955
|
-
[
|
|
2956
|
-
if (this[
|
|
2957
|
-
this[
|
|
2955
|
+
[Se](t) {
|
|
2956
|
+
if (this[ve]) this[be] += 1; else this[be] += t.length;
|
|
2957
|
+
this[we].push(t);
|
|
2958
2958
|
}
|
|
2959
|
-
[
|
|
2960
|
-
if (this[
|
|
2961
|
-
return this[
|
|
2959
|
+
[ke]() {
|
|
2960
|
+
if (this[ve]) this[be] -= 1; else this[be] -= this[we][0].length;
|
|
2961
|
+
return this[we].shift();
|
|
2962
2962
|
}
|
|
2963
|
-
[
|
|
2964
|
-
do {} while (this[
|
|
2965
|
-
if (!t && !this[
|
|
2963
|
+
[ce](t = false) {
|
|
2964
|
+
do {} while (this[fe](this[ke]()) && this[we].length);
|
|
2965
|
+
if (!t && !this[we].length && !this[ie]) this.emit("drain");
|
|
2966
2966
|
}
|
|
2967
|
-
[
|
|
2967
|
+
[fe](t) {
|
|
2968
2968
|
this.emit("data", t);
|
|
2969
|
-
return this[
|
|
2969
|
+
return this[pe];
|
|
2970
2970
|
}
|
|
2971
2971
|
pipe(t, e) {
|
|
2972
|
-
if (this[
|
|
2973
|
-
this[
|
|
2974
|
-
const s = this[
|
|
2972
|
+
if (this[xe]) return t;
|
|
2973
|
+
this[Oe] = false;
|
|
2974
|
+
const s = this[re];
|
|
2975
2975
|
e = e || {};
|
|
2976
|
-
if (t ===
|
|
2976
|
+
if (t === Qt.stdout || t === Qt.stderr) e.end = false; else e.end = e.end !== false;
|
|
2977
2977
|
e.proxyErrors = !!e.proxyErrors;
|
|
2978
2978
|
if (s) {
|
|
2979
2979
|
if (e.end) t.end();
|
|
2980
2980
|
} else {
|
|
2981
|
-
this[
|
|
2982
|
-
if (this[
|
|
2981
|
+
this[ye].push(!e.proxyErrors ? new Pipe(this, t, e) : new PipeProxyErrors(this, t, e));
|
|
2982
|
+
if (this[Ae]) ze((() => this[me]())); else this[me]();
|
|
2983
2983
|
}
|
|
2984
2984
|
return t;
|
|
2985
2985
|
}
|
|
2986
2986
|
unpipe(t) {
|
|
2987
|
-
const e = this[
|
|
2987
|
+
const e = this[ye].find((e => e.dest === t));
|
|
2988
2988
|
if (e) {
|
|
2989
|
-
if (this[
|
|
2990
|
-
if (this[
|
|
2991
|
-
this[
|
|
2989
|
+
if (this[ye].length === 1) {
|
|
2990
|
+
if (this[pe] && this[Re] === 0) {
|
|
2991
|
+
this[pe] = false;
|
|
2992
2992
|
}
|
|
2993
|
-
this[
|
|
2994
|
-
} else this[
|
|
2993
|
+
this[ye] = [];
|
|
2994
|
+
} else this[ye].splice(this[ye].indexOf(e), 1);
|
|
2995
2995
|
e.unpipe();
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
@@ -3001,19 +3001,19 @@ class Minipass extends r.EventEmitter {
|
|
|
3001
3001
|
on(t, e) {
|
|
3002
3002
|
const s = super.on(t, e);
|
|
3003
3003
|
if (t === "data") {
|
|
3004
|
-
this[
|
|
3005
|
-
this[
|
|
3006
|
-
if (!this[
|
|
3007
|
-
this[
|
|
3004
|
+
this[Oe] = false;
|
|
3005
|
+
this[Re]++;
|
|
3006
|
+
if (!this[ye].length && !this[pe]) {
|
|
3007
|
+
this[me]();
|
|
3008
3008
|
}
|
|
3009
|
-
} else if (t === "readable" && this[
|
|
3009
|
+
} else if (t === "readable" && this[be] !== 0) {
|
|
3010
3010
|
super.emit("readable");
|
|
3011
|
-
} else if (
|
|
3011
|
+
} else if (Ne(t) && this[re]) {
|
|
3012
3012
|
super.emit(t);
|
|
3013
3013
|
this.removeAllListeners(t);
|
|
3014
|
-
} else if (t === "error" && this[
|
|
3014
|
+
} else if (t === "error" && this[he]) {
|
|
3015
3015
|
const t = e;
|
|
3016
|
-
if (this[
|
|
3016
|
+
if (this[Ae]) ze((() => t.call(this, this[he]))); else t.call(this, this[he]);
|
|
3017
3017
|
}
|
|
3018
3018
|
return s;
|
|
3019
3019
|
}
|
|
@@ -3023,9 +3023,9 @@ class Minipass extends r.EventEmitter {
|
|
|
3023
3023
|
off(t, e) {
|
|
3024
3024
|
const s = super.off(t, e);
|
|
3025
3025
|
if (t === "data") {
|
|
3026
|
-
this[
|
|
3027
|
-
if (this[
|
|
3028
|
-
this[
|
|
3026
|
+
this[Re] = this.listeners("data").length;
|
|
3027
|
+
if (this[Re] === 0 && !this[Oe] && !this[ye].length) {
|
|
3028
|
+
this[pe] = false;
|
|
3029
3029
|
}
|
|
3030
3030
|
}
|
|
3031
3031
|
return s;
|
|
@@ -3033,49 +3033,49 @@ class Minipass extends r.EventEmitter {
|
|
|
3033
3033
|
removeAllListeners(t) {
|
|
3034
3034
|
const e = super.removeAllListeners(t);
|
|
3035
3035
|
if (t === "data" || t === undefined) {
|
|
3036
|
-
this[
|
|
3037
|
-
if (!this[
|
|
3038
|
-
this[
|
|
3036
|
+
this[Re] = 0;
|
|
3037
|
+
if (!this[Oe] && !this[ye].length) {
|
|
3038
|
+
this[pe] = false;
|
|
3039
3039
|
}
|
|
3040
3040
|
}
|
|
3041
3041
|
return e;
|
|
3042
3042
|
}
|
|
3043
3043
|
get emittedEnd() {
|
|
3044
|
-
return this[
|
|
3044
|
+
return this[re];
|
|
3045
3045
|
}
|
|
3046
|
-
[
|
|
3047
|
-
if (!this[
|
|
3048
|
-
this[
|
|
3046
|
+
[ne]() {
|
|
3047
|
+
if (!this[oe] && !this[re] && !this[xe] && this[we].length === 0 && this[ie]) {
|
|
3048
|
+
this[oe] = true;
|
|
3049
3049
|
this.emit("end");
|
|
3050
3050
|
this.emit("prefinish");
|
|
3051
3051
|
this.emit("finish");
|
|
3052
|
-
if (this[
|
|
3053
|
-
this[
|
|
3052
|
+
if (this[ae]) this.emit("close");
|
|
3053
|
+
this[oe] = false;
|
|
3054
3054
|
}
|
|
3055
3055
|
}
|
|
3056
3056
|
emit(t, ...e) {
|
|
3057
3057
|
const s = e[0];
|
|
3058
|
-
if (t !== "error" && t !== "close" && t !==
|
|
3058
|
+
if (t !== "error" && t !== "close" && t !== xe && this[xe]) {
|
|
3059
3059
|
return false;
|
|
3060
3060
|
} else if (t === "data") {
|
|
3061
|
-
return !this[
|
|
3061
|
+
return !this[ve] && !s ? false : this[Ae] ? (ze((() => this[Ce](s))), true) : this[Ce](s);
|
|
3062
3062
|
} else if (t === "end") {
|
|
3063
|
-
return this[
|
|
3063
|
+
return this[Te]();
|
|
3064
3064
|
} else if (t === "close") {
|
|
3065
|
-
this[
|
|
3066
|
-
if (!this[
|
|
3065
|
+
this[ae] = true;
|
|
3066
|
+
if (!this[re] && !this[xe]) return false;
|
|
3067
3067
|
const t = super.emit("close");
|
|
3068
3068
|
this.removeAllListeners("close");
|
|
3069
3069
|
return t;
|
|
3070
3070
|
} else if (t === "error") {
|
|
3071
|
-
this[
|
|
3072
|
-
super.emit(
|
|
3073
|
-
const t = !this[
|
|
3074
|
-
this[
|
|
3071
|
+
this[he] = s;
|
|
3072
|
+
super.emit(Ee, s);
|
|
3073
|
+
const t = !this[Fe] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
3074
|
+
this[ne]();
|
|
3075
3075
|
return t;
|
|
3076
3076
|
} else if (t === "resume") {
|
|
3077
3077
|
const t = super.emit("resume");
|
|
3078
|
-
this[
|
|
3078
|
+
this[ne]();
|
|
3079
3079
|
return t;
|
|
3080
3080
|
} else if (t === "finish" || t === "prefinish") {
|
|
3081
3081
|
const e = super.emit(t);
|
|
@@ -3083,34 +3083,34 @@ class Minipass extends r.EventEmitter {
|
|
|
3083
3083
|
return e;
|
|
3084
3084
|
}
|
|
3085
3085
|
const i = super.emit(t, ...e);
|
|
3086
|
-
this[
|
|
3086
|
+
this[ne]();
|
|
3087
3087
|
return i;
|
|
3088
3088
|
}
|
|
3089
|
-
[
|
|
3090
|
-
for (const e of this[
|
|
3089
|
+
[Ce](t) {
|
|
3090
|
+
for (const e of this[ye]) {
|
|
3091
3091
|
if (e.dest.write(t) === false) this.pause();
|
|
3092
3092
|
}
|
|
3093
|
-
const e = this[
|
|
3094
|
-
this[
|
|
3093
|
+
const e = this[Oe] ? false : super.emit("data", t);
|
|
3094
|
+
this[ne]();
|
|
3095
3095
|
return e;
|
|
3096
3096
|
}
|
|
3097
|
-
[
|
|
3098
|
-
if (this[
|
|
3099
|
-
this[
|
|
3097
|
+
[Te]() {
|
|
3098
|
+
if (this[re]) return false;
|
|
3099
|
+
this[re] = true;
|
|
3100
3100
|
this.readable = false;
|
|
3101
|
-
return this[
|
|
3101
|
+
return this[Ae] ? (ze((() => this[Le]())), true) : this[Le]();
|
|
3102
3102
|
}
|
|
3103
|
-
[
|
|
3104
|
-
if (this[
|
|
3105
|
-
const t = this[
|
|
3103
|
+
[Le]() {
|
|
3104
|
+
if (this[de]) {
|
|
3105
|
+
const t = this[de].end();
|
|
3106
3106
|
if (t) {
|
|
3107
|
-
for (const e of this[
|
|
3107
|
+
for (const e of this[ye]) {
|
|
3108
3108
|
e.dest.write(t);
|
|
3109
3109
|
}
|
|
3110
|
-
if (!this[
|
|
3110
|
+
if (!this[Oe]) super.emit("data", t);
|
|
3111
3111
|
}
|
|
3112
3112
|
}
|
|
3113
|
-
for (const t of this[
|
|
3113
|
+
for (const t of this[ye]) {
|
|
3114
3114
|
t.end();
|
|
3115
3115
|
}
|
|
3116
3116
|
const t = super.emit("end");
|
|
@@ -3121,33 +3121,33 @@ class Minipass extends r.EventEmitter {
|
|
|
3121
3121
|
const t = Object.assign([], {
|
|
3122
3122
|
dataLength: 0
|
|
3123
3123
|
});
|
|
3124
|
-
if (!this[
|
|
3124
|
+
if (!this[ve]) t.dataLength = 0;
|
|
3125
3125
|
const e = this.promise();
|
|
3126
3126
|
this.on("data", (e => {
|
|
3127
3127
|
t.push(e);
|
|
3128
|
-
if (!this[
|
|
3128
|
+
if (!this[ve]) t.dataLength += e.length;
|
|
3129
3129
|
}));
|
|
3130
3130
|
await e;
|
|
3131
3131
|
return t;
|
|
3132
3132
|
}
|
|
3133
3133
|
async concat() {
|
|
3134
|
-
if (this[
|
|
3134
|
+
if (this[ve]) {
|
|
3135
3135
|
throw new Error("cannot concat in objectMode");
|
|
3136
3136
|
}
|
|
3137
3137
|
const t = await this.collect();
|
|
3138
|
-
return this[
|
|
3138
|
+
return this[ue] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
3139
3139
|
}
|
|
3140
3140
|
async promise() {
|
|
3141
3141
|
return new Promise(((t, e) => {
|
|
3142
|
-
this.on(
|
|
3142
|
+
this.on(xe, (() => e(new Error("stream destroyed"))));
|
|
3143
3143
|
this.on("error", (t => e(t)));
|
|
3144
3144
|
this.on("end", (() => t()));
|
|
3145
3145
|
}));
|
|
3146
3146
|
}
|
|
3147
3147
|
[Symbol.asyncIterator]() {
|
|
3148
|
-
this[
|
|
3148
|
+
this[Oe] = false;
|
|
3149
3149
|
let t = false;
|
|
3150
|
-
const
|
|
3150
|
+
const e = async () => {
|
|
3151
3151
|
this.pause();
|
|
3152
3152
|
t = true;
|
|
3153
3153
|
return {
|
|
@@ -3155,123 +3155,123 @@ class Minipass extends r.EventEmitter {
|
|
|
3155
3155
|
done: true
|
|
3156
3156
|
};
|
|
3157
3157
|
};
|
|
3158
|
-
const
|
|
3159
|
-
if (t) return
|
|
3160
|
-
const
|
|
3161
|
-
if (
|
|
3158
|
+
const s = () => {
|
|
3159
|
+
if (t) return e();
|
|
3160
|
+
const s = this.read();
|
|
3161
|
+
if (s !== null) return Promise.resolve({
|
|
3162
3162
|
done: false,
|
|
3163
|
-
value:
|
|
3163
|
+
value: s
|
|
3164
3164
|
});
|
|
3165
|
-
if (this[
|
|
3166
|
-
let s;
|
|
3165
|
+
if (this[ie]) return e();
|
|
3167
3166
|
let i;
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
this.off("
|
|
3171
|
-
this.off(
|
|
3172
|
-
|
|
3173
|
-
|
|
3167
|
+
let n;
|
|
3168
|
+
const r = t => {
|
|
3169
|
+
this.off("data", o);
|
|
3170
|
+
this.off("end", h);
|
|
3171
|
+
this.off(xe, a);
|
|
3172
|
+
e();
|
|
3173
|
+
n(t);
|
|
3174
3174
|
};
|
|
3175
|
-
const
|
|
3176
|
-
this.off("error",
|
|
3177
|
-
this.off("end",
|
|
3178
|
-
this.off(
|
|
3175
|
+
const o = t => {
|
|
3176
|
+
this.off("error", r);
|
|
3177
|
+
this.off("end", h);
|
|
3178
|
+
this.off(xe, a);
|
|
3179
3179
|
this.pause();
|
|
3180
|
-
|
|
3180
|
+
i({
|
|
3181
3181
|
value: t,
|
|
3182
|
-
done: !!this[
|
|
3182
|
+
done: !!this[ie]
|
|
3183
3183
|
});
|
|
3184
3184
|
};
|
|
3185
|
-
const
|
|
3186
|
-
this.off("error",
|
|
3187
|
-
this.off("data",
|
|
3188
|
-
this.off(
|
|
3189
|
-
|
|
3190
|
-
|
|
3185
|
+
const h = () => {
|
|
3186
|
+
this.off("error", r);
|
|
3187
|
+
this.off("data", o);
|
|
3188
|
+
this.off(xe, a);
|
|
3189
|
+
e();
|
|
3190
|
+
i({
|
|
3191
3191
|
done: true,
|
|
3192
3192
|
value: undefined
|
|
3193
3193
|
});
|
|
3194
3194
|
};
|
|
3195
|
-
const
|
|
3195
|
+
const a = () => r(new Error("stream destroyed"));
|
|
3196
3196
|
return new Promise(((t, e) => {
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
this.once(
|
|
3200
|
-
this.once("error",
|
|
3201
|
-
this.once("end",
|
|
3202
|
-
this.once("data",
|
|
3197
|
+
n = e;
|
|
3198
|
+
i = t;
|
|
3199
|
+
this.once(xe, a);
|
|
3200
|
+
this.once("error", r);
|
|
3201
|
+
this.once("end", h);
|
|
3202
|
+
this.once("data", o);
|
|
3203
3203
|
}));
|
|
3204
3204
|
};
|
|
3205
3205
|
return {
|
|
3206
|
-
next,
|
|
3207
|
-
throw:
|
|
3208
|
-
return:
|
|
3206
|
+
next: s,
|
|
3207
|
+
throw: e,
|
|
3208
|
+
return: e,
|
|
3209
3209
|
[Symbol.asyncIterator]() {
|
|
3210
3210
|
return this;
|
|
3211
3211
|
}
|
|
3212
3212
|
};
|
|
3213
3213
|
}
|
|
3214
3214
|
[Symbol.iterator]() {
|
|
3215
|
-
this[
|
|
3215
|
+
this[Oe] = false;
|
|
3216
3216
|
let t = false;
|
|
3217
|
-
const
|
|
3217
|
+
const e = () => {
|
|
3218
3218
|
this.pause();
|
|
3219
|
-
this.off(
|
|
3220
|
-
this.off(
|
|
3221
|
-
this.off("end",
|
|
3219
|
+
this.off(Ee, e);
|
|
3220
|
+
this.off(xe, e);
|
|
3221
|
+
this.off("end", e);
|
|
3222
3222
|
t = true;
|
|
3223
3223
|
return {
|
|
3224
3224
|
done: true,
|
|
3225
3225
|
value: undefined
|
|
3226
3226
|
};
|
|
3227
3227
|
};
|
|
3228
|
-
const
|
|
3229
|
-
if (t) return
|
|
3230
|
-
const
|
|
3231
|
-
return
|
|
3228
|
+
const s = () => {
|
|
3229
|
+
if (t) return e();
|
|
3230
|
+
const s = this.read();
|
|
3231
|
+
return s === null ? e() : {
|
|
3232
3232
|
done: false,
|
|
3233
|
-
value:
|
|
3233
|
+
value: s
|
|
3234
3234
|
};
|
|
3235
3235
|
};
|
|
3236
|
-
this.once("end",
|
|
3237
|
-
this.once(
|
|
3238
|
-
this.once(
|
|
3236
|
+
this.once("end", e);
|
|
3237
|
+
this.once(Ee, e);
|
|
3238
|
+
this.once(xe, e);
|
|
3239
3239
|
return {
|
|
3240
|
-
next,
|
|
3241
|
-
throw:
|
|
3242
|
-
return:
|
|
3240
|
+
next: s,
|
|
3241
|
+
throw: e,
|
|
3242
|
+
return: e,
|
|
3243
3243
|
[Symbol.iterator]() {
|
|
3244
3244
|
return this;
|
|
3245
3245
|
}
|
|
3246
3246
|
};
|
|
3247
3247
|
}
|
|
3248
3248
|
destroy(t) {
|
|
3249
|
-
if (this[
|
|
3250
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3249
|
+
if (this[xe]) {
|
|
3250
|
+
if (t) this.emit("error", t); else this.emit(xe);
|
|
3251
3251
|
return this;
|
|
3252
3252
|
}
|
|
3253
|
-
this[
|
|
3254
|
-
this[
|
|
3255
|
-
this[
|
|
3256
|
-
this[
|
|
3253
|
+
this[xe] = true;
|
|
3254
|
+
this[Oe] = true;
|
|
3255
|
+
this[we].length = 0;
|
|
3256
|
+
this[be] = 0;
|
|
3257
3257
|
const e = this;
|
|
3258
|
-
if (typeof e.close === "function" && !this[
|
|
3259
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3258
|
+
if (typeof e.close === "function" && !this[ae]) e.close();
|
|
3259
|
+
if (t) this.emit("error", t); else this.emit(xe);
|
|
3260
3260
|
return this;
|
|
3261
3261
|
}
|
|
3262
3262
|
static get isStream() {
|
|
3263
|
-
return
|
|
3263
|
+
return te;
|
|
3264
3264
|
}
|
|
3265
3265
|
}
|
|
3266
3266
|
|
|
3267
|
-
const
|
|
3267
|
+
const je = s.realpathSync.native;
|
|
3268
3268
|
|
|
3269
|
-
const
|
|
3269
|
+
const $e = {
|
|
3270
3270
|
lstatSync: s.lstatSync,
|
|
3271
3271
|
readdir: s.readdir,
|
|
3272
3272
|
readdirSync: s.readdirSync,
|
|
3273
3273
|
readlinkSync: s.readlinkSync,
|
|
3274
|
-
realpathSync:
|
|
3274
|
+
realpathSync: je,
|
|
3275
3275
|
promises: {
|
|
3276
3276
|
lstat: n.lstat,
|
|
3277
3277
|
readdir: n.readdir,
|
|
@@ -3280,76 +3280,76 @@ const Nt = {
|
|
|
3280
3280
|
}
|
|
3281
3281
|
};
|
|
3282
3282
|
|
|
3283
|
-
const
|
|
3284
|
-
|
|
3283
|
+
const Ue = t => !t || t === $e || t === c ? $e : {
|
|
3284
|
+
...$e,
|
|
3285
3285
|
...t,
|
|
3286
3286
|
promises: {
|
|
3287
|
-
|
|
3287
|
+
...$e.promises,
|
|
3288
3288
|
...t.promises || {}
|
|
3289
3289
|
}
|
|
3290
3290
|
};
|
|
3291
3291
|
|
|
3292
|
-
const
|
|
3292
|
+
const Ge = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
3293
3293
|
|
|
3294
|
-
const
|
|
3294
|
+
const qe = t => t.replace(/\//g, "\\").replace(Ge, "$1\\");
|
|
3295
3295
|
|
|
3296
|
-
const
|
|
3296
|
+
const He = /[\\\/]/;
|
|
3297
3297
|
|
|
3298
|
-
const
|
|
3298
|
+
const Ze = 0;
|
|
3299
3299
|
|
|
3300
|
-
const
|
|
3300
|
+
const Ve = 1;
|
|
3301
3301
|
|
|
3302
|
-
const
|
|
3302
|
+
const Je = 2;
|
|
3303
3303
|
|
|
3304
|
-
const
|
|
3304
|
+
const Ke = 4;
|
|
3305
3305
|
|
|
3306
|
-
const
|
|
3306
|
+
const Ye = 6;
|
|
3307
3307
|
|
|
3308
|
-
const
|
|
3308
|
+
const Xe = 8;
|
|
3309
3309
|
|
|
3310
|
-
const
|
|
3310
|
+
const Qe = 10;
|
|
3311
3311
|
|
|
3312
|
-
const
|
|
3312
|
+
const ts = 12;
|
|
3313
3313
|
|
|
3314
|
-
const
|
|
3314
|
+
const es = 15;
|
|
3315
3315
|
|
|
3316
|
-
const
|
|
3316
|
+
const ss = ~es;
|
|
3317
3317
|
|
|
3318
|
-
const
|
|
3318
|
+
const is = 16;
|
|
3319
3319
|
|
|
3320
|
-
const
|
|
3320
|
+
const ns = 32;
|
|
3321
3321
|
|
|
3322
|
-
const
|
|
3322
|
+
const rs = 64;
|
|
3323
3323
|
|
|
3324
|
-
const
|
|
3324
|
+
const os = 128;
|
|
3325
3325
|
|
|
3326
|
-
const
|
|
3326
|
+
const hs = 256;
|
|
3327
3327
|
|
|
3328
|
-
const
|
|
3328
|
+
const as = 512;
|
|
3329
3329
|
|
|
3330
|
-
const
|
|
3330
|
+
const ls = rs | os | as;
|
|
3331
3331
|
|
|
3332
|
-
const
|
|
3332
|
+
const cs = 1023;
|
|
3333
3333
|
|
|
3334
|
-
const
|
|
3334
|
+
const fs = t => t.isFile() ? Xe : t.isDirectory() ? Ke : t.isSymbolicLink() ? Qe : t.isCharacterDevice() ? Je : t.isBlockDevice() ? Ye : t.isSocket() ? ts : t.isFIFO() ? Ve : Ze;
|
|
3335
3335
|
|
|
3336
|
-
const
|
|
3336
|
+
const us = new Map;
|
|
3337
3337
|
|
|
3338
|
-
const
|
|
3339
|
-
const e =
|
|
3338
|
+
const ds = t => {
|
|
3339
|
+
const e = us.get(t);
|
|
3340
3340
|
if (e) return e;
|
|
3341
3341
|
const s = t.normalize("NFKD");
|
|
3342
|
-
|
|
3342
|
+
us.set(t, s);
|
|
3343
3343
|
return s;
|
|
3344
3344
|
};
|
|
3345
3345
|
|
|
3346
|
-
const
|
|
3346
|
+
const ps = new Map;
|
|
3347
3347
|
|
|
3348
|
-
const
|
|
3349
|
-
const e =
|
|
3348
|
+
const gs = t => {
|
|
3349
|
+
const e = ps.get(t);
|
|
3350
3350
|
if (e) return e;
|
|
3351
|
-
const s =
|
|
3352
|
-
|
|
3351
|
+
const s = ds(t.toLowerCase());
|
|
3352
|
+
ps.set(t, s);
|
|
3353
3353
|
return s;
|
|
3354
3354
|
};
|
|
3355
3355
|
|
|
@@ -3370,7 +3370,7 @@ class ChildrenCache extends LRUCache {
|
|
|
3370
3370
|
}
|
|
3371
3371
|
}
|
|
3372
3372
|
|
|
3373
|
-
const
|
|
3373
|
+
const ms = Symbol("PathScurry setAsCwd");
|
|
3374
3374
|
|
|
3375
3375
|
class PathBase {
|
|
3376
3376
|
name;
|
|
@@ -3412,9 +3412,9 @@ class PathBase {
|
|
|
3412
3412
|
get ino() {
|
|
3413
3413
|
return this.#pt;
|
|
3414
3414
|
}
|
|
3415
|
-
#
|
|
3415
|
+
#x;
|
|
3416
3416
|
get size() {
|
|
3417
|
-
return this.#
|
|
3417
|
+
return this.#x;
|
|
3418
3418
|
}
|
|
3419
3419
|
#gt;
|
|
3420
3420
|
get blocks() {
|
|
@@ -3424,13 +3424,13 @@ class PathBase {
|
|
|
3424
3424
|
get atimeMs() {
|
|
3425
3425
|
return this.#mt;
|
|
3426
3426
|
}
|
|
3427
|
-
#
|
|
3427
|
+
#wt;
|
|
3428
3428
|
get mtimeMs() {
|
|
3429
|
-
return this.#
|
|
3429
|
+
return this.#wt;
|
|
3430
3430
|
}
|
|
3431
|
-
#
|
|
3431
|
+
#yt;
|
|
3432
3432
|
get ctimeMs() {
|
|
3433
|
-
return this.#
|
|
3433
|
+
return this.#yt;
|
|
3434
3434
|
}
|
|
3435
3435
|
#bt;
|
|
3436
3436
|
get birthtimeMs() {
|
|
@@ -3444,13 +3444,13 @@ class PathBase {
|
|
|
3444
3444
|
get mtime() {
|
|
3445
3445
|
return this.#kt;
|
|
3446
3446
|
}
|
|
3447
|
-
#
|
|
3447
|
+
#vt;
|
|
3448
3448
|
get ctime() {
|
|
3449
|
-
return this.#
|
|
3449
|
+
return this.#vt;
|
|
3450
3450
|
}
|
|
3451
|
-
#
|
|
3451
|
+
#xt;
|
|
3452
3452
|
get birthtime() {
|
|
3453
|
-
return this.#
|
|
3453
|
+
return this.#xt;
|
|
3454
3454
|
}
|
|
3455
3455
|
#Et;
|
|
3456
3456
|
#Ct;
|
|
@@ -3468,10 +3468,10 @@ class PathBase {
|
|
|
3468
3468
|
get path() {
|
|
3469
3469
|
return this.parentPath;
|
|
3470
3470
|
}
|
|
3471
|
-
constructor(t, e =
|
|
3471
|
+
constructor(t, e = Ze, s, i, n, r, o) {
|
|
3472
3472
|
this.name = t;
|
|
3473
|
-
this.#Et = n ?
|
|
3474
|
-
this.#Pt = e &
|
|
3473
|
+
this.#Et = n ? gs(t) : ds(t);
|
|
3474
|
+
this.#Pt = e & cs;
|
|
3475
3475
|
this.nocase = n;
|
|
3476
3476
|
this.roots = i;
|
|
3477
3477
|
this.root = s || this;
|
|
@@ -3483,7 +3483,7 @@ class PathBase {
|
|
|
3483
3483
|
if (this.parent) {
|
|
3484
3484
|
this.#ot = this.parent.#ot;
|
|
3485
3485
|
} else {
|
|
3486
|
-
this.#ot =
|
|
3486
|
+
this.#ot = Ue(o.fs);
|
|
3487
3487
|
}
|
|
3488
3488
|
}
|
|
3489
3489
|
depth() {
|
|
@@ -3520,7 +3520,7 @@ class PathBase {
|
|
|
3520
3520
|
provisional: 0
|
|
3521
3521
|
});
|
|
3522
3522
|
this.#Ft.set(this, e);
|
|
3523
|
-
this.#Pt &= ~
|
|
3523
|
+
this.#Pt &= ~is;
|
|
3524
3524
|
return e;
|
|
3525
3525
|
}
|
|
3526
3526
|
child(t, e) {
|
|
@@ -3531,7 +3531,7 @@ class PathBase {
|
|
|
3531
3531
|
return this.parent || this;
|
|
3532
3532
|
}
|
|
3533
3533
|
const s = this.children();
|
|
3534
|
-
const i = this.nocase ?
|
|
3534
|
+
const i = this.nocase ? gs(t) : ds(t);
|
|
3535
3535
|
for (const t of s) {
|
|
3536
3536
|
if (t.#Et === i) {
|
|
3537
3537
|
return t;
|
|
@@ -3539,13 +3539,13 @@ class PathBase {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
const n = this.parent ? this.sep : "";
|
|
3541
3541
|
const r = this.#Tt ? this.#Tt + n + t : undefined;
|
|
3542
|
-
const o = this.newChild(t,
|
|
3542
|
+
const o = this.newChild(t, Ze, {
|
|
3543
3543
|
...e,
|
|
3544
3544
|
parent: this,
|
|
3545
3545
|
fullpath: r
|
|
3546
3546
|
});
|
|
3547
3547
|
if (!this.canReaddir()) {
|
|
3548
|
-
o.#Pt |=
|
|
3548
|
+
o.#Pt |= os;
|
|
3549
3549
|
}
|
|
3550
3550
|
s.push(o);
|
|
3551
3551
|
return o;
|
|
@@ -3605,7 +3605,7 @@ class PathBase {
|
|
|
3605
3605
|
return this.#Lt = s;
|
|
3606
3606
|
}
|
|
3607
3607
|
isUnknown() {
|
|
3608
|
-
return (this.#Pt &
|
|
3608
|
+
return (this.#Pt & es) === Ze;
|
|
3609
3609
|
}
|
|
3610
3610
|
isType(t) {
|
|
3611
3611
|
return this[`is${t}`]();
|
|
@@ -3614,28 +3614,28 @@ class PathBase {
|
|
|
3614
3614
|
return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown";
|
|
3615
3615
|
}
|
|
3616
3616
|
isFile() {
|
|
3617
|
-
return (this.#Pt &
|
|
3617
|
+
return (this.#Pt & es) === Xe;
|
|
3618
3618
|
}
|
|
3619
3619
|
isDirectory() {
|
|
3620
|
-
return (this.#Pt &
|
|
3620
|
+
return (this.#Pt & es) === Ke;
|
|
3621
3621
|
}
|
|
3622
3622
|
isCharacterDevice() {
|
|
3623
|
-
return (this.#Pt &
|
|
3623
|
+
return (this.#Pt & es) === Je;
|
|
3624
3624
|
}
|
|
3625
3625
|
isBlockDevice() {
|
|
3626
|
-
return (this.#Pt &
|
|
3626
|
+
return (this.#Pt & es) === Ye;
|
|
3627
3627
|
}
|
|
3628
3628
|
isFIFO() {
|
|
3629
|
-
return (this.#Pt &
|
|
3629
|
+
return (this.#Pt & es) === Ve;
|
|
3630
3630
|
}
|
|
3631
3631
|
isSocket() {
|
|
3632
|
-
return (this.#Pt &
|
|
3632
|
+
return (this.#Pt & es) === ts;
|
|
3633
3633
|
}
|
|
3634
3634
|
isSymbolicLink() {
|
|
3635
|
-
return (this.#Pt &
|
|
3635
|
+
return (this.#Pt & Qe) === Qe;
|
|
3636
3636
|
}
|
|
3637
3637
|
lstatCached() {
|
|
3638
|
-
return this.#Pt &
|
|
3638
|
+
return this.#Pt & ns ? this : undefined;
|
|
3639
3639
|
}
|
|
3640
3640
|
readlinkCached() {
|
|
3641
3641
|
return this.#Rt;
|
|
@@ -3650,17 +3650,17 @@ class PathBase {
|
|
|
3650
3650
|
canReadlink() {
|
|
3651
3651
|
if (this.#Rt) return true;
|
|
3652
3652
|
if (!this.parent) return false;
|
|
3653
|
-
const t = this.#Pt &
|
|
3654
|
-
return !(t !==
|
|
3653
|
+
const t = this.#Pt & es;
|
|
3654
|
+
return !(t !== Ze && t !== Qe || this.#Pt & hs || this.#Pt & os);
|
|
3655
3655
|
}
|
|
3656
3656
|
calledReaddir() {
|
|
3657
|
-
return !!(this.#Pt &
|
|
3657
|
+
return !!(this.#Pt & is);
|
|
3658
3658
|
}
|
|
3659
3659
|
isENOENT() {
|
|
3660
|
-
return !!(this.#Pt &
|
|
3660
|
+
return !!(this.#Pt & os);
|
|
3661
3661
|
}
|
|
3662
3662
|
isNamed(t) {
|
|
3663
|
-
return !this.nocase ? this.#Et ===
|
|
3663
|
+
return !this.nocase ? this.#Et === ds(t) : this.#Et === gs(t);
|
|
3664
3664
|
}
|
|
3665
3665
|
async readlink() {
|
|
3666
3666
|
const t = this.#Rt;
|
|
@@ -3707,18 +3707,18 @@ class PathBase {
|
|
|
3707
3707
|
}
|
|
3708
3708
|
}
|
|
3709
3709
|
#Nt(t) {
|
|
3710
|
-
this.#Pt |=
|
|
3710
|
+
this.#Pt |= is;
|
|
3711
3711
|
for (let e = t.provisional; e < t.length; e++) {
|
|
3712
3712
|
const s = t[e];
|
|
3713
3713
|
if (s) s.#Bt();
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
3716
|
#Bt() {
|
|
3717
|
-
if (this.#Pt &
|
|
3718
|
-
this.#Pt = (this.#Pt |
|
|
3719
|
-
this.#
|
|
3717
|
+
if (this.#Pt & os) return;
|
|
3718
|
+
this.#Pt = (this.#Pt | os) & ss;
|
|
3719
|
+
this.#Wt();
|
|
3720
3720
|
}
|
|
3721
|
-
#
|
|
3721
|
+
#Wt() {
|
|
3722
3722
|
const t = this.children();
|
|
3723
3723
|
t.provisional = 0;
|
|
3724
3724
|
for (const e of t) {
|
|
@@ -3726,19 +3726,19 @@ class PathBase {
|
|
|
3726
3726
|
}
|
|
3727
3727
|
}
|
|
3728
3728
|
#It() {
|
|
3729
|
-
this.#Pt |=
|
|
3730
|
-
this.#
|
|
3729
|
+
this.#Pt |= as;
|
|
3730
|
+
this.#_t();
|
|
3731
3731
|
}
|
|
3732
|
-
#
|
|
3733
|
-
if (this.#Pt &
|
|
3732
|
+
#_t() {
|
|
3733
|
+
if (this.#Pt & rs) return;
|
|
3734
3734
|
let t = this.#Pt;
|
|
3735
|
-
if ((t &
|
|
3736
|
-
this.#Pt = t |
|
|
3737
|
-
this.#
|
|
3735
|
+
if ((t & es) === Ke) t &= ss;
|
|
3736
|
+
this.#Pt = t | rs;
|
|
3737
|
+
this.#Wt();
|
|
3738
3738
|
}
|
|
3739
3739
|
#jt(t = "") {
|
|
3740
3740
|
if (t === "ENOTDIR" || t === "EPERM") {
|
|
3741
|
-
this.#
|
|
3741
|
+
this.#_t();
|
|
3742
3742
|
} else if (t === "ENOENT") {
|
|
3743
3743
|
this.#Bt();
|
|
3744
3744
|
} else {
|
|
@@ -3748,43 +3748,43 @@ class PathBase {
|
|
|
3748
3748
|
#$t(t = "") {
|
|
3749
3749
|
if (t === "ENOTDIR") {
|
|
3750
3750
|
const t = this.parent;
|
|
3751
|
-
t.#
|
|
3751
|
+
t.#_t();
|
|
3752
3752
|
} else if (t === "ENOENT") {
|
|
3753
3753
|
this.#Bt();
|
|
3754
3754
|
}
|
|
3755
3755
|
}
|
|
3756
3756
|
#Dt(t = "") {
|
|
3757
3757
|
let e = this.#Pt;
|
|
3758
|
-
e |=
|
|
3759
|
-
if (t === "ENOENT") e |=
|
|
3758
|
+
e |= hs;
|
|
3759
|
+
if (t === "ENOENT") e |= os;
|
|
3760
3760
|
if (t === "EINVAL" || t === "UNKNOWN") {
|
|
3761
|
-
e &=
|
|
3761
|
+
e &= ss;
|
|
3762
3762
|
}
|
|
3763
3763
|
this.#Pt = e;
|
|
3764
3764
|
if (t === "ENOTDIR" && this.parent) {
|
|
3765
|
-
this.parent.#
|
|
3765
|
+
this.parent.#_t();
|
|
3766
3766
|
}
|
|
3767
3767
|
}
|
|
3768
|
-
#
|
|
3769
|
-
return this.#
|
|
3768
|
+
#Ut(t, e) {
|
|
3769
|
+
return this.#Gt(t, e) || this.#qt(t, e);
|
|
3770
3770
|
}
|
|
3771
3771
|
#qt(t, e) {
|
|
3772
|
-
const s =
|
|
3772
|
+
const s = fs(t);
|
|
3773
3773
|
const i = this.newChild(t.name, s, {
|
|
3774
3774
|
parent: this
|
|
3775
3775
|
});
|
|
3776
|
-
const n = i.#Pt &
|
|
3777
|
-
if (n !==
|
|
3778
|
-
i.#Pt |=
|
|
3776
|
+
const n = i.#Pt & es;
|
|
3777
|
+
if (n !== Ke && n !== Qe && n !== Ze) {
|
|
3778
|
+
i.#Pt |= rs;
|
|
3779
3779
|
}
|
|
3780
3780
|
e.unshift(i);
|
|
3781
3781
|
e.provisional++;
|
|
3782
3782
|
return i;
|
|
3783
3783
|
}
|
|
3784
|
-
#
|
|
3784
|
+
#Gt(t, e) {
|
|
3785
3785
|
for (let s = e.provisional; s < e.length; s++) {
|
|
3786
3786
|
const i = e[s];
|
|
3787
|
-
const n = this.nocase ?
|
|
3787
|
+
const n = this.nocase ? gs(t.name) : ds(t.name);
|
|
3788
3788
|
if (n !== i.#Et) {
|
|
3789
3789
|
continue;
|
|
3790
3790
|
}
|
|
@@ -3793,7 +3793,7 @@ class PathBase {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
#Ht(t, e, s, i) {
|
|
3795
3795
|
const n = e.name;
|
|
3796
|
-
e.#Pt = e.#Pt &
|
|
3796
|
+
e.#Pt = e.#Pt & ss | fs(t);
|
|
3797
3797
|
if (n !== t.name) e.name = t.name;
|
|
3798
3798
|
if (s !== i.provisional) {
|
|
3799
3799
|
if (s === i.length - 1) i.pop(); else i.splice(s, 1);
|
|
@@ -3803,7 +3803,7 @@ class PathBase {
|
|
|
3803
3803
|
return e;
|
|
3804
3804
|
}
|
|
3805
3805
|
async lstat() {
|
|
3806
|
-
if ((this.#Pt &
|
|
3806
|
+
if ((this.#Pt & os) === 0) {
|
|
3807
3807
|
try {
|
|
3808
3808
|
this.#Zt(await this.#ot.promises.lstat(this.fullpath()));
|
|
3809
3809
|
return this;
|
|
@@ -3813,7 +3813,7 @@ class PathBase {
|
|
|
3813
3813
|
}
|
|
3814
3814
|
}
|
|
3815
3815
|
lstatSync() {
|
|
3816
|
-
if ((this.#Pt &
|
|
3816
|
+
if ((this.#Pt & os) === 0) {
|
|
3817
3817
|
try {
|
|
3818
3818
|
this.#Zt(this.#ot.lstatSync(this.fullpath()));
|
|
3819
3819
|
return this;
|
|
@@ -3823,29 +3823,29 @@ class PathBase {
|
|
|
3823
3823
|
}
|
|
3824
3824
|
}
|
|
3825
3825
|
#Zt(t) {
|
|
3826
|
-
const {atime: e, atimeMs: s, birthtime: i, birthtimeMs: n, blksize: r, blocks: o, ctime: h, ctimeMs: a, dev: l, gid: c, ino: f, mode: u, mtime: d, mtimeMs: p, nlink: g, rdev:
|
|
3826
|
+
const {atime: e, atimeMs: s, birthtime: i, birthtimeMs: n, blksize: r, blocks: o, ctime: h, ctimeMs: a, dev: l, gid: c, ino: f, mode: u, mtime: d, mtimeMs: p, nlink: g, rdev: m, size: w, uid: y} = t;
|
|
3827
3827
|
this.#St = e;
|
|
3828
3828
|
this.#mt = s;
|
|
3829
|
-
this.#
|
|
3829
|
+
this.#xt = i;
|
|
3830
3830
|
this.#bt = n;
|
|
3831
3831
|
this.#dt = r;
|
|
3832
3832
|
this.#gt = o;
|
|
3833
|
-
this.#
|
|
3834
|
-
this.#
|
|
3833
|
+
this.#vt = h;
|
|
3834
|
+
this.#yt = a;
|
|
3835
3835
|
this.#ht = l;
|
|
3836
3836
|
this.#ft = c;
|
|
3837
3837
|
this.#pt = f;
|
|
3838
3838
|
this.#at = u;
|
|
3839
3839
|
this.#kt = d;
|
|
3840
|
-
this.#
|
|
3840
|
+
this.#wt = p;
|
|
3841
3841
|
this.#lt = g;
|
|
3842
|
-
this.#ut =
|
|
3843
|
-
this.#
|
|
3844
|
-
this.#ct =
|
|
3845
|
-
const
|
|
3846
|
-
this.#Pt = this.#Pt &
|
|
3847
|
-
if (
|
|
3848
|
-
this.#Pt |=
|
|
3842
|
+
this.#ut = m;
|
|
3843
|
+
this.#x = w;
|
|
3844
|
+
this.#ct = y;
|
|
3845
|
+
const b = fs(t);
|
|
3846
|
+
this.#Pt = this.#Pt & ss | b | ns;
|
|
3847
|
+
if (b !== Ze && b !== Ke && b !== Qe) {
|
|
3848
|
+
this.#Pt |= rs;
|
|
3849
3849
|
}
|
|
3850
3850
|
}
|
|
3851
3851
|
#Vt=[];
|
|
@@ -3881,7 +3881,7 @@ class PathBase {
|
|
|
3881
3881
|
s.provisional = 0;
|
|
3882
3882
|
} else {
|
|
3883
3883
|
for (const t of e) {
|
|
3884
|
-
this.#
|
|
3884
|
+
this.#Ut(t, s);
|
|
3885
3885
|
}
|
|
3886
3886
|
this.#Nt(s);
|
|
3887
3887
|
}
|
|
@@ -3902,13 +3902,13 @@ class PathBase {
|
|
|
3902
3902
|
if (this.#Yt) {
|
|
3903
3903
|
await this.#Yt;
|
|
3904
3904
|
} else {
|
|
3905
|
-
let
|
|
3906
|
-
this.#Yt = new Promise((t =>
|
|
3905
|
+
let s = () => {};
|
|
3906
|
+
this.#Yt = new Promise((t => s = t));
|
|
3907
3907
|
try {
|
|
3908
3908
|
for (const s of await this.#ot.promises.readdir(e, {
|
|
3909
3909
|
withFileTypes: true
|
|
3910
3910
|
})) {
|
|
3911
|
-
this.#
|
|
3911
|
+
this.#Ut(s, t);
|
|
3912
3912
|
}
|
|
3913
3913
|
this.#Nt(t);
|
|
3914
3914
|
} catch (e) {
|
|
@@ -3916,7 +3916,7 @@ class PathBase {
|
|
|
3916
3916
|
t.provisional = 0;
|
|
3917
3917
|
}
|
|
3918
3918
|
this.#Yt = undefined;
|
|
3919
|
-
|
|
3919
|
+
s();
|
|
3920
3920
|
}
|
|
3921
3921
|
return t.slice(0, t.provisional);
|
|
3922
3922
|
}
|
|
@@ -3933,7 +3933,7 @@ class PathBase {
|
|
|
3933
3933
|
for (const s of this.#ot.readdirSync(e, {
|
|
3934
3934
|
withFileTypes: true
|
|
3935
3935
|
})) {
|
|
3936
|
-
this.#
|
|
3936
|
+
this.#Ut(s, t);
|
|
3937
3937
|
}
|
|
3938
3938
|
this.#Nt(t);
|
|
3939
3939
|
} catch (e) {
|
|
@@ -3943,19 +3943,19 @@ class PathBase {
|
|
|
3943
3943
|
return t.slice(0, t.provisional);
|
|
3944
3944
|
}
|
|
3945
3945
|
canReaddir() {
|
|
3946
|
-
if (this.#Pt &
|
|
3947
|
-
const t =
|
|
3948
|
-
if (!(t ===
|
|
3946
|
+
if (this.#Pt & ls) return false;
|
|
3947
|
+
const t = es & this.#Pt;
|
|
3948
|
+
if (!(t === Ze || t === Ke || t === Qe)) {
|
|
3949
3949
|
return false;
|
|
3950
3950
|
}
|
|
3951
3951
|
return true;
|
|
3952
3952
|
}
|
|
3953
3953
|
shouldWalk(t, e) {
|
|
3954
|
-
return (this.#Pt &
|
|
3954
|
+
return (this.#Pt & Ke) === Ke && !(this.#Pt & ls) && !t.has(this) && (!e || e(this));
|
|
3955
3955
|
}
|
|
3956
3956
|
async realpath() {
|
|
3957
3957
|
if (this.#Ot) return this.#Ot;
|
|
3958
|
-
if ((
|
|
3958
|
+
if ((as | hs | os) & this.#Pt) return undefined;
|
|
3959
3959
|
try {
|
|
3960
3960
|
const t = await this.#ot.promises.realpath(this.fullpath());
|
|
3961
3961
|
return this.#Ot = this.resolve(t);
|
|
@@ -3965,7 +3965,7 @@ class PathBase {
|
|
|
3965
3965
|
}
|
|
3966
3966
|
realpathSync() {
|
|
3967
3967
|
if (this.#Ot) return this.#Ot;
|
|
3968
|
-
if ((
|
|
3968
|
+
if ((as | hs | os) & this.#Pt) return undefined;
|
|
3969
3969
|
try {
|
|
3970
3970
|
const t = this.#ot.realpathSync(this.fullpath());
|
|
3971
3971
|
return this.#Ot = this.resolve(t);
|
|
@@ -3973,7 +3973,7 @@ class PathBase {
|
|
|
3973
3973
|
this.#It();
|
|
3974
3974
|
}
|
|
3975
3975
|
}
|
|
3976
|
-
[
|
|
3976
|
+
[ms](t) {
|
|
3977
3977
|
if (t === this) return;
|
|
3978
3978
|
t.isCWD = false;
|
|
3979
3979
|
this.isCWD = true;
|
|
@@ -3998,18 +3998,18 @@ class PathBase {
|
|
|
3998
3998
|
|
|
3999
3999
|
class PathWin32 extends PathBase {
|
|
4000
4000
|
sep="\\";
|
|
4001
|
-
splitSep=
|
|
4002
|
-
constructor(t, e =
|
|
4001
|
+
splitSep=He;
|
|
4002
|
+
constructor(t, e = Ze, s, i, n, r, o) {
|
|
4003
4003
|
super(t, e, s, i, n, r, o);
|
|
4004
4004
|
}
|
|
4005
|
-
newChild(t, e =
|
|
4005
|
+
newChild(t, e = Ze, s = {}) {
|
|
4006
4006
|
return new PathWin32(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
4007
4007
|
}
|
|
4008
4008
|
getRootString(t) {
|
|
4009
4009
|
return e.win32.parse(t).root;
|
|
4010
4010
|
}
|
|
4011
4011
|
getRoot(t) {
|
|
4012
|
-
t =
|
|
4012
|
+
t = qe(t.toUpperCase());
|
|
4013
4013
|
if (t === this.root.name) {
|
|
4014
4014
|
return this.root;
|
|
4015
4015
|
}
|
|
@@ -4021,7 +4021,7 @@ class PathWin32 extends PathBase {
|
|
|
4021
4021
|
return this.roots[t] = new PathScurryWin32(t, this).root;
|
|
4022
4022
|
}
|
|
4023
4023
|
sameRoot(t, e = this.root.name) {
|
|
4024
|
-
t = t.toUpperCase().replace(/\//g, "\\").replace(
|
|
4024
|
+
t = t.toUpperCase().replace(/\//g, "\\").replace(Ge, "$1\\");
|
|
4025
4025
|
return t === e;
|
|
4026
4026
|
}
|
|
4027
4027
|
}
|
|
@@ -4029,7 +4029,7 @@ class PathWin32 extends PathBase {
|
|
|
4029
4029
|
class PathPosix extends PathBase {
|
|
4030
4030
|
splitSep="/";
|
|
4031
4031
|
sep="/";
|
|
4032
|
-
constructor(t, e =
|
|
4032
|
+
constructor(t, e = Ze, s, i, n, r, o) {
|
|
4033
4033
|
super(t, e, s, i, n, r, o);
|
|
4034
4034
|
}
|
|
4035
4035
|
getRootString(t) {
|
|
@@ -4038,7 +4038,7 @@ class PathPosix extends PathBase {
|
|
|
4038
4038
|
getRoot(t) {
|
|
4039
4039
|
return this.root;
|
|
4040
4040
|
}
|
|
4041
|
-
newChild(t, e =
|
|
4041
|
+
newChild(t, e = Ze, s = {}) {
|
|
4042
4042
|
return new PathPosix(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
4043
4043
|
}
|
|
4044
4044
|
}
|
|
@@ -4053,8 +4053,8 @@ class PathScurryBase {
|
|
|
4053
4053
|
#Ft;
|
|
4054
4054
|
nocase;
|
|
4055
4055
|
#ot;
|
|
4056
|
-
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o =
|
|
4057
|
-
this.#ot =
|
|
4056
|
+
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o = $e} = {}) {
|
|
4057
|
+
this.#ot = Ue(o);
|
|
4058
4058
|
if (e instanceof URL || e.startsWith("file://")) {
|
|
4059
4059
|
e = t.fileURLToPath(e);
|
|
4060
4060
|
}
|
|
@@ -4267,38 +4267,38 @@ class PathScurryBase {
|
|
|
4267
4267
|
o.push(s ? t : t.fullpath());
|
|
4268
4268
|
}
|
|
4269
4269
|
const h = new Set;
|
|
4270
|
-
const
|
|
4270
|
+
const a = (t, e) => {
|
|
4271
4271
|
h.add(t);
|
|
4272
|
-
t.readdirCB(((t,
|
|
4272
|
+
t.readdirCB(((t, l) => {
|
|
4273
4273
|
if (t) {
|
|
4274
4274
|
return e(t);
|
|
4275
4275
|
}
|
|
4276
|
-
let
|
|
4277
|
-
if (!
|
|
4278
|
-
const
|
|
4279
|
-
if (--
|
|
4276
|
+
let c = l.length;
|
|
4277
|
+
if (!c) return e();
|
|
4278
|
+
const f = () => {
|
|
4279
|
+
if (--c === 0) {
|
|
4280
4280
|
e();
|
|
4281
4281
|
}
|
|
4282
4282
|
};
|
|
4283
|
-
for (const t of
|
|
4283
|
+
for (const t of l) {
|
|
4284
4284
|
if (!n || n(t)) {
|
|
4285
4285
|
o.push(s ? t : t.fullpath());
|
|
4286
4286
|
}
|
|
4287
4287
|
if (i && t.isSymbolicLink()) {
|
|
4288
|
-
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ?
|
|
4288
|
+
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ? a(t, f) : f()));
|
|
4289
4289
|
} else {
|
|
4290
4290
|
if (t.shouldWalk(h, r)) {
|
|
4291
|
-
|
|
4291
|
+
a(t, f);
|
|
4292
4292
|
} else {
|
|
4293
|
-
|
|
4293
|
+
f();
|
|
4294
4294
|
}
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
4297
4297
|
}), true);
|
|
4298
4298
|
};
|
|
4299
|
-
const
|
|
4299
|
+
const l = t;
|
|
4300
4300
|
return new Promise(((t, e) => {
|
|
4301
|
-
|
|
4301
|
+
a(l, (s => {
|
|
4302
4302
|
if (s) return e(s);
|
|
4303
4303
|
t(o);
|
|
4304
4304
|
}));
|
|
@@ -4396,7 +4396,7 @@ class PathScurryBase {
|
|
|
4396
4396
|
const h = new Set;
|
|
4397
4397
|
const a = [ t ];
|
|
4398
4398
|
let l = 0;
|
|
4399
|
-
const
|
|
4399
|
+
const c = () => {
|
|
4400
4400
|
let t = false;
|
|
4401
4401
|
while (!t) {
|
|
4402
4402
|
const e = a.shift();
|
|
@@ -4406,21 +4406,21 @@ class PathScurryBase {
|
|
|
4406
4406
|
}
|
|
4407
4407
|
l++;
|
|
4408
4408
|
h.add(e);
|
|
4409
|
-
const
|
|
4409
|
+
const f = (e, d, p = false) => {
|
|
4410
4410
|
if (e) return o.emit("error", e);
|
|
4411
|
-
if (i && !
|
|
4411
|
+
if (i && !p) {
|
|
4412
4412
|
const t = [];
|
|
4413
|
-
for (const e of
|
|
4413
|
+
for (const e of d) {
|
|
4414
4414
|
if (e.isSymbolicLink()) {
|
|
4415
4415
|
t.push(e.realpath().then((t => t?.isUnknown() ? t.lstat() : t)));
|
|
4416
4416
|
}
|
|
4417
4417
|
}
|
|
4418
4418
|
if (t.length) {
|
|
4419
|
-
Promise.all(t).then((() =>
|
|
4419
|
+
Promise.all(t).then((() => f(null, d, true)));
|
|
4420
4420
|
return;
|
|
4421
4421
|
}
|
|
4422
4422
|
}
|
|
4423
|
-
for (const e of
|
|
4423
|
+
for (const e of d) {
|
|
4424
4424
|
if (e && (!n || n(e))) {
|
|
4425
4425
|
if (!o.write(s ? e : e.fullpath())) {
|
|
4426
4426
|
t = true;
|
|
@@ -4428,24 +4428,24 @@ class PathScurryBase {
|
|
|
4428
4428
|
}
|
|
4429
4429
|
}
|
|
4430
4430
|
l--;
|
|
4431
|
-
for (const t of
|
|
4431
|
+
for (const t of d) {
|
|
4432
4432
|
const e = t.realpathCached() || t;
|
|
4433
4433
|
if (e.shouldWalk(h, r)) {
|
|
4434
4434
|
a.push(e);
|
|
4435
4435
|
}
|
|
4436
4436
|
}
|
|
4437
4437
|
if (t && !o.flowing) {
|
|
4438
|
-
o.once("drain",
|
|
4439
|
-
} else if (!
|
|
4440
|
-
|
|
4438
|
+
o.once("drain", c);
|
|
4439
|
+
} else if (!u) {
|
|
4440
|
+
c();
|
|
4441
4441
|
}
|
|
4442
4442
|
};
|
|
4443
|
-
let
|
|
4444
|
-
e.readdirCB(
|
|
4445
|
-
|
|
4443
|
+
let u = true;
|
|
4444
|
+
e.readdirCB(f, true);
|
|
4445
|
+
u = false;
|
|
4446
4446
|
}
|
|
4447
4447
|
};
|
|
4448
|
-
|
|
4448
|
+
c();
|
|
4449
4449
|
return o;
|
|
4450
4450
|
}
|
|
4451
4451
|
streamSync(t = this.cwd, e = {}) {
|
|
@@ -4465,7 +4465,7 @@ class PathScurryBase {
|
|
|
4465
4465
|
}
|
|
4466
4466
|
const a = [ t ];
|
|
4467
4467
|
let l = 0;
|
|
4468
|
-
const
|
|
4468
|
+
const c = () => {
|
|
4469
4469
|
let t = false;
|
|
4470
4470
|
while (!t) {
|
|
4471
4471
|
const e = a.shift();
|
|
@@ -4495,15 +4495,15 @@ class PathScurryBase {
|
|
|
4495
4495
|
}
|
|
4496
4496
|
}
|
|
4497
4497
|
}
|
|
4498
|
-
if (t && !o.flowing) o.once("drain",
|
|
4498
|
+
if (t && !o.flowing) o.once("drain", c);
|
|
4499
4499
|
};
|
|
4500
|
-
|
|
4500
|
+
c();
|
|
4501
4501
|
return o;
|
|
4502
4502
|
}
|
|
4503
4503
|
chdir(t = this.cwd) {
|
|
4504
4504
|
const e = this.cwd;
|
|
4505
4505
|
this.cwd = typeof t === "string" ? this.cwd.resolve(t) : t;
|
|
4506
|
-
this.cwd[
|
|
4506
|
+
this.cwd[ms](e);
|
|
4507
4507
|
}
|
|
4508
4508
|
}
|
|
4509
4509
|
|
|
@@ -4524,7 +4524,7 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4524
4524
|
return e.win32.parse(t).root.toUpperCase();
|
|
4525
4525
|
}
|
|
4526
4526
|
newRoot(t) {
|
|
4527
|
-
return new PathWin32(this.rootPath,
|
|
4527
|
+
return new PathWin32(this.rootPath, Ke, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4528
4528
|
fs: t
|
|
4529
4529
|
});
|
|
4530
4530
|
}
|
|
@@ -4547,7 +4547,7 @@ class PathScurryPosix extends PathScurryBase {
|
|
|
4547
4547
|
return "/";
|
|
4548
4548
|
}
|
|
4549
4549
|
newRoot(t) {
|
|
4550
|
-
return new PathPosix(this.rootPath,
|
|
4550
|
+
return new PathPosix(this.rootPath, Ke, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4551
4551
|
fs: t
|
|
4552
4552
|
});
|
|
4553
4553
|
}
|
|
@@ -4566,13 +4566,13 @@ class PathScurryDarwin extends PathScurryPosix {
|
|
|
4566
4566
|
}
|
|
4567
4567
|
}
|
|
4568
4568
|
|
|
4569
|
-
const
|
|
4569
|
+
const ws = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
4570
4570
|
|
|
4571
|
-
const
|
|
4571
|
+
const ys = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
4572
4572
|
|
|
4573
|
-
const
|
|
4573
|
+
const bs = t => t.length >= 1;
|
|
4574
4574
|
|
|
4575
|
-
const
|
|
4575
|
+
const Ss = t => t.length >= 1;
|
|
4576
4576
|
|
|
4577
4577
|
class Pattern {
|
|
4578
4578
|
#te;
|
|
@@ -4587,10 +4587,10 @@ class Pattern {
|
|
|
4587
4587
|
#ae;
|
|
4588
4588
|
#le=true;
|
|
4589
4589
|
constructor(t, e, s, i) {
|
|
4590
|
-
if (!
|
|
4590
|
+
if (!bs(t)) {
|
|
4591
4591
|
throw new TypeError("empty pattern list");
|
|
4592
4592
|
}
|
|
4593
|
-
if (!
|
|
4593
|
+
if (!Ss(e)) {
|
|
4594
4594
|
throw new TypeError("empty glob list");
|
|
4595
4595
|
}
|
|
4596
4596
|
if (e.length !== t.length) {
|
|
@@ -4639,7 +4639,7 @@ class Pattern {
|
|
|
4639
4639
|
return typeof this.#te[this.#se] === "string";
|
|
4640
4640
|
}
|
|
4641
4641
|
isGlobstar() {
|
|
4642
|
-
return this.#te[this.#se] ===
|
|
4642
|
+
return this.#te[this.#se] === Pt;
|
|
4643
4643
|
}
|
|
4644
4644
|
isRegExp() {
|
|
4645
4645
|
return this.#te[this.#se] instanceof RegExp;
|
|
@@ -4685,7 +4685,7 @@ class Pattern {
|
|
|
4685
4685
|
}
|
|
4686
4686
|
}
|
|
4687
4687
|
|
|
4688
|
-
const
|
|
4688
|
+
const ks = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
4689
4689
|
|
|
4690
4690
|
class Ignore {
|
|
4691
4691
|
relative;
|
|
@@ -4694,7 +4694,7 @@ class Ignore {
|
|
|
4694
4694
|
absoluteChildren;
|
|
4695
4695
|
platform;
|
|
4696
4696
|
mmopts;
|
|
4697
|
-
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r =
|
|
4697
|
+
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r = ks}) {
|
|
4698
4698
|
this.relative = [];
|
|
4699
4699
|
this.absolute = [];
|
|
4700
4700
|
this.relativeChildren = [];
|
|
@@ -4870,7 +4870,7 @@ class Processor {
|
|
|
4870
4870
|
const e = n === ".." || n === "" || n === ".";
|
|
4871
4871
|
this.matches.add(t.resolve(n), i, e);
|
|
4872
4872
|
continue;
|
|
4873
|
-
} else if (n ===
|
|
4873
|
+
} else if (n === Pt) {
|
|
4874
4874
|
if (!t.isSymbolicLink() || this.follow || e.checkFollowGlobstar()) {
|
|
4875
4875
|
this.subwalks.add(t, e);
|
|
4876
4876
|
}
|
|
@@ -4906,7 +4906,7 @@ class Processor {
|
|
|
4906
4906
|
const s = e.isAbsolute();
|
|
4907
4907
|
const n = e.pattern();
|
|
4908
4908
|
const r = e.rest();
|
|
4909
|
-
if (n ===
|
|
4909
|
+
if (n === Pt) {
|
|
4910
4910
|
i.testGlobstar(t, e, r, s);
|
|
4911
4911
|
} else if (n instanceof RegExp) {
|
|
4912
4912
|
i.testRegExp(t, n, r, s);
|
|
@@ -4964,7 +4964,7 @@ class Processor {
|
|
|
4964
4964
|
}
|
|
4965
4965
|
}
|
|
4966
4966
|
|
|
4967
|
-
const
|
|
4967
|
+
const vs = (t, e) => typeof t === "string" ? new Ignore([ t ], e) : Array.isArray(t) ? new Ignore(t, e) : t;
|
|
4968
4968
|
|
|
4969
4969
|
class GlobUtil {
|
|
4970
4970
|
path;
|
|
@@ -4986,7 +4986,7 @@ class GlobUtil {
|
|
|
4986
4986
|
this.#ue = !s.posix && s.platform === "win32" ? "\\" : "/";
|
|
4987
4987
|
this.includeChildMatches = s.includeChildMatches !== false;
|
|
4988
4988
|
if (s.ignore || !this.includeChildMatches) {
|
|
4989
|
-
this.#fe =
|
|
4989
|
+
this.#fe = vs(s.ignore ?? [], s);
|
|
4990
4990
|
if (!this.includeChildMatches && typeof this.#fe.add !== "function") {
|
|
4991
4991
|
const t = "cannot ignore child matches, ignore lacks add() method.";
|
|
4992
4992
|
throw new Error(t);
|
|
@@ -5105,13 +5105,13 @@ class GlobUtil {
|
|
|
5105
5105
|
}
|
|
5106
5106
|
s.processPatterns(t, e);
|
|
5107
5107
|
let n = 1;
|
|
5108
|
-
const
|
|
5108
|
+
const r = () => {
|
|
5109
5109
|
if (--n === 0) i();
|
|
5110
5110
|
};
|
|
5111
5111
|
for (const [t, e, i] of s.matches.entries()) {
|
|
5112
5112
|
if (this.#de(t)) continue;
|
|
5113
5113
|
n++;
|
|
5114
|
-
this.match(t, e, i).then((() =>
|
|
5114
|
+
this.match(t, e, i).then((() => r()));
|
|
5115
5115
|
}
|
|
5116
5116
|
for (const t of s.subwalkTargets()) {
|
|
5117
5117
|
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
|
@@ -5119,28 +5119,28 @@ class GlobUtil {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
n++;
|
|
5121
5121
|
const e = t.readdirCached();
|
|
5122
|
-
if (t.calledReaddir()) this.walkCB3(t, e, s,
|
|
5123
|
-
t.readdirCB(((e, i) => this.walkCB3(t, i, s,
|
|
5122
|
+
if (t.calledReaddir()) this.walkCB3(t, e, s, r); else {
|
|
5123
|
+
t.readdirCB(((e, i) => this.walkCB3(t, i, s, r)), true);
|
|
5124
5124
|
}
|
|
5125
5125
|
}
|
|
5126
|
-
|
|
5126
|
+
r();
|
|
5127
5127
|
}
|
|
5128
5128
|
walkCB3(t, e, s, i) {
|
|
5129
5129
|
s = s.filterEntries(t, e);
|
|
5130
5130
|
let n = 1;
|
|
5131
|
-
const
|
|
5131
|
+
const r = () => {
|
|
5132
5132
|
if (--n === 0) i();
|
|
5133
5133
|
};
|
|
5134
5134
|
for (const [t, e, i] of s.matches.entries()) {
|
|
5135
5135
|
if (this.#de(t)) continue;
|
|
5136
5136
|
n++;
|
|
5137
|
-
this.match(t, e, i).then((() =>
|
|
5137
|
+
this.match(t, e, i).then((() => r()));
|
|
5138
5138
|
}
|
|
5139
5139
|
for (const [t, e] of s.subwalks.entries()) {
|
|
5140
5140
|
n++;
|
|
5141
|
-
this.walkCB2(t, e, s.child(),
|
|
5141
|
+
this.walkCB2(t, e, s.child(), r);
|
|
5142
5142
|
}
|
|
5143
|
-
|
|
5143
|
+
r();
|
|
5144
5144
|
}
|
|
5145
5145
|
walkCBSync(t, e, s) {
|
|
5146
5146
|
if (this.signal?.aborted) s();
|
|
@@ -5155,7 +5155,7 @@ class GlobUtil {
|
|
|
5155
5155
|
}
|
|
5156
5156
|
s.processPatterns(t, e);
|
|
5157
5157
|
let n = 1;
|
|
5158
|
-
const
|
|
5158
|
+
const r = () => {
|
|
5159
5159
|
if (--n === 0) i();
|
|
5160
5160
|
};
|
|
5161
5161
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -5168,14 +5168,14 @@ class GlobUtil {
|
|
|
5168
5168
|
}
|
|
5169
5169
|
n++;
|
|
5170
5170
|
const e = t.readdirSync();
|
|
5171
|
-
this.walkCB3Sync(t, e, s,
|
|
5171
|
+
this.walkCB3Sync(t, e, s, r);
|
|
5172
5172
|
}
|
|
5173
|
-
|
|
5173
|
+
r();
|
|
5174
5174
|
}
|
|
5175
5175
|
walkCB3Sync(t, e, s, i) {
|
|
5176
5176
|
s = s.filterEntries(t, e);
|
|
5177
5177
|
let n = 1;
|
|
5178
|
-
const
|
|
5178
|
+
const r = () => {
|
|
5179
5179
|
if (--n === 0) i();
|
|
5180
5180
|
};
|
|
5181
5181
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -5184,9 +5184,9 @@ class GlobUtil {
|
|
|
5184
5184
|
}
|
|
5185
5185
|
for (const [t, e] of s.subwalks.entries()) {
|
|
5186
5186
|
n++;
|
|
5187
|
-
this.walkCB2Sync(t, e, s.child(),
|
|
5187
|
+
this.walkCB2Sync(t, e, s.child(), r);
|
|
5188
5188
|
}
|
|
5189
|
-
|
|
5189
|
+
r();
|
|
5190
5190
|
}
|
|
5191
5191
|
}
|
|
5192
5192
|
|
|
@@ -5261,9 +5261,9 @@ class GlobStream extends GlobUtil {
|
|
|
5261
5261
|
}
|
|
5262
5262
|
}
|
|
5263
5263
|
|
|
5264
|
-
const
|
|
5264
|
+
const xs = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
5265
5265
|
|
|
5266
|
-
let
|
|
5266
|
+
let Es = class Glob {
|
|
5267
5267
|
absolute;
|
|
5268
5268
|
cwd;
|
|
5269
5269
|
root;
|
|
@@ -5335,7 +5335,7 @@ let ce = class Glob {
|
|
|
5335
5335
|
e = e.map((t => t.includes("/") ? t : `./**/${t}`));
|
|
5336
5336
|
}
|
|
5337
5337
|
this.pattern = e;
|
|
5338
|
-
this.platform = s.platform ||
|
|
5338
|
+
this.platform = s.platform || xs;
|
|
5339
5339
|
this.opts = {
|
|
5340
5340
|
...s,
|
|
5341
5341
|
platform: this.platform
|
|
@@ -5346,7 +5346,7 @@ let ce = class Glob {
|
|
|
5346
5346
|
throw new Error("nocase option contradicts provided scurry option");
|
|
5347
5347
|
}
|
|
5348
5348
|
} else {
|
|
5349
|
-
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix :
|
|
5349
|
+
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix : ys;
|
|
5350
5350
|
this.scurry = new t(this.cwd, {
|
|
5351
5351
|
nocase: s.nocase,
|
|
5352
5352
|
fs: s.fs
|
|
@@ -5431,7 +5431,7 @@ let ce = class Glob {
|
|
|
5431
5431
|
}
|
|
5432
5432
|
};
|
|
5433
5433
|
|
|
5434
|
-
const
|
|
5434
|
+
const Cs = (t, e = {}) => {
|
|
5435
5435
|
if (!Array.isArray(t)) {
|
|
5436
5436
|
t = [ t ];
|
|
5437
5437
|
}
|
|
@@ -5441,69 +5441,69 @@ const hasMagic = (t, e = {}) => {
|
|
|
5441
5441
|
return false;
|
|
5442
5442
|
};
|
|
5443
5443
|
|
|
5444
|
-
function
|
|
5445
|
-
return new
|
|
5444
|
+
function Ts(t, e = {}) {
|
|
5445
|
+
return new Es(t, e).streamSync();
|
|
5446
5446
|
}
|
|
5447
5447
|
|
|
5448
|
-
function
|
|
5449
|
-
return new
|
|
5448
|
+
function Ls(t, e = {}) {
|
|
5449
|
+
return new Es(t, e).stream();
|
|
5450
5450
|
}
|
|
5451
5451
|
|
|
5452
|
-
function
|
|
5453
|
-
return new
|
|
5452
|
+
function As(t, e = {}) {
|
|
5453
|
+
return new Es(t, e).walkSync();
|
|
5454
5454
|
}
|
|
5455
5455
|
|
|
5456
|
-
async function
|
|
5457
|
-
return new
|
|
5456
|
+
async function Ms(t, e = {}) {
|
|
5457
|
+
return new Es(t, e).walk();
|
|
5458
5458
|
}
|
|
5459
5459
|
|
|
5460
|
-
function
|
|
5461
|
-
return new
|
|
5460
|
+
function Ps(t, e = {}) {
|
|
5461
|
+
return new Es(t, e).iterateSync();
|
|
5462
5462
|
}
|
|
5463
5463
|
|
|
5464
|
-
function
|
|
5465
|
-
return new
|
|
5464
|
+
function Fs(t, e = {}) {
|
|
5465
|
+
return new Es(t, e).iterate();
|
|
5466
5466
|
}
|
|
5467
5467
|
|
|
5468
|
-
const
|
|
5468
|
+
const Rs = Ts;
|
|
5469
5469
|
|
|
5470
|
-
const
|
|
5471
|
-
sync:
|
|
5470
|
+
const Os = Object.assign(Ls, {
|
|
5471
|
+
sync: Ts
|
|
5472
5472
|
});
|
|
5473
5473
|
|
|
5474
|
-
const
|
|
5474
|
+
const zs = Ps;
|
|
5475
5475
|
|
|
5476
|
-
const
|
|
5477
|
-
sync:
|
|
5476
|
+
const Ds = Object.assign(Fs, {
|
|
5477
|
+
sync: Ps
|
|
5478
5478
|
});
|
|
5479
5479
|
|
|
5480
|
-
const
|
|
5481
|
-
stream:
|
|
5482
|
-
iterate:
|
|
5480
|
+
const Ns = Object.assign(As, {
|
|
5481
|
+
stream: Ts,
|
|
5482
|
+
iterate: Ps
|
|
5483
5483
|
});
|
|
5484
5484
|
|
|
5485
|
-
const
|
|
5486
|
-
glob:
|
|
5487
|
-
globSync,
|
|
5488
|
-
sync:
|
|
5489
|
-
globStream,
|
|
5490
|
-
stream:
|
|
5491
|
-
globStreamSync,
|
|
5492
|
-
streamSync:
|
|
5493
|
-
globIterate,
|
|
5494
|
-
iterate:
|
|
5495
|
-
globIterateSync,
|
|
5496
|
-
iterateSync:
|
|
5497
|
-
Glob:
|
|
5498
|
-
hasMagic,
|
|
5499
|
-
escape,
|
|
5500
|
-
unescape
|
|
5485
|
+
const Bs = Object.assign(Ms, {
|
|
5486
|
+
glob: Ms,
|
|
5487
|
+
globSync: As,
|
|
5488
|
+
sync: Ns,
|
|
5489
|
+
globStream: Ls,
|
|
5490
|
+
stream: Os,
|
|
5491
|
+
globStreamSync: Ts,
|
|
5492
|
+
streamSync: Rs,
|
|
5493
|
+
globIterate: Fs,
|
|
5494
|
+
iterate: Ds,
|
|
5495
|
+
globIterateSync: Ps,
|
|
5496
|
+
iterateSync: zs,
|
|
5497
|
+
Glob: Es,
|
|
5498
|
+
hasMagic: Cs,
|
|
5499
|
+
escape: rt,
|
|
5500
|
+
unescape: Z
|
|
5501
5501
|
});
|
|
5502
5502
|
|
|
5503
|
-
|
|
5503
|
+
Bs.glob = Bs;
|
|
5504
5504
|
|
|
5505
|
-
async function
|
|
5506
|
-
return e ? await
|
|
5505
|
+
async function Ws(t, e) {
|
|
5506
|
+
return e ? await Bs(t, e) : await Bs(t);
|
|
5507
5507
|
}
|
|
5508
5508
|
|
|
5509
|
-
exports.Glob =
|
|
5509
|
+
exports.Glob = Ws;
|