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.mjs
CHANGED
|
@@ -14,10 +14,10 @@ import p from "node:stream";
|
|
|
14
14
|
|
|
15
15
|
import { StringDecoder as g } from "node:string_decoder";
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
const i = t instanceof RegExp ?
|
|
19
|
-
const n = e instanceof RegExp ?
|
|
20
|
-
const r = i !== null && n != null &&
|
|
17
|
+
const m = (t, e, s) => {
|
|
18
|
+
const i = t instanceof RegExp ? w(t, s) : t;
|
|
19
|
+
const n = e instanceof RegExp ? w(e, s) : e;
|
|
20
|
+
const r = i !== null && n != null && y(i, n, s);
|
|
21
21
|
return r && {
|
|
22
22
|
start: r[0],
|
|
23
23
|
end: r[1],
|
|
@@ -27,12 +27,12 @@ const balanced = (t, e, s) => {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const w = (t, e) => {
|
|
31
31
|
const s = e.match(t);
|
|
32
32
|
return s ? s[0] : null;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const y = (t, e, s) => {
|
|
36
36
|
let i, n, r, o = undefined, h;
|
|
37
37
|
let a = s.indexOf(t);
|
|
38
38
|
let l = s.indexOf(e, a + 1);
|
|
@@ -67,19 +67,15 @@ const range = (t, e, s) => {
|
|
|
67
67
|
return h;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
const
|
|
70
|
+
const b = "\0SLASH" + Math.random() + "\0";
|
|
71
71
|
|
|
72
|
-
const
|
|
72
|
+
const S = "\0OPEN" + Math.random() + "\0";
|
|
73
73
|
|
|
74
|
-
const
|
|
74
|
+
const k = "\0CLOSE" + Math.random() + "\0";
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const x = "\0COMMA" + Math.random() + "\0";
|
|
77
77
|
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
const x = new RegExp(y, "g");
|
|
81
|
-
|
|
82
|
-
const v = new RegExp(w, "g");
|
|
78
|
+
const v = "\0PERIOD" + Math.random() + "\0";
|
|
83
79
|
|
|
84
80
|
const E = new RegExp(b, "g");
|
|
85
81
|
|
|
@@ -87,41 +83,45 @@ const C = new RegExp(S, "g");
|
|
|
87
83
|
|
|
88
84
|
const T = new RegExp(k, "g");
|
|
89
85
|
|
|
90
|
-
const A =
|
|
86
|
+
const A = new RegExp(x, "g");
|
|
87
|
+
|
|
88
|
+
const L = new RegExp(v, "g");
|
|
89
|
+
|
|
90
|
+
const M = /\\\\/g;
|
|
91
91
|
|
|
92
|
-
const
|
|
92
|
+
const P = /\\{/g;
|
|
93
93
|
|
|
94
|
-
const
|
|
94
|
+
const F = /\\}/g;
|
|
95
95
|
|
|
96
|
-
const
|
|
96
|
+
const R = /\\,/g;
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const O = /\\./g;
|
|
99
99
|
|
|
100
|
-
function
|
|
100
|
+
function z(t) {
|
|
101
101
|
return !isNaN(t) ? parseInt(t, 10) : t.charCodeAt(0);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
function
|
|
105
|
-
return t.replace(
|
|
104
|
+
function D(t) {
|
|
105
|
+
return t.replace(M, b).replace(P, S).replace(F, k).replace(R, x).replace(O, v);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
function
|
|
109
|
-
return t.replace(
|
|
108
|
+
function N(t) {
|
|
109
|
+
return t.replace(E, "\\").replace(C, "{").replace(T, "}").replace(A, ",").replace(L, ".");
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
function
|
|
112
|
+
function B(t) {
|
|
113
113
|
if (!t) {
|
|
114
114
|
return [ "" ];
|
|
115
115
|
}
|
|
116
116
|
const e = [];
|
|
117
|
-
const s =
|
|
117
|
+
const s = m("{", "}", t);
|
|
118
118
|
if (!s) {
|
|
119
119
|
return t.split(",");
|
|
120
120
|
}
|
|
121
121
|
const {pre: i, body: n, post: r} = s;
|
|
122
122
|
const o = i.split(",");
|
|
123
123
|
o[o.length - 1] += "{" + n + "}";
|
|
124
|
-
const h =
|
|
124
|
+
const h = B(r);
|
|
125
125
|
if (r.length) {
|
|
126
126
|
o[o.length - 1] += h.shift();
|
|
127
127
|
o.push.apply(o, h);
|
|
@@ -130,38 +130,38 @@ function parseCommaParts(t) {
|
|
|
130
130
|
return e;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
function
|
|
133
|
+
function W(t) {
|
|
134
134
|
if (!t) {
|
|
135
135
|
return [];
|
|
136
136
|
}
|
|
137
137
|
if (t.slice(0, 2) === "{}") {
|
|
138
138
|
t = "\\{\\}" + t.slice(2);
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return U(D(t), true).map(N);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
function
|
|
143
|
+
function I(t) {
|
|
144
144
|
return "{" + t + "}";
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
function
|
|
147
|
+
function _(t) {
|
|
148
148
|
return /^-?0\d/.test(t);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
function
|
|
151
|
+
function j(t, e) {
|
|
152
152
|
return t <= e;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
function
|
|
155
|
+
function $(t, e) {
|
|
156
156
|
return t >= e;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function
|
|
159
|
+
function U(t, e) {
|
|
160
160
|
const s = [];
|
|
161
|
-
const i =
|
|
161
|
+
const i = m("{", "}", t);
|
|
162
162
|
if (!i) return [ t ];
|
|
163
163
|
const n = i.pre;
|
|
164
|
-
const r = i.post.length ?
|
|
164
|
+
const r = i.post.length ? U(i.post, false) : [ "" ];
|
|
165
165
|
if (/\$$/.test(i.pre)) {
|
|
166
166
|
for (let t = 0; t < r.length; t++) {
|
|
167
167
|
const e = n + "{" + i.body + "}" + r[t];
|
|
@@ -174,8 +174,8 @@ function expand_(t, e) {
|
|
|
174
174
|
const l = i.body.indexOf(",") >= 0;
|
|
175
175
|
if (!a && !l) {
|
|
176
176
|
if (i.post.match(/,(?!,).*\}/)) {
|
|
177
|
-
t = i.pre + "{" + i.body +
|
|
178
|
-
return
|
|
177
|
+
t = i.pre + "{" + i.body + k + i.post;
|
|
178
|
+
return U(t);
|
|
179
179
|
}
|
|
180
180
|
return [ t ];
|
|
181
181
|
}
|
|
@@ -183,9 +183,9 @@ function expand_(t, e) {
|
|
|
183
183
|
if (a) {
|
|
184
184
|
c = i.body.split(/\.\./);
|
|
185
185
|
} else {
|
|
186
|
-
c =
|
|
186
|
+
c = B(i.body);
|
|
187
187
|
if (c.length === 1 && c[0] !== undefined) {
|
|
188
|
-
c =
|
|
188
|
+
c = U(c[0], false).map(I);
|
|
189
189
|
if (c.length === 1) {
|
|
190
190
|
return r.map((t => i.pre + c[0] + t));
|
|
191
191
|
}
|
|
@@ -193,17 +193,17 @@ function expand_(t, e) {
|
|
|
193
193
|
}
|
|
194
194
|
let f;
|
|
195
195
|
if (a && c[0] !== undefined && c[1] !== undefined) {
|
|
196
|
-
const t =
|
|
197
|
-
const e =
|
|
196
|
+
const t = z(c[0]);
|
|
197
|
+
const e = z(c[1]);
|
|
198
198
|
const s = Math.max(c[0].length, c[1].length);
|
|
199
|
-
let i = c.length === 3 && c[2] !== undefined ? Math.abs(
|
|
200
|
-
let n =
|
|
199
|
+
let i = c.length === 3 && c[2] !== undefined ? Math.abs(z(c[2])) : 1;
|
|
200
|
+
let n = j;
|
|
201
201
|
const r = e < t;
|
|
202
202
|
if (r) {
|
|
203
203
|
i *= -1;
|
|
204
|
-
n =
|
|
204
|
+
n = $;
|
|
205
205
|
}
|
|
206
|
-
const o = c.some(
|
|
206
|
+
const o = c.some(_);
|
|
207
207
|
f = [];
|
|
208
208
|
for (let r = t; n(r, e); r += i) {
|
|
209
209
|
let t;
|
|
@@ -231,7 +231,7 @@ function expand_(t, e) {
|
|
|
231
231
|
} else {
|
|
232
232
|
f = [];
|
|
233
233
|
for (let t = 0; t < c.length; t++) {
|
|
234
|
-
f.push.apply(f,
|
|
234
|
+
f.push.apply(f, U(c[t], false));
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
for (let t = 0; t < f.length; t++) {
|
|
@@ -246,18 +246,18 @@ function expand_(t, e) {
|
|
|
246
246
|
return s;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
-
const
|
|
249
|
+
const G = 1024 * 64;
|
|
250
250
|
|
|
251
|
-
const
|
|
251
|
+
const H = t => {
|
|
252
252
|
if (typeof t !== "string") {
|
|
253
253
|
throw new TypeError("invalid pattern");
|
|
254
254
|
}
|
|
255
|
-
if (t.length >
|
|
255
|
+
if (t.length > G) {
|
|
256
256
|
throw new TypeError("pattern is too long");
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
259
|
|
|
260
|
-
const
|
|
260
|
+
const Z = {
|
|
261
261
|
"[:alnum:]": [ "\\p{L}\\p{Nl}\\p{Nd}", true ],
|
|
262
262
|
"[:alpha:]": [ "\\p{L}\\p{Nl}", true ],
|
|
263
263
|
"[:ascii:]": [ "\\x" + "00-\\x" + "7f", false ],
|
|
@@ -274,13 +274,13 @@ const O = {
|
|
|
274
274
|
"[:xdigit:]": [ "A-Fa-f0-9", false ]
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
const
|
|
277
|
+
const q = t => t.replace(/[[\]\\-]/g, "\\$&");
|
|
278
278
|
|
|
279
|
-
const
|
|
279
|
+
const V = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
280
280
|
|
|
281
|
-
const
|
|
281
|
+
const J = t => t.join("");
|
|
282
282
|
|
|
283
|
-
const
|
|
283
|
+
const K = (t, e) => {
|
|
284
284
|
const s = e;
|
|
285
285
|
if (t.charAt(s) !== "[") {
|
|
286
286
|
throw new Error("not in a brace expression");
|
|
@@ -314,7 +314,7 @@ const parseClass = (t, e) => {
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
if (e === "[" && !a) {
|
|
317
|
-
for (const [e, [o, a, l]] of Object.entries(
|
|
317
|
+
for (const [e, [o, a, l]] of Object.entries(Z)) {
|
|
318
318
|
if (t.startsWith(e, r)) {
|
|
319
319
|
if (f) {
|
|
320
320
|
return [ "$.", false, t.length - s, true ];
|
|
@@ -329,16 +329,16 @@ const parseClass = (t, e) => {
|
|
|
329
329
|
a = false;
|
|
330
330
|
if (f) {
|
|
331
331
|
if (e > f) {
|
|
332
|
-
i.push(
|
|
332
|
+
i.push(q(f) + "-" + q(e));
|
|
333
333
|
} else if (e === f) {
|
|
334
|
-
i.push(
|
|
334
|
+
i.push(q(e));
|
|
335
335
|
}
|
|
336
336
|
f = "";
|
|
337
337
|
r++;
|
|
338
338
|
continue;
|
|
339
339
|
}
|
|
340
340
|
if (t.startsWith("-]", r + 1)) {
|
|
341
|
-
i.push(
|
|
341
|
+
i.push(q(e + "-"));
|
|
342
342
|
r += 2;
|
|
343
343
|
continue;
|
|
344
344
|
}
|
|
@@ -347,7 +347,7 @@ const parseClass = (t, e) => {
|
|
|
347
347
|
r += 2;
|
|
348
348
|
continue;
|
|
349
349
|
}
|
|
350
|
-
i.push(
|
|
350
|
+
i.push(q(e));
|
|
351
351
|
r++;
|
|
352
352
|
}
|
|
353
353
|
if (c < r) {
|
|
@@ -358,42 +358,42 @@ const parseClass = (t, e) => {
|
|
|
358
358
|
}
|
|
359
359
|
if (n.length === 0 && i.length === 1 && /^\\?.$/.test(i[0]) && !l) {
|
|
360
360
|
const t = i[0].length === 2 ? i[0].slice(-1) : i[0];
|
|
361
|
-
return [
|
|
361
|
+
return [ V(t), false, c - s, false ];
|
|
362
362
|
}
|
|
363
|
-
const u = "[" + (l ? "^" : "") +
|
|
364
|
-
const d = "[" + (l ? "" : "^") +
|
|
363
|
+
const u = "[" + (l ? "^" : "") + J(i) + "]";
|
|
364
|
+
const d = "[" + (l ? "" : "^") + J(n) + "]";
|
|
365
365
|
const p = i.length && n.length ? "(" + u + "|" + d + ")" : i.length ? u : d;
|
|
366
366
|
return [ p, h, c - s, true ];
|
|
367
367
|
};
|
|
368
368
|
|
|
369
|
-
const
|
|
369
|
+
const Y = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = true} = {}) => {
|
|
370
370
|
if (s) {
|
|
371
371
|
return e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
372
372
|
}
|
|
373
373
|
return e ? t.replace(/\[([^\/\\{}])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
374
374
|
};
|
|
375
375
|
|
|
376
|
-
const
|
|
376
|
+
const X = new Set([ "!", "?", "+", "*", "@" ]);
|
|
377
377
|
|
|
378
|
-
const
|
|
378
|
+
const Q = t => X.has(t);
|
|
379
379
|
|
|
380
|
-
const
|
|
380
|
+
const tt = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
381
381
|
|
|
382
|
-
const
|
|
382
|
+
const et = "(?!\\.)";
|
|
383
383
|
|
|
384
|
-
const
|
|
384
|
+
const st = new Set([ "[", "." ]);
|
|
385
385
|
|
|
386
|
-
const
|
|
386
|
+
const it = new Set([ "..", "." ]);
|
|
387
387
|
|
|
388
|
-
const
|
|
388
|
+
const nt = new Set("().*{}+?[]^$\\!");
|
|
389
389
|
|
|
390
|
-
const
|
|
390
|
+
const rt = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
391
391
|
|
|
392
|
-
const
|
|
392
|
+
const ot = "[^/]";
|
|
393
393
|
|
|
394
|
-
const
|
|
394
|
+
const ht = ot + "*?";
|
|
395
395
|
|
|
396
|
-
const
|
|
396
|
+
const at = ot + "+?";
|
|
397
397
|
|
|
398
398
|
class AST {
|
|
399
399
|
type;
|
|
@@ -539,7 +539,7 @@ class AST {
|
|
|
539
539
|
l += s;
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
|
-
if (!i.noext &&
|
|
542
|
+
if (!i.noext && Q(s) && t.charAt(a) === "(") {
|
|
543
543
|
e.push(l);
|
|
544
544
|
l = "";
|
|
545
545
|
const n = new AST(s, e);
|
|
@@ -580,7 +580,7 @@ class AST {
|
|
|
580
580
|
f += s;
|
|
581
581
|
continue;
|
|
582
582
|
}
|
|
583
|
-
if (
|
|
583
|
+
if (Q(s) && t.charAt(a) === "(") {
|
|
584
584
|
l.push(f);
|
|
585
585
|
f = "";
|
|
586
586
|
const e = new AST(s, l);
|
|
@@ -647,12 +647,12 @@ class AST {
|
|
|
647
647
|
let n = "";
|
|
648
648
|
if (this.isStart()) {
|
|
649
649
|
if (typeof this.#i[0] === "string") {
|
|
650
|
-
const s = this.#i.length === 1 &&
|
|
650
|
+
const s = this.#i.length === 1 && it.has(this.#i[0]);
|
|
651
651
|
if (!s) {
|
|
652
|
-
const s =
|
|
652
|
+
const s = st;
|
|
653
653
|
const r = e && s.has(i.charAt(0)) || i.startsWith("\\.") && s.has(i.charAt(2)) || i.startsWith("\\.\\.") && s.has(i.charAt(4));
|
|
654
654
|
const o = !e && !t && s.has(i.charAt(0));
|
|
655
|
-
n = r ?
|
|
655
|
+
n = r ? tt : o ? et : "";
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
}
|
|
@@ -661,7 +661,7 @@ class AST {
|
|
|
661
661
|
r = "(?:$|\\/)";
|
|
662
662
|
}
|
|
663
663
|
const o = n + i + r;
|
|
664
|
-
return [ o,
|
|
664
|
+
return [ o, Y(i), this.#e = !!this.#e, this.#s ];
|
|
665
665
|
}
|
|
666
666
|
const s = this.type === "*" || this.type === "+";
|
|
667
667
|
const i = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
@@ -671,9 +671,9 @@ class AST {
|
|
|
671
671
|
this.#i = [ t ];
|
|
672
672
|
this.type = null;
|
|
673
673
|
this.#e = undefined;
|
|
674
|
-
return [ t,
|
|
674
|
+
return [ t, Y(this.toString()), false, false ];
|
|
675
675
|
}
|
|
676
|
-
let r = !s || t || e || !
|
|
676
|
+
let r = !s || t || e || !et ? "" : this.#p(true);
|
|
677
677
|
if (r === n) {
|
|
678
678
|
r = "";
|
|
679
679
|
}
|
|
@@ -682,12 +682,12 @@ class AST {
|
|
|
682
682
|
}
|
|
683
683
|
let o = "";
|
|
684
684
|
if (this.type === "!" && this.#c) {
|
|
685
|
-
o = (this.isStart() && !e ?
|
|
685
|
+
o = (this.isStart() && !e ? et : "") + at;
|
|
686
686
|
} else {
|
|
687
|
-
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ?
|
|
687
|
+
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ? et : "") + ht + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && r ? ")" : this.type === "*" && r ? `)?` : `)${this.type}`;
|
|
688
688
|
o = i + n + s;
|
|
689
689
|
}
|
|
690
|
-
return [ o,
|
|
690
|
+
return [ o, Y(n), this.#e = !!this.#e, this.#s ];
|
|
691
691
|
}
|
|
692
692
|
#p(t) {
|
|
693
693
|
return this.#i.map((e => {
|
|
@@ -707,7 +707,7 @@ class AST {
|
|
|
707
707
|
const h = t.charAt(o);
|
|
708
708
|
if (i) {
|
|
709
709
|
i = false;
|
|
710
|
-
n += (
|
|
710
|
+
n += (nt.has(h) ? "\\" : "") + h;
|
|
711
711
|
continue;
|
|
712
712
|
}
|
|
713
713
|
if (h === "\\") {
|
|
@@ -719,7 +719,7 @@ class AST {
|
|
|
719
719
|
continue;
|
|
720
720
|
}
|
|
721
721
|
if (h === "[") {
|
|
722
|
-
const [s, i, h, a] =
|
|
722
|
+
const [s, i, h, a] = K(t, o);
|
|
723
723
|
if (h) {
|
|
724
724
|
n += s;
|
|
725
725
|
r = r || i;
|
|
@@ -729,107 +729,107 @@ class AST {
|
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
731
|
if (h === "*") {
|
|
732
|
-
n += s && t === "*" ?
|
|
732
|
+
n += s && t === "*" ? at : ht;
|
|
733
733
|
e = true;
|
|
734
734
|
continue;
|
|
735
735
|
}
|
|
736
736
|
if (h === "?") {
|
|
737
|
-
n +=
|
|
737
|
+
n += ot;
|
|
738
738
|
e = true;
|
|
739
739
|
continue;
|
|
740
740
|
}
|
|
741
|
-
n +=
|
|
741
|
+
n += rt(h);
|
|
742
742
|
}
|
|
743
|
-
return [ n,
|
|
743
|
+
return [ n, Y(t), !!e, r ];
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
|
|
747
|
-
const
|
|
747
|
+
const lt = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = false} = {}) => {
|
|
748
748
|
if (s) {
|
|
749
749
|
return e ? t.replace(/[?*()[\]{}]/g, "[$&]") : t.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
750
750
|
}
|
|
751
751
|
return e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&");
|
|
752
752
|
};
|
|
753
753
|
|
|
754
|
-
const
|
|
755
|
-
|
|
754
|
+
const ct = (t, e, s = {}) => {
|
|
755
|
+
H(e);
|
|
756
756
|
if (!s.nocomment && e.charAt(0) === "#") {
|
|
757
757
|
return false;
|
|
758
758
|
}
|
|
759
759
|
return new Minimatch(e, s).match(t);
|
|
760
760
|
};
|
|
761
761
|
|
|
762
|
-
const
|
|
762
|
+
const ft = /^\*+([^+@!?\*\[\(]*)$/;
|
|
763
763
|
|
|
764
|
-
const
|
|
764
|
+
const ut = t => e => !e.startsWith(".") && e.endsWith(t);
|
|
765
765
|
|
|
766
|
-
const
|
|
766
|
+
const dt = t => e => e.endsWith(t);
|
|
767
767
|
|
|
768
|
-
const
|
|
768
|
+
const pt = t => {
|
|
769
769
|
t = t.toLowerCase();
|
|
770
770
|
return e => !e.startsWith(".") && e.toLowerCase().endsWith(t);
|
|
771
771
|
};
|
|
772
772
|
|
|
773
|
-
const
|
|
773
|
+
const gt = t => {
|
|
774
774
|
t = t.toLowerCase();
|
|
775
775
|
return e => e.toLowerCase().endsWith(t);
|
|
776
776
|
};
|
|
777
777
|
|
|
778
|
-
const
|
|
778
|
+
const mt = /^\*+\.\*+$/;
|
|
779
779
|
|
|
780
|
-
const
|
|
780
|
+
const wt = t => !t.startsWith(".") && t.includes(".");
|
|
781
781
|
|
|
782
|
-
const
|
|
782
|
+
const yt = t => t !== "." && t !== ".." && t.includes(".");
|
|
783
783
|
|
|
784
|
-
const
|
|
784
|
+
const bt = /^\.\*+$/;
|
|
785
785
|
|
|
786
|
-
const
|
|
786
|
+
const St = t => t !== "." && t !== ".." && t.startsWith(".");
|
|
787
787
|
|
|
788
|
-
const
|
|
788
|
+
const kt = /^\*+$/;
|
|
789
789
|
|
|
790
|
-
const
|
|
790
|
+
const xt = t => t.length !== 0 && !t.startsWith(".");
|
|
791
791
|
|
|
792
|
-
const
|
|
792
|
+
const vt = t => t.length !== 0 && t !== "." && t !== "..";
|
|
793
793
|
|
|
794
|
-
const
|
|
794
|
+
const Et = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
795
795
|
|
|
796
|
-
const
|
|
797
|
-
const s =
|
|
796
|
+
const Ct = ([t, e = ""]) => {
|
|
797
|
+
const s = Mt([ t ]);
|
|
798
798
|
if (!e) return s;
|
|
799
799
|
e = e.toLowerCase();
|
|
800
800
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
801
801
|
};
|
|
802
802
|
|
|
803
|
-
const
|
|
804
|
-
const s =
|
|
803
|
+
const Tt = ([t, e = ""]) => {
|
|
804
|
+
const s = Pt([ t ]);
|
|
805
805
|
if (!e) return s;
|
|
806
806
|
e = e.toLowerCase();
|
|
807
807
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
808
808
|
};
|
|
809
809
|
|
|
810
|
-
const
|
|
811
|
-
const s =
|
|
810
|
+
const At = ([t, e = ""]) => {
|
|
811
|
+
const s = Pt([ t ]);
|
|
812
812
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
813
813
|
};
|
|
814
814
|
|
|
815
|
-
const
|
|
816
|
-
const s =
|
|
815
|
+
const Lt = ([t, e = ""]) => {
|
|
816
|
+
const s = Mt([ t ]);
|
|
817
817
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
818
818
|
};
|
|
819
819
|
|
|
820
|
-
const
|
|
820
|
+
const Mt = ([t]) => {
|
|
821
821
|
const e = t.length;
|
|
822
822
|
return t => t.length === e && !t.startsWith(".");
|
|
823
823
|
};
|
|
824
824
|
|
|
825
|
-
const
|
|
825
|
+
const Pt = ([t]) => {
|
|
826
826
|
const e = t.length;
|
|
827
827
|
return t => t.length === e && t !== "." && t !== "..";
|
|
828
828
|
};
|
|
829
829
|
|
|
830
|
-
const
|
|
830
|
+
const Ft = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
831
831
|
|
|
832
|
-
const
|
|
832
|
+
const Rt = {
|
|
833
833
|
win32: {
|
|
834
834
|
sep: "\\"
|
|
835
835
|
},
|
|
@@ -838,80 +838,80 @@ const J = {
|
|
|
838
838
|
}
|
|
839
839
|
};
|
|
840
840
|
|
|
841
|
-
const
|
|
841
|
+
const Ot = Ft === "win32" ? Rt.win32.sep : Rt.posix.sep;
|
|
842
842
|
|
|
843
|
-
|
|
843
|
+
ct.sep = Ot;
|
|
844
844
|
|
|
845
|
-
const
|
|
845
|
+
const zt = Symbol("globstar **");
|
|
846
846
|
|
|
847
|
-
|
|
847
|
+
ct.GLOBSTAR = zt;
|
|
848
848
|
|
|
849
|
-
const
|
|
849
|
+
const Dt = "[^/]";
|
|
850
850
|
|
|
851
|
-
const
|
|
851
|
+
const Nt = Dt + "*?";
|
|
852
852
|
|
|
853
|
-
const
|
|
853
|
+
const Bt = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
854
854
|
|
|
855
|
-
const
|
|
855
|
+
const Wt = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
856
856
|
|
|
857
|
-
const
|
|
857
|
+
const It = (t, e = {}) => s => ct(s, t, e);
|
|
858
858
|
|
|
859
|
-
|
|
859
|
+
ct.filter = It;
|
|
860
860
|
|
|
861
|
-
const
|
|
861
|
+
const _t = (t, e = {}) => Object.assign({}, t, e);
|
|
862
862
|
|
|
863
|
-
const
|
|
863
|
+
const jt = t => {
|
|
864
864
|
if (!t || typeof t !== "object" || !Object.keys(t).length) {
|
|
865
|
-
return
|
|
865
|
+
return ct;
|
|
866
866
|
}
|
|
867
|
-
const e =
|
|
868
|
-
const
|
|
869
|
-
return Object.assign(
|
|
867
|
+
const e = ct;
|
|
868
|
+
const s = (s, i, n = {}) => e(s, i, _t(t, n));
|
|
869
|
+
return Object.assign(s, {
|
|
870
870
|
Minimatch: class Minimatch extends e.Minimatch {
|
|
871
871
|
constructor(e, s = {}) {
|
|
872
|
-
super(e,
|
|
872
|
+
super(e, _t(t, s));
|
|
873
873
|
}
|
|
874
874
|
static defaults(s) {
|
|
875
|
-
return e.defaults(
|
|
875
|
+
return e.defaults(_t(t, s)).Minimatch;
|
|
876
876
|
}
|
|
877
877
|
},
|
|
878
878
|
AST: class AST extends e.AST {
|
|
879
879
|
constructor(e, s, i = {}) {
|
|
880
|
-
super(e, s,
|
|
880
|
+
super(e, s, _t(t, i));
|
|
881
881
|
}
|
|
882
882
|
static fromGlob(s, i = {}) {
|
|
883
|
-
return e.AST.fromGlob(s,
|
|
883
|
+
return e.AST.fromGlob(s, _t(t, i));
|
|
884
884
|
}
|
|
885
885
|
},
|
|
886
|
-
unescape: (s, i = {}) => e.unescape(s,
|
|
887
|
-
escape: (s, i = {}) => e.escape(s,
|
|
888
|
-
filter: (s, i = {}) => e.filter(s,
|
|
889
|
-
defaults: s => e.defaults(
|
|
890
|
-
makeRe: (s, i = {}) => e.makeRe(s,
|
|
891
|
-
braceExpand: (s, i = {}) => e.braceExpand(s,
|
|
892
|
-
match: (s, i, n = {}) => e.match(s, i,
|
|
886
|
+
unescape: (s, i = {}) => e.unescape(s, _t(t, i)),
|
|
887
|
+
escape: (s, i = {}) => e.escape(s, _t(t, i)),
|
|
888
|
+
filter: (s, i = {}) => e.filter(s, _t(t, i)),
|
|
889
|
+
defaults: s => e.defaults(_t(t, s)),
|
|
890
|
+
makeRe: (s, i = {}) => e.makeRe(s, _t(t, i)),
|
|
891
|
+
braceExpand: (s, i = {}) => e.braceExpand(s, _t(t, i)),
|
|
892
|
+
match: (s, i, n = {}) => e.match(s, i, _t(t, n)),
|
|
893
893
|
sep: e.sep,
|
|
894
|
-
GLOBSTAR:
|
|
894
|
+
GLOBSTAR: zt
|
|
895
895
|
});
|
|
896
896
|
};
|
|
897
897
|
|
|
898
|
-
|
|
898
|
+
ct.defaults = jt;
|
|
899
899
|
|
|
900
|
-
const
|
|
901
|
-
|
|
900
|
+
const $t = (t, e = {}) => {
|
|
901
|
+
H(t);
|
|
902
902
|
if (e.nobrace || !/\{(?:(?!\{).)*\}/.test(t)) {
|
|
903
903
|
return [ t ];
|
|
904
904
|
}
|
|
905
|
-
return
|
|
905
|
+
return W(t);
|
|
906
906
|
};
|
|
907
907
|
|
|
908
|
-
|
|
908
|
+
ct.braceExpand = $t;
|
|
909
909
|
|
|
910
|
-
const
|
|
910
|
+
const Ut = (t, e = {}) => new Minimatch(t, e).makeRe();
|
|
911
911
|
|
|
912
|
-
|
|
912
|
+
ct.makeRe = Ut;
|
|
913
913
|
|
|
914
|
-
const
|
|
914
|
+
const Gt = (t, e, s = {}) => {
|
|
915
915
|
const i = new Minimatch(e, s);
|
|
916
916
|
t = t.filter((t => i.match(t)));
|
|
917
917
|
if (i.options.nonull && !t.length) {
|
|
@@ -920,11 +920,11 @@ const match = (t, e, s = {}) => {
|
|
|
920
920
|
return t;
|
|
921
921
|
};
|
|
922
922
|
|
|
923
|
-
|
|
923
|
+
ct.match = Gt;
|
|
924
924
|
|
|
925
|
-
const
|
|
925
|
+
const Ht = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
926
926
|
|
|
927
|
-
const
|
|
927
|
+
const Zt = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
928
928
|
|
|
929
929
|
class Minimatch {
|
|
930
930
|
options;
|
|
@@ -945,11 +945,11 @@ class Minimatch {
|
|
|
945
945
|
windowsNoMagicRoot;
|
|
946
946
|
regexp;
|
|
947
947
|
constructor(t, e = {}) {
|
|
948
|
-
|
|
948
|
+
H(t);
|
|
949
949
|
e = e || {};
|
|
950
950
|
this.options = e;
|
|
951
951
|
this.pattern = t;
|
|
952
|
-
this.platform = e.platform ||
|
|
952
|
+
this.platform = e.platform || Ft;
|
|
953
953
|
this.isWindows = this.platform === "win32";
|
|
954
954
|
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false;
|
|
955
955
|
if (this.windowsPathsNoEscape) {
|
|
@@ -1003,7 +1003,7 @@ class Minimatch {
|
|
|
1003
1003
|
this.debug(this.pattern, this.globParts);
|
|
1004
1004
|
let i = this.globParts.map(((t, e, s) => {
|
|
1005
1005
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
1006
|
-
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !
|
|
1006
|
+
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !Ht.test(t[2])) && !Ht.test(t[3]);
|
|
1007
1007
|
const s = /^[a-z]:/i.test(t[0]);
|
|
1008
1008
|
if (e) {
|
|
1009
1009
|
return [ ...t.slice(0, 4), ...t.slice(4).map((t => this.parse(t))) ];
|
|
@@ -1270,7 +1270,7 @@ class Minimatch {
|
|
|
1270
1270
|
if (l === false) {
|
|
1271
1271
|
return false;
|
|
1272
1272
|
}
|
|
1273
|
-
if (l ===
|
|
1273
|
+
if (l === zt) {
|
|
1274
1274
|
this.debug("GLOBSTAR", [ e, l, c ]);
|
|
1275
1275
|
var f = r;
|
|
1276
1276
|
var u = o + 1;
|
|
@@ -1325,25 +1325,25 @@ class Minimatch {
|
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
1327
1327
|
braceExpand() {
|
|
1328
|
-
return
|
|
1328
|
+
return $t(this.pattern, this.options);
|
|
1329
1329
|
}
|
|
1330
1330
|
parse(t) {
|
|
1331
|
-
|
|
1331
|
+
H(t);
|
|
1332
1332
|
const e = this.options;
|
|
1333
|
-
if (t === "**") return
|
|
1333
|
+
if (t === "**") return zt;
|
|
1334
1334
|
if (t === "") return "";
|
|
1335
1335
|
let s;
|
|
1336
1336
|
let i = null;
|
|
1337
|
-
if (s = t.match(
|
|
1338
|
-
i = e.dot ?
|
|
1339
|
-
} else if (s = t.match(
|
|
1340
|
-
i = (e.nocase ? e.dot ?
|
|
1341
|
-
} else if (s = t.match(
|
|
1342
|
-
i = (e.nocase ? e.dot ?
|
|
1343
|
-
} else if (s = t.match(
|
|
1344
|
-
i = e.dot ?
|
|
1345
|
-
} else if (s = t.match(
|
|
1346
|
-
i =
|
|
1337
|
+
if (s = t.match(kt)) {
|
|
1338
|
+
i = e.dot ? vt : xt;
|
|
1339
|
+
} else if (s = t.match(ft)) {
|
|
1340
|
+
i = (e.nocase ? e.dot ? gt : pt : e.dot ? dt : ut)(s[1]);
|
|
1341
|
+
} else if (s = t.match(Et)) {
|
|
1342
|
+
i = (e.nocase ? e.dot ? Tt : Ct : e.dot ? At : Lt)(s);
|
|
1343
|
+
} else if (s = t.match(mt)) {
|
|
1344
|
+
i = e.dot ? yt : wt;
|
|
1345
|
+
} else if (s = t.match(bt)) {
|
|
1346
|
+
i = St;
|
|
1347
1347
|
}
|
|
1348
1348
|
const n = AST.fromGlob(t, this.options).toMMPattern();
|
|
1349
1349
|
if (i && typeof n === "object") {
|
|
@@ -1361,35 +1361,35 @@ class Minimatch {
|
|
|
1361
1361
|
return this.regexp;
|
|
1362
1362
|
}
|
|
1363
1363
|
const e = this.options;
|
|
1364
|
-
const s = e.noglobstar ?
|
|
1364
|
+
const s = e.noglobstar ? Nt : e.dot ? Bt : Wt;
|
|
1365
1365
|
const i = new Set(e.nocase ? [ "i" ] : []);
|
|
1366
1366
|
let n = t.map((t => {
|
|
1367
1367
|
const e = t.map((t => {
|
|
1368
1368
|
if (t instanceof RegExp) {
|
|
1369
1369
|
for (const e of t.flags.split("")) i.add(e);
|
|
1370
1370
|
}
|
|
1371
|
-
return typeof t === "string" ?
|
|
1371
|
+
return typeof t === "string" ? Zt(t) : t === zt ? zt : t._src;
|
|
1372
1372
|
}));
|
|
1373
1373
|
e.forEach(((t, i) => {
|
|
1374
1374
|
const n = e[i + 1];
|
|
1375
1375
|
const r = e[i - 1];
|
|
1376
|
-
if (t !==
|
|
1376
|
+
if (t !== zt || r === zt) {
|
|
1377
1377
|
return;
|
|
1378
1378
|
}
|
|
1379
1379
|
if (r === undefined) {
|
|
1380
|
-
if (n !== undefined && n !==
|
|
1380
|
+
if (n !== undefined && n !== zt) {
|
|
1381
1381
|
e[i + 1] = "(?:\\/|" + s + "\\/)?" + n;
|
|
1382
1382
|
} else {
|
|
1383
1383
|
e[i] = s;
|
|
1384
1384
|
}
|
|
1385
1385
|
} else if (n === undefined) {
|
|
1386
1386
|
e[i - 1] = r + "(?:\\/|\\/" + s + ")?";
|
|
1387
|
-
} else if (n !==
|
|
1387
|
+
} else if (n !== zt) {
|
|
1388
1388
|
e[i - 1] = r + "(?:\\/|\\/" + s + "\\/)" + n;
|
|
1389
|
-
e[i + 1] =
|
|
1389
|
+
e[i + 1] = zt;
|
|
1390
1390
|
}
|
|
1391
1391
|
}));
|
|
1392
|
-
const n = e.filter((t => t !==
|
|
1392
|
+
const n = e.filter((t => t !== zt));
|
|
1393
1393
|
if (this.partial && n.length >= 1) {
|
|
1394
1394
|
const t = [];
|
|
1395
1395
|
for (let e = 1; e <= n.length; e++) {
|
|
@@ -1466,34 +1466,34 @@ class Minimatch {
|
|
|
1466
1466
|
return this.negate;
|
|
1467
1467
|
}
|
|
1468
1468
|
static defaults(t) {
|
|
1469
|
-
return
|
|
1469
|
+
return ct.defaults(t).Minimatch;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
1472
|
|
|
1473
|
-
|
|
1473
|
+
ct.AST = AST;
|
|
1474
1474
|
|
|
1475
|
-
|
|
1475
|
+
ct.Minimatch = Minimatch;
|
|
1476
1476
|
|
|
1477
|
-
|
|
1477
|
+
ct.escape = lt;
|
|
1478
1478
|
|
|
1479
|
-
|
|
1479
|
+
ct.unescape = Y;
|
|
1480
1480
|
|
|
1481
|
-
const
|
|
1481
|
+
const qt = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
1482
1482
|
|
|
1483
|
-
const
|
|
1483
|
+
const Vt = new Set;
|
|
1484
1484
|
|
|
1485
|
-
const
|
|
1485
|
+
const Jt = typeof process === "object" && !!process ? process : {};
|
|
1486
1486
|
|
|
1487
|
-
const
|
|
1488
|
-
typeof
|
|
1487
|
+
const Kt = (t, e, s, i) => {
|
|
1488
|
+
typeof Jt.emitWarning === "function" ? Jt.emitWarning(t, e, s, i) : console.error(`[${s}] ${e}: ${t}`);
|
|
1489
1489
|
};
|
|
1490
1490
|
|
|
1491
|
-
let
|
|
1491
|
+
let Yt = globalThis.AbortController;
|
|
1492
1492
|
|
|
1493
|
-
let
|
|
1493
|
+
let Xt = globalThis.AbortSignal;
|
|
1494
1494
|
|
|
1495
|
-
if (typeof
|
|
1496
|
-
|
|
1495
|
+
if (typeof Yt === "undefined") {
|
|
1496
|
+
Xt = class AbortSignal {
|
|
1497
1497
|
onabort;
|
|
1498
1498
|
_onabort=[];
|
|
1499
1499
|
reason;
|
|
@@ -1502,11 +1502,11 @@ if (typeof ot === "undefined") {
|
|
|
1502
1502
|
this._onabort.push(e);
|
|
1503
1503
|
}
|
|
1504
1504
|
};
|
|
1505
|
-
|
|
1505
|
+
Yt = class AbortController {
|
|
1506
1506
|
constructor() {
|
|
1507
|
-
|
|
1507
|
+
e();
|
|
1508
1508
|
}
|
|
1509
|
-
signal=new
|
|
1509
|
+
signal=new Xt;
|
|
1510
1510
|
abort(t) {
|
|
1511
1511
|
if (this.signal.aborted) return;
|
|
1512
1512
|
this.signal.reason = t;
|
|
@@ -1517,21 +1517,21 @@ if (typeof ot === "undefined") {
|
|
|
1517
1517
|
this.signal.onabort?.(t);
|
|
1518
1518
|
}
|
|
1519
1519
|
};
|
|
1520
|
-
let t =
|
|
1521
|
-
const
|
|
1520
|
+
let t = Jt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1521
|
+
const e = () => {
|
|
1522
1522
|
if (!t) return;
|
|
1523
1523
|
t = false;
|
|
1524
|
-
|
|
1524
|
+
Kt("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);
|
|
1525
1525
|
};
|
|
1526
1526
|
}
|
|
1527
1527
|
|
|
1528
|
-
const
|
|
1528
|
+
const Qt = t => !Vt.has(t);
|
|
1529
1529
|
|
|
1530
|
-
const
|
|
1530
|
+
const te = Symbol("type");
|
|
1531
1531
|
|
|
1532
|
-
const
|
|
1532
|
+
const ee = t => t && t === Math.floor(t) && t > 0 && isFinite(t);
|
|
1533
1533
|
|
|
1534
|
-
const
|
|
1534
|
+
const se = t => !ee(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;
|
|
1535
1535
|
|
|
1536
1536
|
class ZeroArray extends Array {
|
|
1537
1537
|
constructor(t) {
|
|
@@ -1545,7 +1545,7 @@ class Stack {
|
|
|
1545
1545
|
length;
|
|
1546
1546
|
static #g=false;
|
|
1547
1547
|
static create(t) {
|
|
1548
|
-
const e =
|
|
1548
|
+
const e = se(t);
|
|
1549
1549
|
if (!e) return [];
|
|
1550
1550
|
Stack.#g = true;
|
|
1551
1551
|
const s = new Stack(t, e);
|
|
@@ -1569,8 +1569,8 @@ class Stack {
|
|
|
1569
1569
|
|
|
1570
1570
|
class LRUCache {
|
|
1571
1571
|
#m;
|
|
1572
|
-
#y;
|
|
1573
1572
|
#w;
|
|
1573
|
+
#y;
|
|
1574
1574
|
#b;
|
|
1575
1575
|
#S;
|
|
1576
1576
|
#k;
|
|
@@ -1603,15 +1603,15 @@ class LRUCache {
|
|
|
1603
1603
|
#O;
|
|
1604
1604
|
#z;
|
|
1605
1605
|
#D;
|
|
1606
|
-
#B;
|
|
1607
1606
|
#N;
|
|
1608
|
-
#
|
|
1607
|
+
#B;
|
|
1609
1608
|
#W;
|
|
1609
|
+
#I;
|
|
1610
1610
|
#_;
|
|
1611
1611
|
static unsafeExposeInternals(t) {
|
|
1612
1612
|
return {
|
|
1613
1613
|
starts: t.#D,
|
|
1614
|
-
ttls: t.#
|
|
1614
|
+
ttls: t.#N,
|
|
1615
1615
|
sizes: t.#z,
|
|
1616
1616
|
keyMap: t.#C,
|
|
1617
1617
|
keyList: t.#T,
|
|
@@ -1627,8 +1627,8 @@ class LRUCache {
|
|
|
1627
1627
|
free: t.#R,
|
|
1628
1628
|
isBackgroundFetch: e => t.#j(e),
|
|
1629
1629
|
backgroundFetch: (e, s, i, n) => t.#$(e, s, i, n),
|
|
1630
|
-
moveToTail: e => t.#
|
|
1631
|
-
indexes: e => t.#
|
|
1630
|
+
moveToTail: e => t.#U(e),
|
|
1631
|
+
indexes: e => t.#G(e),
|
|
1632
1632
|
rindexes: e => t.#H(e),
|
|
1633
1633
|
isStale: e => t.#Z(e)
|
|
1634
1634
|
};
|
|
@@ -1637,7 +1637,7 @@ class LRUCache {
|
|
|
1637
1637
|
return this.#m;
|
|
1638
1638
|
}
|
|
1639
1639
|
get maxSize() {
|
|
1640
|
-
return this.#
|
|
1640
|
+
return this.#w;
|
|
1641
1641
|
}
|
|
1642
1642
|
get calculatedSize() {
|
|
1643
1643
|
return this.#E;
|
|
@@ -1652,7 +1652,7 @@ class LRUCache {
|
|
|
1652
1652
|
return this.#x;
|
|
1653
1653
|
}
|
|
1654
1654
|
get dispose() {
|
|
1655
|
-
return this.#
|
|
1655
|
+
return this.#y;
|
|
1656
1656
|
}
|
|
1657
1657
|
get onInsert() {
|
|
1658
1658
|
return this.#b;
|
|
@@ -1661,20 +1661,20 @@ class LRUCache {
|
|
|
1661
1661
|
return this.#S;
|
|
1662
1662
|
}
|
|
1663
1663
|
constructor(t) {
|
|
1664
|
-
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:
|
|
1665
|
-
if (e !== 0 && !
|
|
1664
|
+
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: x} = t;
|
|
1665
|
+
if (e !== 0 && !ee(e)) {
|
|
1666
1666
|
throw new TypeError("max option must be a nonnegative integer");
|
|
1667
1667
|
}
|
|
1668
|
-
const
|
|
1669
|
-
if (!
|
|
1668
|
+
const v = e ? se(e) : Array;
|
|
1669
|
+
if (!v) {
|
|
1670
1670
|
throw new Error("invalid max value: " + e);
|
|
1671
1671
|
}
|
|
1672
1672
|
this.#m = e;
|
|
1673
|
-
this.#
|
|
1674
|
-
this.maxEntrySize = p || this.#
|
|
1673
|
+
this.#w = d;
|
|
1674
|
+
this.maxEntrySize = p || this.#w;
|
|
1675
1675
|
this.sizeCalculation = g;
|
|
1676
1676
|
if (this.sizeCalculation) {
|
|
1677
|
-
if (!this.#
|
|
1677
|
+
if (!this.#w && !this.maxEntrySize) {
|
|
1678
1678
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1679
1679
|
}
|
|
1680
1680
|
if (typeof this.sizeCalculation !== "function") {
|
|
@@ -1685,23 +1685,23 @@ class LRUCache {
|
|
|
1685
1685
|
throw new TypeError("memoMethod must be a function if defined");
|
|
1686
1686
|
}
|
|
1687
1687
|
this.#x = w;
|
|
1688
|
-
if (
|
|
1688
|
+
if (m !== undefined && typeof m !== "function") {
|
|
1689
1689
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
1690
1690
|
}
|
|
1691
|
-
this.#k =
|
|
1692
|
-
this.#
|
|
1691
|
+
this.#k = m;
|
|
1692
|
+
this.#W = !!m;
|
|
1693
1693
|
this.#C = new Map;
|
|
1694
1694
|
this.#T = new Array(e).fill(undefined);
|
|
1695
1695
|
this.#A = new Array(e).fill(undefined);
|
|
1696
|
-
this.#L = new
|
|
1697
|
-
this.#M = new
|
|
1696
|
+
this.#L = new v(e);
|
|
1697
|
+
this.#M = new v(e);
|
|
1698
1698
|
this.#P = 0;
|
|
1699
1699
|
this.#F = 0;
|
|
1700
1700
|
this.#R = Stack.create(e);
|
|
1701
1701
|
this.#v = 0;
|
|
1702
1702
|
this.#E = 0;
|
|
1703
1703
|
if (typeof a === "function") {
|
|
1704
|
-
this.#
|
|
1704
|
+
this.#y = a;
|
|
1705
1705
|
}
|
|
1706
1706
|
if (typeof l === "function") {
|
|
1707
1707
|
this.#b = l;
|
|
@@ -1713,48 +1713,48 @@ class LRUCache {
|
|
|
1713
1713
|
this.#S = undefined;
|
|
1714
1714
|
this.#O = undefined;
|
|
1715
1715
|
}
|
|
1716
|
-
this.#
|
|
1716
|
+
this.#B = !!this.#y;
|
|
1717
1717
|
this.#_ = !!this.#b;
|
|
1718
|
-
this.#
|
|
1718
|
+
this.#I = !!this.#S;
|
|
1719
1719
|
this.noDisposeOnSet = !!f;
|
|
1720
1720
|
this.noUpdateTTL = !!u;
|
|
1721
|
-
this.noDeleteOnFetchRejection = !!
|
|
1722
|
-
this.allowStaleOnFetchRejection = !!
|
|
1723
|
-
this.allowStaleOnFetchAbort = !!
|
|
1724
|
-
this.ignoreFetchAbort = !!
|
|
1721
|
+
this.noDeleteOnFetchRejection = !!y;
|
|
1722
|
+
this.allowStaleOnFetchRejection = !!S;
|
|
1723
|
+
this.allowStaleOnFetchAbort = !!k;
|
|
1724
|
+
this.ignoreFetchAbort = !!x;
|
|
1725
1725
|
if (this.maxEntrySize !== 0) {
|
|
1726
|
-
if (this.#
|
|
1727
|
-
if (!
|
|
1726
|
+
if (this.#w !== 0) {
|
|
1727
|
+
if (!ee(this.#w)) {
|
|
1728
1728
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
if (!
|
|
1731
|
+
if (!ee(this.maxEntrySize)) {
|
|
1732
1732
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1733
1733
|
}
|
|
1734
1734
|
this.#q();
|
|
1735
1735
|
}
|
|
1736
1736
|
this.allowStale = !!h;
|
|
1737
|
-
this.noDeleteOnStaleGet = !!
|
|
1737
|
+
this.noDeleteOnStaleGet = !!b;
|
|
1738
1738
|
this.updateAgeOnGet = !!r;
|
|
1739
1739
|
this.updateAgeOnHas = !!o;
|
|
1740
|
-
this.ttlResolution =
|
|
1740
|
+
this.ttlResolution = ee(i) || i === 0 ? i : 1;
|
|
1741
1741
|
this.ttlAutopurge = !!n;
|
|
1742
1742
|
this.ttl = s || 0;
|
|
1743
1743
|
if (this.ttl) {
|
|
1744
|
-
if (!
|
|
1744
|
+
if (!ee(this.ttl)) {
|
|
1745
1745
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
1746
1746
|
}
|
|
1747
1747
|
this.#V();
|
|
1748
1748
|
}
|
|
1749
|
-
if (this.#m === 0 && this.ttl === 0 && this.#
|
|
1749
|
+
if (this.#m === 0 && this.ttl === 0 && this.#w === 0) {
|
|
1750
1750
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1751
1751
|
}
|
|
1752
|
-
if (!this.ttlAutopurge && !this.#m && !this.#
|
|
1752
|
+
if (!this.ttlAutopurge && !this.#m && !this.#w) {
|
|
1753
1753
|
const t = "LRU_CACHE_UNBOUNDED";
|
|
1754
|
-
if (
|
|
1755
|
-
|
|
1754
|
+
if (Qt(t)) {
|
|
1755
|
+
Vt.add(t);
|
|
1756
1756
|
const e = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
|
1757
|
-
|
|
1757
|
+
Kt(e, "UnboundedCacheWarning", t, LRUCache);
|
|
1758
1758
|
}
|
|
1759
1759
|
}
|
|
1760
1760
|
}
|
|
@@ -1764,9 +1764,9 @@ class LRUCache {
|
|
|
1764
1764
|
#V() {
|
|
1765
1765
|
const t = new ZeroArray(this.#m);
|
|
1766
1766
|
const e = new ZeroArray(this.#m);
|
|
1767
|
-
this.#
|
|
1767
|
+
this.#N = t;
|
|
1768
1768
|
this.#D = e;
|
|
1769
|
-
this.#J = (s, i, n =
|
|
1769
|
+
this.#J = (s, i, n = qt.now()) => {
|
|
1770
1770
|
e[s] = i !== 0 ? n : 0;
|
|
1771
1771
|
t[s] = i;
|
|
1772
1772
|
if (i !== 0 && this.ttlAutopurge) {
|
|
@@ -1781,23 +1781,23 @@ class LRUCache {
|
|
|
1781
1781
|
}
|
|
1782
1782
|
};
|
|
1783
1783
|
this.#Y = s => {
|
|
1784
|
-
e[s] = t[s] !== 0 ?
|
|
1784
|
+
e[s] = t[s] !== 0 ? qt.now() : 0;
|
|
1785
1785
|
};
|
|
1786
|
-
this.#X = (
|
|
1787
|
-
if (t[
|
|
1788
|
-
const
|
|
1789
|
-
const
|
|
1790
|
-
if (!
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
const
|
|
1795
|
-
|
|
1786
|
+
this.#X = (n, r) => {
|
|
1787
|
+
if (t[r]) {
|
|
1788
|
+
const o = t[r];
|
|
1789
|
+
const h = e[r];
|
|
1790
|
+
if (!o || !h) return;
|
|
1791
|
+
n.ttl = o;
|
|
1792
|
+
n.start = h;
|
|
1793
|
+
n.now = s || i();
|
|
1794
|
+
const a = n.now - h;
|
|
1795
|
+
n.remainingTTL = o - a;
|
|
1796
1796
|
}
|
|
1797
1797
|
};
|
|
1798
1798
|
let s = 0;
|
|
1799
|
-
const
|
|
1800
|
-
const t =
|
|
1799
|
+
const i = () => {
|
|
1800
|
+
const t = qt.now();
|
|
1801
1801
|
if (this.ttlResolution > 0) {
|
|
1802
1802
|
s = t;
|
|
1803
1803
|
const e = setTimeout((() => s = 0), this.ttlResolution);
|
|
@@ -1807,23 +1807,23 @@ class LRUCache {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
return t;
|
|
1809
1809
|
};
|
|
1810
|
-
this.getRemainingTTL =
|
|
1811
|
-
const
|
|
1812
|
-
if (
|
|
1810
|
+
this.getRemainingTTL = n => {
|
|
1811
|
+
const r = this.#C.get(n);
|
|
1812
|
+
if (r === undefined) {
|
|
1813
1813
|
return 0;
|
|
1814
1814
|
}
|
|
1815
|
-
const
|
|
1816
|
-
const
|
|
1817
|
-
if (!
|
|
1815
|
+
const o = t[r];
|
|
1816
|
+
const h = e[r];
|
|
1817
|
+
if (!o || !h) {
|
|
1818
1818
|
return Infinity;
|
|
1819
1819
|
}
|
|
1820
|
-
const
|
|
1821
|
-
return
|
|
1820
|
+
const a = (s || i()) - h;
|
|
1821
|
+
return o - a;
|
|
1822
1822
|
};
|
|
1823
|
-
this.#Z =
|
|
1824
|
-
const
|
|
1825
|
-
const
|
|
1826
|
-
return !!
|
|
1823
|
+
this.#Z = n => {
|
|
1824
|
+
const r = e[n];
|
|
1825
|
+
const o = t[n];
|
|
1826
|
+
return !!o && !!r && (s || i()) - r > o;
|
|
1827
1827
|
};
|
|
1828
1828
|
}
|
|
1829
1829
|
#Y=() => {};
|
|
@@ -1842,13 +1842,13 @@ class LRUCache {
|
|
|
1842
1842
|
if (this.#j(e)) {
|
|
1843
1843
|
return 0;
|
|
1844
1844
|
}
|
|
1845
|
-
if (!
|
|
1845
|
+
if (!ee(s)) {
|
|
1846
1846
|
if (i) {
|
|
1847
1847
|
if (typeof i !== "function") {
|
|
1848
1848
|
throw new TypeError("sizeCalculation must be a function");
|
|
1849
1849
|
}
|
|
1850
1850
|
s = i(e, t);
|
|
1851
|
-
if (!
|
|
1851
|
+
if (!ee(s)) {
|
|
1852
1852
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1853
1853
|
}
|
|
1854
1854
|
} else {
|
|
@@ -1859,8 +1859,8 @@ class LRUCache {
|
|
|
1859
1859
|
};
|
|
1860
1860
|
this.#et = (e, s, i) => {
|
|
1861
1861
|
t[e] = s;
|
|
1862
|
-
if (this.#
|
|
1863
|
-
const s = this.#
|
|
1862
|
+
if (this.#w) {
|
|
1863
|
+
const s = this.#w - t[e];
|
|
1864
1864
|
while (this.#E > s) {
|
|
1865
1865
|
this.#st(true);
|
|
1866
1866
|
}
|
|
@@ -1880,7 +1880,7 @@ class LRUCache {
|
|
|
1880
1880
|
}
|
|
1881
1881
|
return 0;
|
|
1882
1882
|
};
|
|
1883
|
-
* #
|
|
1883
|
+
* #G({allowStale: t = this.allowStale} = {}) {
|
|
1884
1884
|
if (this.#v) {
|
|
1885
1885
|
for (let e = this.#F; true; ) {
|
|
1886
1886
|
if (!this.#it(e)) {
|
|
@@ -1918,7 +1918,7 @@ class LRUCache {
|
|
|
1918
1918
|
return t !== undefined && this.#C.get(this.#T[t]) === t;
|
|
1919
1919
|
}
|
|
1920
1920
|
* entries() {
|
|
1921
|
-
for (const t of this.#
|
|
1921
|
+
for (const t of this.#G()) {
|
|
1922
1922
|
if (this.#A[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#A[t])) {
|
|
1923
1923
|
yield [ this.#T[t], this.#A[t] ];
|
|
1924
1924
|
}
|
|
@@ -1932,7 +1932,7 @@ class LRUCache {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
1934
|
* keys() {
|
|
1935
|
-
for (const t of this.#
|
|
1935
|
+
for (const t of this.#G()) {
|
|
1936
1936
|
const e = this.#T[t];
|
|
1937
1937
|
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1938
1938
|
yield e;
|
|
@@ -1948,7 +1948,7 @@ class LRUCache {
|
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
* values() {
|
|
1951
|
-
for (const t of this.#
|
|
1951
|
+
for (const t of this.#G()) {
|
|
1952
1952
|
const e = this.#A[t];
|
|
1953
1953
|
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1954
1954
|
yield this.#A[t];
|
|
@@ -1968,7 +1968,7 @@ class LRUCache {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
[Symbol.toStringTag]="LRUCache";
|
|
1970
1970
|
find(t, e = {}) {
|
|
1971
|
-
for (const s of this.#
|
|
1971
|
+
for (const s of this.#G()) {
|
|
1972
1972
|
const i = this.#A[s];
|
|
1973
1973
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1974
1974
|
if (n === undefined) continue;
|
|
@@ -1978,7 +1978,7 @@ class LRUCache {
|
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
1980
|
forEach(t, e = this) {
|
|
1981
|
-
for (const s of this.#
|
|
1981
|
+
for (const s of this.#G()) {
|
|
1982
1982
|
const i = this.#A[s];
|
|
1983
1983
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1984
1984
|
if (n === undefined) continue;
|
|
@@ -2014,11 +2014,11 @@ class LRUCache {
|
|
|
2014
2014
|
const n = {
|
|
2015
2015
|
value: i
|
|
2016
2016
|
};
|
|
2017
|
-
if (this.#
|
|
2018
|
-
const t = this.#
|
|
2017
|
+
if (this.#N && this.#D) {
|
|
2018
|
+
const t = this.#N[e];
|
|
2019
2019
|
const s = this.#D[e];
|
|
2020
2020
|
if (t && s) {
|
|
2021
|
-
const e = t - (
|
|
2021
|
+
const e = t - (qt.now() - s);
|
|
2022
2022
|
n.ttl = e;
|
|
2023
2023
|
n.start = Date.now();
|
|
2024
2024
|
}
|
|
@@ -2030,7 +2030,7 @@ class LRUCache {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
dump() {
|
|
2032
2032
|
const t = [];
|
|
2033
|
-
for (const e of this.#
|
|
2033
|
+
for (const e of this.#G({
|
|
2034
2034
|
allowStale: true
|
|
2035
2035
|
})) {
|
|
2036
2036
|
const s = this.#T[e];
|
|
@@ -2040,9 +2040,9 @@ class LRUCache {
|
|
|
2040
2040
|
const r = {
|
|
2041
2041
|
value: n
|
|
2042
2042
|
};
|
|
2043
|
-
if (this.#
|
|
2044
|
-
r.ttl = this.#
|
|
2045
|
-
const t =
|
|
2043
|
+
if (this.#N && this.#D) {
|
|
2044
|
+
r.ttl = this.#N[e];
|
|
2045
|
+
const t = qt.now() - this.#D[e];
|
|
2046
2046
|
r.start = Math.floor(Date.now() - t);
|
|
2047
2047
|
}
|
|
2048
2048
|
if (this.#z) {
|
|
@@ -2057,7 +2057,7 @@ class LRUCache {
|
|
|
2057
2057
|
for (const [e, s] of t) {
|
|
2058
2058
|
if (s.start) {
|
|
2059
2059
|
const t = Date.now() - s.start;
|
|
2060
|
-
s.start =
|
|
2060
|
+
s.start = qt.now() - t;
|
|
2061
2061
|
}
|
|
2062
2062
|
this.set(e, s.value, s);
|
|
2063
2063
|
}
|
|
@@ -2095,25 +2095,25 @@ class LRUCache {
|
|
|
2095
2095
|
this.#b?.(e, t, "add");
|
|
2096
2096
|
}
|
|
2097
2097
|
} else {
|
|
2098
|
-
this.#
|
|
2098
|
+
this.#U(c);
|
|
2099
2099
|
const s = this.#A[c];
|
|
2100
2100
|
if (e !== s) {
|
|
2101
|
-
if (this.#
|
|
2101
|
+
if (this.#W && this.#j(s)) {
|
|
2102
2102
|
s.__abortController.abort(new Error("replaced"));
|
|
2103
2103
|
const {__staleWhileFetching: e} = s;
|
|
2104
2104
|
if (e !== undefined && !r) {
|
|
2105
|
-
if (this.#
|
|
2106
|
-
this.#
|
|
2105
|
+
if (this.#B) {
|
|
2106
|
+
this.#y?.(e, t, "set");
|
|
2107
2107
|
}
|
|
2108
|
-
if (this.#
|
|
2108
|
+
if (this.#I) {
|
|
2109
2109
|
this.#O?.push([ e, t, "set" ]);
|
|
2110
2110
|
}
|
|
2111
2111
|
}
|
|
2112
2112
|
} else if (!r) {
|
|
2113
|
-
if (this.#
|
|
2114
|
-
this.#
|
|
2113
|
+
if (this.#B) {
|
|
2114
|
+
this.#y?.(s, t, "set");
|
|
2115
2115
|
}
|
|
2116
|
-
if (this.#
|
|
2116
|
+
if (this.#I) {
|
|
2117
2117
|
this.#O?.push([ s, t, "set" ]);
|
|
2118
2118
|
}
|
|
2119
2119
|
}
|
|
@@ -2132,16 +2132,16 @@ class LRUCache {
|
|
|
2132
2132
|
this.onInsert?.(e, t, e === s ? "update" : "replace");
|
|
2133
2133
|
}
|
|
2134
2134
|
}
|
|
2135
|
-
if (i !== 0 && !this.#
|
|
2135
|
+
if (i !== 0 && !this.#N) {
|
|
2136
2136
|
this.#V();
|
|
2137
2137
|
}
|
|
2138
|
-
if (this.#
|
|
2138
|
+
if (this.#N) {
|
|
2139
2139
|
if (!a) {
|
|
2140
2140
|
this.#J(c, i, n);
|
|
2141
2141
|
}
|
|
2142
2142
|
if (h) this.#X(h, c);
|
|
2143
2143
|
}
|
|
2144
|
-
if (!r && this.#
|
|
2144
|
+
if (!r && this.#I && this.#O) {
|
|
2145
2145
|
const t = this.#O;
|
|
2146
2146
|
let e;
|
|
2147
2147
|
while (e = t?.shift()) {
|
|
@@ -2164,7 +2164,7 @@ class LRUCache {
|
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
} finally {
|
|
2167
|
-
if (this.#
|
|
2167
|
+
if (this.#I && this.#O) {
|
|
2168
2168
|
const t = this.#O;
|
|
2169
2169
|
let e;
|
|
2170
2170
|
while (e = t?.shift()) {
|
|
@@ -2177,13 +2177,13 @@ class LRUCache {
|
|
|
2177
2177
|
const e = this.#P;
|
|
2178
2178
|
const s = this.#T[e];
|
|
2179
2179
|
const i = this.#A[e];
|
|
2180
|
-
if (this.#
|
|
2180
|
+
if (this.#W && this.#j(i)) {
|
|
2181
2181
|
i.__abortController.abort(new Error("evicted"));
|
|
2182
|
-
} else if (this.#
|
|
2183
|
-
if (this.#
|
|
2184
|
-
this.#
|
|
2182
|
+
} else if (this.#B || this.#I) {
|
|
2183
|
+
if (this.#B) {
|
|
2184
|
+
this.#y?.(i, s, "evict");
|
|
2185
2185
|
}
|
|
2186
|
-
if (this.#
|
|
2186
|
+
if (this.#I) {
|
|
2187
2187
|
this.#O?.push([ i, s, "evict" ]);
|
|
2188
2188
|
}
|
|
2189
2189
|
}
|
|
@@ -2243,7 +2243,7 @@ class LRUCache {
|
|
|
2243
2243
|
if (this.#j(n)) {
|
|
2244
2244
|
return n;
|
|
2245
2245
|
}
|
|
2246
|
-
const r = new
|
|
2246
|
+
const r = new Yt;
|
|
2247
2247
|
const {signal: o} = s;
|
|
2248
2248
|
o?.addEventListener("abort", (() => r.abort(o.reason)), {
|
|
2249
2249
|
signal: r.signal
|
|
@@ -2253,26 +2253,26 @@ class LRUCache {
|
|
|
2253
2253
|
options: s,
|
|
2254
2254
|
context: i
|
|
2255
2255
|
};
|
|
2256
|
-
const
|
|
2256
|
+
const a = (i, n = false) => {
|
|
2257
2257
|
const {aborted: o} = r.signal;
|
|
2258
|
-
const
|
|
2258
|
+
const a = s.ignoreFetchAbort && i !== undefined;
|
|
2259
2259
|
if (s.status) {
|
|
2260
2260
|
if (o && !n) {
|
|
2261
2261
|
s.status.fetchAborted = true;
|
|
2262
2262
|
s.status.fetchError = r.signal.reason;
|
|
2263
|
-
if (
|
|
2263
|
+
if (a) s.status.fetchAbortIgnored = true;
|
|
2264
2264
|
} else {
|
|
2265
2265
|
s.status.fetchResolved = true;
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
|
-
if (o && !
|
|
2269
|
-
return
|
|
2268
|
+
if (o && !a && !n) {
|
|
2269
|
+
return c(r.signal.reason);
|
|
2270
2270
|
}
|
|
2271
|
-
const
|
|
2272
|
-
if (this.#A[e] ===
|
|
2271
|
+
const l = u;
|
|
2272
|
+
if (this.#A[e] === u) {
|
|
2273
2273
|
if (i === undefined) {
|
|
2274
|
-
if (
|
|
2275
|
-
this.#A[e] =
|
|
2274
|
+
if (l.__staleWhileFetching) {
|
|
2275
|
+
this.#A[e] = l.__staleWhileFetching;
|
|
2276
2276
|
} else {
|
|
2277
2277
|
this.#K(t, "fetch");
|
|
2278
2278
|
}
|
|
@@ -2283,37 +2283,37 @@ class LRUCache {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
return i;
|
|
2285
2285
|
};
|
|
2286
|
-
const
|
|
2286
|
+
const l = t => {
|
|
2287
2287
|
if (s.status) {
|
|
2288
2288
|
s.status.fetchRejected = true;
|
|
2289
2289
|
s.status.fetchError = t;
|
|
2290
2290
|
}
|
|
2291
|
-
return
|
|
2291
|
+
return c(t);
|
|
2292
2292
|
};
|
|
2293
|
-
const
|
|
2293
|
+
const c = i => {
|
|
2294
2294
|
const {aborted: n} = r.signal;
|
|
2295
2295
|
const o = n && s.allowStaleOnFetchAbort;
|
|
2296
2296
|
const h = o || s.allowStaleOnFetchRejection;
|
|
2297
|
-
const
|
|
2298
|
-
const
|
|
2299
|
-
if (this.#A[e] ===
|
|
2300
|
-
const s = !
|
|
2297
|
+
const a = h || s.noDeleteOnFetchRejection;
|
|
2298
|
+
const l = u;
|
|
2299
|
+
if (this.#A[e] === u) {
|
|
2300
|
+
const s = !a || l.__staleWhileFetching === undefined;
|
|
2301
2301
|
if (s) {
|
|
2302
2302
|
this.#K(t, "fetch");
|
|
2303
2303
|
} else if (!o) {
|
|
2304
|
-
this.#A[e] =
|
|
2304
|
+
this.#A[e] = l.__staleWhileFetching;
|
|
2305
2305
|
}
|
|
2306
2306
|
}
|
|
2307
2307
|
if (h) {
|
|
2308
|
-
if (s.status &&
|
|
2308
|
+
if (s.status && l.__staleWhileFetching !== undefined) {
|
|
2309
2309
|
s.status.returnedStale = true;
|
|
2310
2310
|
}
|
|
2311
|
-
return
|
|
2312
|
-
} else if (
|
|
2311
|
+
return l.__staleWhileFetching;
|
|
2312
|
+
} else if (l.__returned === l) {
|
|
2313
2313
|
throw i;
|
|
2314
2314
|
}
|
|
2315
2315
|
};
|
|
2316
|
-
const
|
|
2316
|
+
const f = (e, i) => {
|
|
2317
2317
|
const o = this.#k?.(t, n, h);
|
|
2318
2318
|
if (o && o instanceof Promise) {
|
|
2319
2319
|
o.then((t => e(t === undefined ? undefined : t)), i);
|
|
@@ -2322,46 +2322,46 @@ class LRUCache {
|
|
|
2322
2322
|
if (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) {
|
|
2323
2323
|
e(undefined);
|
|
2324
2324
|
if (s.allowStaleOnFetchAbort) {
|
|
2325
|
-
e = t =>
|
|
2325
|
+
e = t => a(t, true);
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
2328
|
}));
|
|
2329
2329
|
};
|
|
2330
2330
|
if (s.status) s.status.fetchDispatched = true;
|
|
2331
|
-
const
|
|
2332
|
-
const
|
|
2331
|
+
const u = new Promise(f).then(a, l);
|
|
2332
|
+
const d = Object.assign(u, {
|
|
2333
2333
|
__abortController: r,
|
|
2334
2334
|
__staleWhileFetching: n,
|
|
2335
2335
|
__returned: undefined
|
|
2336
2336
|
});
|
|
2337
2337
|
if (e === undefined) {
|
|
2338
|
-
this.set(t,
|
|
2338
|
+
this.set(t, d, {
|
|
2339
2339
|
...h.options,
|
|
2340
2340
|
status: undefined
|
|
2341
2341
|
});
|
|
2342
2342
|
e = this.#C.get(t);
|
|
2343
2343
|
} else {
|
|
2344
|
-
this.#A[e] =
|
|
2344
|
+
this.#A[e] = d;
|
|
2345
2345
|
}
|
|
2346
|
-
return
|
|
2346
|
+
return d;
|
|
2347
2347
|
}
|
|
2348
2348
|
#j(t) {
|
|
2349
|
-
if (!this.#
|
|
2349
|
+
if (!this.#W) return false;
|
|
2350
2350
|
const e = t;
|
|
2351
|
-
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof
|
|
2351
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof Yt;
|
|
2352
2352
|
}
|
|
2353
2353
|
async fetch(t, e = {}) {
|
|
2354
|
-
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:
|
|
2355
|
-
if (!this.#
|
|
2356
|
-
if (
|
|
2354
|
+
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;
|
|
2355
|
+
if (!this.#W) {
|
|
2356
|
+
if (m) m.fetch = "get";
|
|
2357
2357
|
return this.get(t, {
|
|
2358
2358
|
allowStale: s,
|
|
2359
2359
|
updateAgeOnGet: i,
|
|
2360
2360
|
noDeleteOnStaleGet: n,
|
|
2361
|
-
status:
|
|
2361
|
+
status: m
|
|
2362
2362
|
});
|
|
2363
2363
|
}
|
|
2364
|
-
const
|
|
2364
|
+
const y = {
|
|
2365
2365
|
allowStale: s,
|
|
2366
2366
|
updateAgeOnGet: i,
|
|
2367
2367
|
noDeleteOnStaleGet: n,
|
|
@@ -2374,40 +2374,40 @@ class LRUCache {
|
|
|
2374
2374
|
allowStaleOnFetchRejection: f,
|
|
2375
2375
|
allowStaleOnFetchAbort: d,
|
|
2376
2376
|
ignoreFetchAbort: u,
|
|
2377
|
-
status:
|
|
2377
|
+
status: m,
|
|
2378
2378
|
signal: w
|
|
2379
2379
|
};
|
|
2380
|
-
let
|
|
2381
|
-
if (
|
|
2382
|
-
if (
|
|
2383
|
-
const e = this.#$(t,
|
|
2380
|
+
let b = this.#C.get(t);
|
|
2381
|
+
if (b === undefined) {
|
|
2382
|
+
if (m) m.fetch = "miss";
|
|
2383
|
+
const e = this.#$(t, b, y, p);
|
|
2384
2384
|
return e.__returned = e;
|
|
2385
2385
|
} else {
|
|
2386
|
-
const e = this.#A[
|
|
2386
|
+
const e = this.#A[b];
|
|
2387
2387
|
if (this.#j(e)) {
|
|
2388
2388
|
const t = s && e.__staleWhileFetching !== undefined;
|
|
2389
|
-
if (
|
|
2390
|
-
|
|
2391
|
-
if (t)
|
|
2389
|
+
if (m) {
|
|
2390
|
+
m.fetch = "inflight";
|
|
2391
|
+
if (t) m.returnedStale = true;
|
|
2392
2392
|
}
|
|
2393
2393
|
return t ? e.__staleWhileFetching : e.__returned = e;
|
|
2394
2394
|
}
|
|
2395
|
-
const n = this.#Z(
|
|
2395
|
+
const n = this.#Z(b);
|
|
2396
2396
|
if (!g && !n) {
|
|
2397
|
-
if (
|
|
2398
|
-
this.#
|
|
2397
|
+
if (m) m.fetch = "hit";
|
|
2398
|
+
this.#U(b);
|
|
2399
2399
|
if (i) {
|
|
2400
|
-
this.#Y(
|
|
2400
|
+
this.#Y(b);
|
|
2401
2401
|
}
|
|
2402
|
-
if (
|
|
2402
|
+
if (m) this.#X(m, b);
|
|
2403
2403
|
return e;
|
|
2404
2404
|
}
|
|
2405
|
-
const r = this.#$(t,
|
|
2405
|
+
const r = this.#$(t, b, y, p);
|
|
2406
2406
|
const o = r.__staleWhileFetching !== undefined;
|
|
2407
2407
|
const h = o && s;
|
|
2408
|
-
if (
|
|
2409
|
-
|
|
2410
|
-
if (h && n)
|
|
2408
|
+
if (m) {
|
|
2409
|
+
m.fetch = n ? "stale" : "refresh";
|
|
2410
|
+
if (h && n) m.returnedStale = true;
|
|
2411
2411
|
}
|
|
2412
2412
|
return h ? r.__staleWhileFetching : r.__returned = r;
|
|
2413
2413
|
}
|
|
@@ -2458,7 +2458,7 @@ class LRUCache {
|
|
|
2458
2458
|
if (h) {
|
|
2459
2459
|
return e.__staleWhileFetching;
|
|
2460
2460
|
}
|
|
2461
|
-
this.#
|
|
2461
|
+
this.#U(o);
|
|
2462
2462
|
if (i) {
|
|
2463
2463
|
this.#Y(o);
|
|
2464
2464
|
}
|
|
@@ -2472,7 +2472,7 @@ class LRUCache {
|
|
|
2472
2472
|
this.#M[e] = t;
|
|
2473
2473
|
this.#L[t] = e;
|
|
2474
2474
|
}
|
|
2475
|
-
#
|
|
2475
|
+
#U(t) {
|
|
2476
2476
|
if (t !== this.#F) {
|
|
2477
2477
|
if (t === this.#P) {
|
|
2478
2478
|
this.#P = this.#L[t];
|
|
@@ -2499,11 +2499,11 @@ class LRUCache {
|
|
|
2499
2499
|
const s = this.#A[i];
|
|
2500
2500
|
if (this.#j(s)) {
|
|
2501
2501
|
s.__abortController.abort(new Error("deleted"));
|
|
2502
|
-
} else if (this.#
|
|
2503
|
-
if (this.#
|
|
2504
|
-
this.#
|
|
2502
|
+
} else if (this.#B || this.#I) {
|
|
2503
|
+
if (this.#B) {
|
|
2504
|
+
this.#y?.(s, t, e);
|
|
2505
2505
|
}
|
|
2506
|
-
if (this.#
|
|
2506
|
+
if (this.#I) {
|
|
2507
2507
|
this.#O?.push([ s, t, e ]);
|
|
2508
2508
|
}
|
|
2509
2509
|
}
|
|
@@ -2525,7 +2525,7 @@ class LRUCache {
|
|
|
2525
2525
|
}
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
if (this.#
|
|
2528
|
+
if (this.#I && this.#O?.length) {
|
|
2529
2529
|
const t = this.#O;
|
|
2530
2530
|
let e;
|
|
2531
2531
|
while (e = t?.shift()) {
|
|
@@ -2546,10 +2546,10 @@ class LRUCache {
|
|
|
2546
2546
|
s.__abortController.abort(new Error("deleted"));
|
|
2547
2547
|
} else {
|
|
2548
2548
|
const i = this.#T[e];
|
|
2549
|
-
if (this.#
|
|
2550
|
-
this.#
|
|
2549
|
+
if (this.#B) {
|
|
2550
|
+
this.#y?.(s, i, t);
|
|
2551
2551
|
}
|
|
2552
|
-
if (this.#
|
|
2552
|
+
if (this.#I) {
|
|
2553
2553
|
this.#O?.push([ s, i, t ]);
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
@@ -2557,8 +2557,8 @@ class LRUCache {
|
|
|
2557
2557
|
this.#C.clear();
|
|
2558
2558
|
this.#A.fill(undefined);
|
|
2559
2559
|
this.#T.fill(undefined);
|
|
2560
|
-
if (this.#
|
|
2561
|
-
this.#
|
|
2560
|
+
if (this.#N && this.#D) {
|
|
2561
|
+
this.#N.fill(0);
|
|
2562
2562
|
this.#D.fill(0);
|
|
2563
2563
|
}
|
|
2564
2564
|
if (this.#z) {
|
|
@@ -2569,7 +2569,7 @@ class LRUCache {
|
|
|
2569
2569
|
this.#R.length = 0;
|
|
2570
2570
|
this.#E = 0;
|
|
2571
2571
|
this.#v = 0;
|
|
2572
|
-
if (this.#
|
|
2572
|
+
if (this.#I && this.#O) {
|
|
2573
2573
|
const t = this.#O;
|
|
2574
2574
|
let e;
|
|
2575
2575
|
while (e = t?.shift()) {
|
|
@@ -2579,88 +2579,88 @@ class LRUCache {
|
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
2581
2581
|
|
|
2582
|
-
const
|
|
2582
|
+
const ie = typeof process === "object" && process ? process : {
|
|
2583
2583
|
stdout: null,
|
|
2584
2584
|
stderr: null
|
|
2585
2585
|
};
|
|
2586
2586
|
|
|
2587
|
-
const
|
|
2587
|
+
const ne = t => !!t && typeof t === "object" && (t instanceof Minipass || t instanceof p || re(t) || oe(t));
|
|
2588
2588
|
|
|
2589
|
-
const
|
|
2589
|
+
const re = t => !!t && typeof t === "object" && t instanceof d && typeof t.pipe === "function" && t.pipe !== p.Writable.prototype.pipe;
|
|
2590
2590
|
|
|
2591
|
-
const
|
|
2591
|
+
const oe = t => !!t && typeof t === "object" && t instanceof d && typeof t.write === "function" && typeof t.end === "function";
|
|
2592
2592
|
|
|
2593
|
-
const
|
|
2593
|
+
const he = Symbol("EOF");
|
|
2594
2594
|
|
|
2595
|
-
const
|
|
2595
|
+
const ae = Symbol("maybeEmitEnd");
|
|
2596
2596
|
|
|
2597
|
-
const
|
|
2597
|
+
const le = Symbol("emittedEnd");
|
|
2598
2598
|
|
|
2599
|
-
const
|
|
2599
|
+
const ce = Symbol("emittingEnd");
|
|
2600
2600
|
|
|
2601
|
-
const
|
|
2601
|
+
const fe = Symbol("emittedError");
|
|
2602
2602
|
|
|
2603
|
-
const
|
|
2603
|
+
const ue = Symbol("closed");
|
|
2604
2604
|
|
|
2605
|
-
const
|
|
2605
|
+
const de = Symbol("read");
|
|
2606
2606
|
|
|
2607
|
-
const
|
|
2607
|
+
const pe = Symbol("flush");
|
|
2608
2608
|
|
|
2609
|
-
const
|
|
2609
|
+
const ge = Symbol("flushChunk");
|
|
2610
2610
|
|
|
2611
|
-
const
|
|
2611
|
+
const me = Symbol("encoding");
|
|
2612
2612
|
|
|
2613
|
-
const
|
|
2613
|
+
const we = Symbol("decoder");
|
|
2614
2614
|
|
|
2615
|
-
const
|
|
2615
|
+
const ye = Symbol("flowing");
|
|
2616
2616
|
|
|
2617
|
-
const
|
|
2617
|
+
const be = Symbol("paused");
|
|
2618
2618
|
|
|
2619
|
-
const
|
|
2619
|
+
const Se = Symbol("resume");
|
|
2620
2620
|
|
|
2621
|
-
const
|
|
2621
|
+
const ke = Symbol("buffer");
|
|
2622
2622
|
|
|
2623
|
-
const
|
|
2623
|
+
const xe = Symbol("pipes");
|
|
2624
2624
|
|
|
2625
|
-
const
|
|
2625
|
+
const ve = Symbol("bufferLength");
|
|
2626
2626
|
|
|
2627
|
-
const
|
|
2627
|
+
const Ee = Symbol("bufferPush");
|
|
2628
2628
|
|
|
2629
|
-
const
|
|
2629
|
+
const Ce = Symbol("bufferShift");
|
|
2630
2630
|
|
|
2631
|
-
const
|
|
2631
|
+
const Te = Symbol("objectMode");
|
|
2632
2632
|
|
|
2633
|
-
const
|
|
2633
|
+
const Ae = Symbol("destroyed");
|
|
2634
2634
|
|
|
2635
|
-
const
|
|
2635
|
+
const Le = Symbol("error");
|
|
2636
2636
|
|
|
2637
|
-
const
|
|
2637
|
+
const Me = Symbol("emitData");
|
|
2638
2638
|
|
|
2639
|
-
const
|
|
2639
|
+
const Pe = Symbol("emitEnd");
|
|
2640
2640
|
|
|
2641
|
-
const
|
|
2641
|
+
const Fe = Symbol("emitEnd2");
|
|
2642
2642
|
|
|
2643
|
-
const
|
|
2643
|
+
const Re = Symbol("async");
|
|
2644
2644
|
|
|
2645
|
-
const
|
|
2645
|
+
const Oe = Symbol("abort");
|
|
2646
2646
|
|
|
2647
|
-
const
|
|
2647
|
+
const ze = Symbol("aborted");
|
|
2648
2648
|
|
|
2649
|
-
const
|
|
2649
|
+
const De = Symbol("signal");
|
|
2650
2650
|
|
|
2651
|
-
const
|
|
2651
|
+
const Ne = Symbol("dataListeners");
|
|
2652
2652
|
|
|
2653
|
-
const
|
|
2653
|
+
const Be = Symbol("discarded");
|
|
2654
2654
|
|
|
2655
|
-
const
|
|
2655
|
+
const We = t => Promise.resolve().then(t);
|
|
2656
2656
|
|
|
2657
|
-
const
|
|
2657
|
+
const Ie = t => t();
|
|
2658
2658
|
|
|
2659
|
-
const
|
|
2659
|
+
const _e = t => t === "end" || t === "finish" || t === "prefinish";
|
|
2660
2660
|
|
|
2661
|
-
const
|
|
2661
|
+
const je = t => t instanceof ArrayBuffer || !!t && typeof t === "object" && t.constructor && t.constructor.name === "ArrayBuffer" && t.byteLength >= 0;
|
|
2662
2662
|
|
|
2663
|
-
const
|
|
2663
|
+
const $e = t => !Buffer.isBuffer(t) && ArrayBuffer.isView(t);
|
|
2664
2664
|
|
|
2665
2665
|
class Pipe {
|
|
2666
2666
|
src;
|
|
@@ -2671,7 +2671,7 @@ class Pipe {
|
|
|
2671
2671
|
this.src = t;
|
|
2672
2672
|
this.dest = e;
|
|
2673
2673
|
this.opts = s;
|
|
2674
|
-
this.ondrain = () => t[
|
|
2674
|
+
this.ondrain = () => t[Se]();
|
|
2675
2675
|
this.dest.on("drain", this.ondrain);
|
|
2676
2676
|
}
|
|
2677
2677
|
unpipe() {
|
|
@@ -2696,30 +2696,30 @@ class PipeProxyErrors extends Pipe {
|
|
|
2696
2696
|
}
|
|
2697
2697
|
}
|
|
2698
2698
|
|
|
2699
|
-
const
|
|
2699
|
+
const Ue = t => !!t.objectMode;
|
|
2700
2700
|
|
|
2701
|
-
const
|
|
2701
|
+
const Ge = t => !t.objectMode && !!t.encoding && t.encoding !== "buffer";
|
|
2702
2702
|
|
|
2703
2703
|
class Minipass extends d {
|
|
2704
|
-
[
|
|
2705
|
-
[
|
|
2706
|
-
[
|
|
2707
|
-
[
|
|
2708
|
-
[
|
|
2709
|
-
[
|
|
2710
|
-
[
|
|
2711
|
-
[
|
|
2712
|
-
[
|
|
2713
|
-
[
|
|
2714
|
-
[
|
|
2715
|
-
[
|
|
2716
|
-
[
|
|
2717
|
-
[
|
|
2718
|
-
[
|
|
2719
|
-
[
|
|
2720
|
-
[
|
|
2721
|
-
[
|
|
2722
|
-
[
|
|
2704
|
+
[ye]=false;
|
|
2705
|
+
[be]=false;
|
|
2706
|
+
[xe]=[];
|
|
2707
|
+
[ke]=[];
|
|
2708
|
+
[Te];
|
|
2709
|
+
[me];
|
|
2710
|
+
[Re];
|
|
2711
|
+
[we];
|
|
2712
|
+
[he]=false;
|
|
2713
|
+
[le]=false;
|
|
2714
|
+
[ce]=false;
|
|
2715
|
+
[ue]=false;
|
|
2716
|
+
[fe]=null;
|
|
2717
|
+
[ve]=0;
|
|
2718
|
+
[Ae]=false;
|
|
2719
|
+
[De];
|
|
2720
|
+
[ze]=false;
|
|
2721
|
+
[Ne]=0;
|
|
2722
|
+
[Be]=false;
|
|
2723
2723
|
writable=true;
|
|
2724
2724
|
readable=true;
|
|
2725
2725
|
constructor(...t) {
|
|
@@ -2728,43 +2728,43 @@ class Minipass extends d {
|
|
|
2728
2728
|
if (e.objectMode && typeof e.encoding === "string") {
|
|
2729
2729
|
throw new TypeError("Encoding and objectMode may not be used together");
|
|
2730
2730
|
}
|
|
2731
|
-
if (
|
|
2732
|
-
this[
|
|
2733
|
-
this[
|
|
2734
|
-
} else if (
|
|
2735
|
-
this[
|
|
2736
|
-
this[
|
|
2731
|
+
if (Ue(e)) {
|
|
2732
|
+
this[Te] = true;
|
|
2733
|
+
this[me] = null;
|
|
2734
|
+
} else if (Ge(e)) {
|
|
2735
|
+
this[me] = e.encoding;
|
|
2736
|
+
this[Te] = false;
|
|
2737
2737
|
} else {
|
|
2738
|
-
this[
|
|
2739
|
-
this[
|
|
2738
|
+
this[Te] = false;
|
|
2739
|
+
this[me] = null;
|
|
2740
2740
|
}
|
|
2741
|
-
this[
|
|
2742
|
-
this[
|
|
2741
|
+
this[Re] = !!e.async;
|
|
2742
|
+
this[we] = this[me] ? new g(this[me]) : null;
|
|
2743
2743
|
if (e && e.debugExposeBuffer === true) {
|
|
2744
2744
|
Object.defineProperty(this, "buffer", {
|
|
2745
|
-
get: () => this[
|
|
2745
|
+
get: () => this[ke]
|
|
2746
2746
|
});
|
|
2747
2747
|
}
|
|
2748
2748
|
if (e && e.debugExposePipes === true) {
|
|
2749
2749
|
Object.defineProperty(this, "pipes", {
|
|
2750
|
-
get: () => this[
|
|
2750
|
+
get: () => this[xe]
|
|
2751
2751
|
});
|
|
2752
2752
|
}
|
|
2753
2753
|
const {signal: s} = e;
|
|
2754
2754
|
if (s) {
|
|
2755
|
-
this[
|
|
2755
|
+
this[De] = s;
|
|
2756
2756
|
if (s.aborted) {
|
|
2757
|
-
this[
|
|
2757
|
+
this[Oe]();
|
|
2758
2758
|
} else {
|
|
2759
|
-
s.addEventListener("abort", (() => this[
|
|
2759
|
+
s.addEventListener("abort", (() => this[Oe]()));
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
2763
|
get bufferLength() {
|
|
2764
|
-
return this[
|
|
2764
|
+
return this[ve];
|
|
2765
2765
|
}
|
|
2766
2766
|
get encoding() {
|
|
2767
|
-
return this[
|
|
2767
|
+
return this[me];
|
|
2768
2768
|
}
|
|
2769
2769
|
set encoding(t) {
|
|
2770
2770
|
throw new Error("Encoding must be set at instantiation time");
|
|
@@ -2773,30 +2773,30 @@ class Minipass extends d {
|
|
|
2773
2773
|
throw new Error("Encoding must be set at instantiation time");
|
|
2774
2774
|
}
|
|
2775
2775
|
get objectMode() {
|
|
2776
|
-
return this[
|
|
2776
|
+
return this[Te];
|
|
2777
2777
|
}
|
|
2778
2778
|
set objectMode(t) {
|
|
2779
2779
|
throw new Error("objectMode must be set at instantiation time");
|
|
2780
2780
|
}
|
|
2781
2781
|
get ["async"]() {
|
|
2782
|
-
return this[
|
|
2782
|
+
return this[Re];
|
|
2783
2783
|
}
|
|
2784
2784
|
set ["async"](t) {
|
|
2785
|
-
this[
|
|
2785
|
+
this[Re] = this[Re] || !!t;
|
|
2786
2786
|
}
|
|
2787
|
-
[
|
|
2788
|
-
this[
|
|
2789
|
-
this.emit("abort", this[
|
|
2790
|
-
this.destroy(this[
|
|
2787
|
+
[Oe]() {
|
|
2788
|
+
this[ze] = true;
|
|
2789
|
+
this.emit("abort", this[De]?.reason);
|
|
2790
|
+
this.destroy(this[De]?.reason);
|
|
2791
2791
|
}
|
|
2792
2792
|
get aborted() {
|
|
2793
|
-
return this[
|
|
2793
|
+
return this[ze];
|
|
2794
2794
|
}
|
|
2795
2795
|
set aborted(t) {}
|
|
2796
2796
|
write(t, e, s) {
|
|
2797
|
-
if (this[
|
|
2798
|
-
if (this[
|
|
2799
|
-
if (this[
|
|
2797
|
+
if (this[ze]) return false;
|
|
2798
|
+
if (this[he]) throw new Error("write after end");
|
|
2799
|
+
if (this[Ae]) {
|
|
2800
2800
|
this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), {
|
|
2801
2801
|
code: "ERR_STREAM_DESTROYED"
|
|
2802
2802
|
}));
|
|
@@ -2807,70 +2807,70 @@ class Minipass extends d {
|
|
|
2807
2807
|
e = "utf8";
|
|
2808
2808
|
}
|
|
2809
2809
|
if (!e) e = "utf8";
|
|
2810
|
-
const i = this[
|
|
2811
|
-
if (!this[
|
|
2812
|
-
if (
|
|
2810
|
+
const i = this[Re] ? We : Ie;
|
|
2811
|
+
if (!this[Te] && !Buffer.isBuffer(t)) {
|
|
2812
|
+
if ($e(t)) {
|
|
2813
2813
|
t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2814
|
-
} else if (
|
|
2814
|
+
} else if (je(t)) {
|
|
2815
2815
|
t = Buffer.from(t);
|
|
2816
2816
|
} else if (typeof t !== "string") {
|
|
2817
2817
|
throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
|
-
if (this[
|
|
2821
|
-
if (this[
|
|
2822
|
-
if (this[
|
|
2823
|
-
if (this[
|
|
2820
|
+
if (this[Te]) {
|
|
2821
|
+
if (this[ye] && this[ve] !== 0) this[pe](true);
|
|
2822
|
+
if (this[ye]) this.emit("data", t); else this[Ee](t);
|
|
2823
|
+
if (this[ve] !== 0) this.emit("readable");
|
|
2824
2824
|
if (s) i(s);
|
|
2825
|
-
return this[
|
|
2825
|
+
return this[ye];
|
|
2826
2826
|
}
|
|
2827
2827
|
if (!t.length) {
|
|
2828
|
-
if (this[
|
|
2828
|
+
if (this[ve] !== 0) this.emit("readable");
|
|
2829
2829
|
if (s) i(s);
|
|
2830
|
-
return this[
|
|
2830
|
+
return this[ye];
|
|
2831
2831
|
}
|
|
2832
|
-
if (typeof t === "string" && !(e === this[
|
|
2832
|
+
if (typeof t === "string" && !(e === this[me] && !this[we]?.lastNeed)) {
|
|
2833
2833
|
t = Buffer.from(t, e);
|
|
2834
2834
|
}
|
|
2835
|
-
if (Buffer.isBuffer(t) && this[
|
|
2836
|
-
t = this[
|
|
2835
|
+
if (Buffer.isBuffer(t) && this[me]) {
|
|
2836
|
+
t = this[we].write(t);
|
|
2837
2837
|
}
|
|
2838
|
-
if (this[
|
|
2839
|
-
if (this[
|
|
2840
|
-
if (this[
|
|
2838
|
+
if (this[ye] && this[ve] !== 0) this[pe](true);
|
|
2839
|
+
if (this[ye]) this.emit("data", t); else this[Ee](t);
|
|
2840
|
+
if (this[ve] !== 0) this.emit("readable");
|
|
2841
2841
|
if (s) i(s);
|
|
2842
|
-
return this[
|
|
2842
|
+
return this[ye];
|
|
2843
2843
|
}
|
|
2844
2844
|
read(t) {
|
|
2845
|
-
if (this[
|
|
2846
|
-
this[
|
|
2847
|
-
if (this[
|
|
2848
|
-
this[
|
|
2845
|
+
if (this[Ae]) return null;
|
|
2846
|
+
this[Be] = false;
|
|
2847
|
+
if (this[ve] === 0 || t === 0 || t && t > this[ve]) {
|
|
2848
|
+
this[ae]();
|
|
2849
2849
|
return null;
|
|
2850
2850
|
}
|
|
2851
|
-
if (this[
|
|
2852
|
-
if (this[
|
|
2853
|
-
this[
|
|
2851
|
+
if (this[Te]) t = null;
|
|
2852
|
+
if (this[ke].length > 1 && !this[Te]) {
|
|
2853
|
+
this[ke] = [ this[me] ? this[ke].join("") : Buffer.concat(this[ke], this[ve]) ];
|
|
2854
2854
|
}
|
|
2855
|
-
const e = this[
|
|
2856
|
-
this[
|
|
2855
|
+
const e = this[de](t || null, this[ke][0]);
|
|
2856
|
+
this[ae]();
|
|
2857
2857
|
return e;
|
|
2858
2858
|
}
|
|
2859
|
-
[
|
|
2860
|
-
if (this[
|
|
2859
|
+
[de](t, e) {
|
|
2860
|
+
if (this[Te]) this[Ce](); else {
|
|
2861
2861
|
const s = e;
|
|
2862
|
-
if (t === s.length || t === null) this[
|
|
2863
|
-
this[
|
|
2862
|
+
if (t === s.length || t === null) this[Ce](); else if (typeof s === "string") {
|
|
2863
|
+
this[ke][0] = s.slice(t);
|
|
2864
2864
|
e = s.slice(0, t);
|
|
2865
|
-
this[
|
|
2865
|
+
this[ve] -= t;
|
|
2866
2866
|
} else {
|
|
2867
|
-
this[
|
|
2867
|
+
this[ke][0] = s.subarray(t);
|
|
2868
2868
|
e = s.subarray(0, t);
|
|
2869
|
-
this[
|
|
2869
|
+
this[ve] -= t;
|
|
2870
2870
|
}
|
|
2871
2871
|
}
|
|
2872
2872
|
this.emit("data", e);
|
|
2873
|
-
if (!this[
|
|
2873
|
+
if (!this[ke].length && !this[he]) this.emit("drain");
|
|
2874
2874
|
return e;
|
|
2875
2875
|
}
|
|
2876
2876
|
end(t, e, s) {
|
|
@@ -2884,78 +2884,78 @@ class Minipass extends d {
|
|
|
2884
2884
|
}
|
|
2885
2885
|
if (t !== undefined) this.write(t, e);
|
|
2886
2886
|
if (s) this.once("end", s);
|
|
2887
|
-
this[
|
|
2887
|
+
this[he] = true;
|
|
2888
2888
|
this.writable = false;
|
|
2889
|
-
if (this[
|
|
2889
|
+
if (this[ye] || !this[be]) this[ae]();
|
|
2890
2890
|
return this;
|
|
2891
2891
|
}
|
|
2892
|
-
[
|
|
2893
|
-
if (this[
|
|
2894
|
-
if (!this[
|
|
2895
|
-
this[
|
|
2892
|
+
[Se]() {
|
|
2893
|
+
if (this[Ae]) return;
|
|
2894
|
+
if (!this[Ne] && !this[xe].length) {
|
|
2895
|
+
this[Be] = true;
|
|
2896
2896
|
}
|
|
2897
|
-
this[
|
|
2898
|
-
this[
|
|
2897
|
+
this[be] = false;
|
|
2898
|
+
this[ye] = true;
|
|
2899
2899
|
this.emit("resume");
|
|
2900
|
-
if (this[
|
|
2900
|
+
if (this[ke].length) this[pe](); else if (this[he]) this[ae](); else this.emit("drain");
|
|
2901
2901
|
}
|
|
2902
2902
|
resume() {
|
|
2903
|
-
return this[
|
|
2903
|
+
return this[Se]();
|
|
2904
2904
|
}
|
|
2905
2905
|
pause() {
|
|
2906
|
-
this[
|
|
2907
|
-
this[
|
|
2908
|
-
this[
|
|
2906
|
+
this[ye] = false;
|
|
2907
|
+
this[be] = true;
|
|
2908
|
+
this[Be] = false;
|
|
2909
2909
|
}
|
|
2910
2910
|
get destroyed() {
|
|
2911
|
-
return this[
|
|
2911
|
+
return this[Ae];
|
|
2912
2912
|
}
|
|
2913
2913
|
get flowing() {
|
|
2914
|
-
return this[
|
|
2914
|
+
return this[ye];
|
|
2915
2915
|
}
|
|
2916
2916
|
get paused() {
|
|
2917
|
-
return this[
|
|
2917
|
+
return this[be];
|
|
2918
2918
|
}
|
|
2919
|
-
[
|
|
2920
|
-
if (this[
|
|
2921
|
-
this[
|
|
2919
|
+
[Ee](t) {
|
|
2920
|
+
if (this[Te]) this[ve] += 1; else this[ve] += t.length;
|
|
2921
|
+
this[ke].push(t);
|
|
2922
2922
|
}
|
|
2923
|
-
[
|
|
2924
|
-
if (this[
|
|
2925
|
-
return this[
|
|
2923
|
+
[Ce]() {
|
|
2924
|
+
if (this[Te]) this[ve] -= 1; else this[ve] -= this[ke][0].length;
|
|
2925
|
+
return this[ke].shift();
|
|
2926
2926
|
}
|
|
2927
|
-
[
|
|
2928
|
-
do {} while (this[
|
|
2929
|
-
if (!t && !this[
|
|
2927
|
+
[pe](t = false) {
|
|
2928
|
+
do {} while (this[ge](this[Ce]()) && this[ke].length);
|
|
2929
|
+
if (!t && !this[ke].length && !this[he]) this.emit("drain");
|
|
2930
2930
|
}
|
|
2931
|
-
[
|
|
2931
|
+
[ge](t) {
|
|
2932
2932
|
this.emit("data", t);
|
|
2933
|
-
return this[
|
|
2933
|
+
return this[ye];
|
|
2934
2934
|
}
|
|
2935
2935
|
pipe(t, e) {
|
|
2936
|
-
if (this[
|
|
2937
|
-
this[
|
|
2938
|
-
const s = this[
|
|
2936
|
+
if (this[Ae]) return t;
|
|
2937
|
+
this[Be] = false;
|
|
2938
|
+
const s = this[le];
|
|
2939
2939
|
e = e || {};
|
|
2940
|
-
if (t ===
|
|
2940
|
+
if (t === ie.stdout || t === ie.stderr) e.end = false; else e.end = e.end !== false;
|
|
2941
2941
|
e.proxyErrors = !!e.proxyErrors;
|
|
2942
2942
|
if (s) {
|
|
2943
2943
|
if (e.end) t.end();
|
|
2944
2944
|
} else {
|
|
2945
|
-
this[
|
|
2946
|
-
if (this[
|
|
2945
|
+
this[xe].push(!e.proxyErrors ? new Pipe(this, t, e) : new PipeProxyErrors(this, t, e));
|
|
2946
|
+
if (this[Re]) We((() => this[Se]())); else this[Se]();
|
|
2947
2947
|
}
|
|
2948
2948
|
return t;
|
|
2949
2949
|
}
|
|
2950
2950
|
unpipe(t) {
|
|
2951
|
-
const e = this[
|
|
2951
|
+
const e = this[xe].find((e => e.dest === t));
|
|
2952
2952
|
if (e) {
|
|
2953
|
-
if (this[
|
|
2954
|
-
if (this[
|
|
2955
|
-
this[
|
|
2953
|
+
if (this[xe].length === 1) {
|
|
2954
|
+
if (this[ye] && this[Ne] === 0) {
|
|
2955
|
+
this[ye] = false;
|
|
2956
2956
|
}
|
|
2957
|
-
this[
|
|
2958
|
-
} else this[
|
|
2957
|
+
this[xe] = [];
|
|
2958
|
+
} else this[xe].splice(this[xe].indexOf(e), 1);
|
|
2959
2959
|
e.unpipe();
|
|
2960
2960
|
}
|
|
2961
2961
|
}
|
|
@@ -2965,19 +2965,19 @@ class Minipass extends d {
|
|
|
2965
2965
|
on(t, e) {
|
|
2966
2966
|
const s = super.on(t, e);
|
|
2967
2967
|
if (t === "data") {
|
|
2968
|
-
this[
|
|
2969
|
-
this[
|
|
2970
|
-
if (!this[
|
|
2971
|
-
this[
|
|
2968
|
+
this[Be] = false;
|
|
2969
|
+
this[Ne]++;
|
|
2970
|
+
if (!this[xe].length && !this[ye]) {
|
|
2971
|
+
this[Se]();
|
|
2972
2972
|
}
|
|
2973
|
-
} else if (t === "readable" && this[
|
|
2973
|
+
} else if (t === "readable" && this[ve] !== 0) {
|
|
2974
2974
|
super.emit("readable");
|
|
2975
|
-
} else if (
|
|
2975
|
+
} else if (_e(t) && this[le]) {
|
|
2976
2976
|
super.emit(t);
|
|
2977
2977
|
this.removeAllListeners(t);
|
|
2978
|
-
} else if (t === "error" && this[
|
|
2978
|
+
} else if (t === "error" && this[fe]) {
|
|
2979
2979
|
const t = e;
|
|
2980
|
-
if (this[
|
|
2980
|
+
if (this[Re]) We((() => t.call(this, this[fe]))); else t.call(this, this[fe]);
|
|
2981
2981
|
}
|
|
2982
2982
|
return s;
|
|
2983
2983
|
}
|
|
@@ -2987,9 +2987,9 @@ class Minipass extends d {
|
|
|
2987
2987
|
off(t, e) {
|
|
2988
2988
|
const s = super.off(t, e);
|
|
2989
2989
|
if (t === "data") {
|
|
2990
|
-
this[
|
|
2991
|
-
if (this[
|
|
2992
|
-
this[
|
|
2990
|
+
this[Ne] = this.listeners("data").length;
|
|
2991
|
+
if (this[Ne] === 0 && !this[Be] && !this[xe].length) {
|
|
2992
|
+
this[ye] = false;
|
|
2993
2993
|
}
|
|
2994
2994
|
}
|
|
2995
2995
|
return s;
|
|
@@ -2997,49 +2997,49 @@ class Minipass extends d {
|
|
|
2997
2997
|
removeAllListeners(t) {
|
|
2998
2998
|
const e = super.removeAllListeners(t);
|
|
2999
2999
|
if (t === "data" || t === undefined) {
|
|
3000
|
-
this[
|
|
3001
|
-
if (!this[
|
|
3002
|
-
this[
|
|
3000
|
+
this[Ne] = 0;
|
|
3001
|
+
if (!this[Be] && !this[xe].length) {
|
|
3002
|
+
this[ye] = false;
|
|
3003
3003
|
}
|
|
3004
3004
|
}
|
|
3005
3005
|
return e;
|
|
3006
3006
|
}
|
|
3007
3007
|
get emittedEnd() {
|
|
3008
|
-
return this[
|
|
3008
|
+
return this[le];
|
|
3009
3009
|
}
|
|
3010
|
-
[
|
|
3011
|
-
if (!this[
|
|
3012
|
-
this[
|
|
3010
|
+
[ae]() {
|
|
3011
|
+
if (!this[ce] && !this[le] && !this[Ae] && this[ke].length === 0 && this[he]) {
|
|
3012
|
+
this[ce] = true;
|
|
3013
3013
|
this.emit("end");
|
|
3014
3014
|
this.emit("prefinish");
|
|
3015
3015
|
this.emit("finish");
|
|
3016
|
-
if (this[
|
|
3017
|
-
this[
|
|
3016
|
+
if (this[ue]) this.emit("close");
|
|
3017
|
+
this[ce] = false;
|
|
3018
3018
|
}
|
|
3019
3019
|
}
|
|
3020
3020
|
emit(t, ...e) {
|
|
3021
3021
|
const s = e[0];
|
|
3022
|
-
if (t !== "error" && t !== "close" && t !==
|
|
3022
|
+
if (t !== "error" && t !== "close" && t !== Ae && this[Ae]) {
|
|
3023
3023
|
return false;
|
|
3024
3024
|
} else if (t === "data") {
|
|
3025
|
-
return !this[
|
|
3025
|
+
return !this[Te] && !s ? false : this[Re] ? (We((() => this[Me](s))), true) : this[Me](s);
|
|
3026
3026
|
} else if (t === "end") {
|
|
3027
|
-
return this[
|
|
3027
|
+
return this[Pe]();
|
|
3028
3028
|
} else if (t === "close") {
|
|
3029
|
-
this[
|
|
3030
|
-
if (!this[
|
|
3029
|
+
this[ue] = true;
|
|
3030
|
+
if (!this[le] && !this[Ae]) return false;
|
|
3031
3031
|
const t = super.emit("close");
|
|
3032
3032
|
this.removeAllListeners("close");
|
|
3033
3033
|
return t;
|
|
3034
3034
|
} else if (t === "error") {
|
|
3035
|
-
this[
|
|
3036
|
-
super.emit(
|
|
3037
|
-
const t = !this[
|
|
3038
|
-
this[
|
|
3035
|
+
this[fe] = s;
|
|
3036
|
+
super.emit(Le, s);
|
|
3037
|
+
const t = !this[De] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
3038
|
+
this[ae]();
|
|
3039
3039
|
return t;
|
|
3040
3040
|
} else if (t === "resume") {
|
|
3041
3041
|
const t = super.emit("resume");
|
|
3042
|
-
this[
|
|
3042
|
+
this[ae]();
|
|
3043
3043
|
return t;
|
|
3044
3044
|
} else if (t === "finish" || t === "prefinish") {
|
|
3045
3045
|
const e = super.emit(t);
|
|
@@ -3047,34 +3047,34 @@ class Minipass extends d {
|
|
|
3047
3047
|
return e;
|
|
3048
3048
|
}
|
|
3049
3049
|
const i = super.emit(t, ...e);
|
|
3050
|
-
this[
|
|
3050
|
+
this[ae]();
|
|
3051
3051
|
return i;
|
|
3052
3052
|
}
|
|
3053
|
-
[
|
|
3054
|
-
for (const e of this[
|
|
3053
|
+
[Me](t) {
|
|
3054
|
+
for (const e of this[xe]) {
|
|
3055
3055
|
if (e.dest.write(t) === false) this.pause();
|
|
3056
3056
|
}
|
|
3057
|
-
const e = this[
|
|
3058
|
-
this[
|
|
3057
|
+
const e = this[Be] ? false : super.emit("data", t);
|
|
3058
|
+
this[ae]();
|
|
3059
3059
|
return e;
|
|
3060
3060
|
}
|
|
3061
|
-
[
|
|
3062
|
-
if (this[
|
|
3063
|
-
this[
|
|
3061
|
+
[Pe]() {
|
|
3062
|
+
if (this[le]) return false;
|
|
3063
|
+
this[le] = true;
|
|
3064
3064
|
this.readable = false;
|
|
3065
|
-
return this[
|
|
3065
|
+
return this[Re] ? (We((() => this[Fe]())), true) : this[Fe]();
|
|
3066
3066
|
}
|
|
3067
|
-
[
|
|
3068
|
-
if (this[
|
|
3069
|
-
const t = this[
|
|
3067
|
+
[Fe]() {
|
|
3068
|
+
if (this[we]) {
|
|
3069
|
+
const t = this[we].end();
|
|
3070
3070
|
if (t) {
|
|
3071
|
-
for (const e of this[
|
|
3071
|
+
for (const e of this[xe]) {
|
|
3072
3072
|
e.dest.write(t);
|
|
3073
3073
|
}
|
|
3074
|
-
if (!this[
|
|
3074
|
+
if (!this[Be]) super.emit("data", t);
|
|
3075
3075
|
}
|
|
3076
3076
|
}
|
|
3077
|
-
for (const t of this[
|
|
3077
|
+
for (const t of this[xe]) {
|
|
3078
3078
|
t.end();
|
|
3079
3079
|
}
|
|
3080
3080
|
const t = super.emit("end");
|
|
@@ -3085,33 +3085,33 @@ class Minipass extends d {
|
|
|
3085
3085
|
const t = Object.assign([], {
|
|
3086
3086
|
dataLength: 0
|
|
3087
3087
|
});
|
|
3088
|
-
if (!this[
|
|
3088
|
+
if (!this[Te]) t.dataLength = 0;
|
|
3089
3089
|
const e = this.promise();
|
|
3090
3090
|
this.on("data", (e => {
|
|
3091
3091
|
t.push(e);
|
|
3092
|
-
if (!this[
|
|
3092
|
+
if (!this[Te]) t.dataLength += e.length;
|
|
3093
3093
|
}));
|
|
3094
3094
|
await e;
|
|
3095
3095
|
return t;
|
|
3096
3096
|
}
|
|
3097
3097
|
async concat() {
|
|
3098
|
-
if (this[
|
|
3098
|
+
if (this[Te]) {
|
|
3099
3099
|
throw new Error("cannot concat in objectMode");
|
|
3100
3100
|
}
|
|
3101
3101
|
const t = await this.collect();
|
|
3102
|
-
return this[
|
|
3102
|
+
return this[me] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
3103
3103
|
}
|
|
3104
3104
|
async promise() {
|
|
3105
3105
|
return new Promise(((t, e) => {
|
|
3106
|
-
this.on(
|
|
3106
|
+
this.on(Ae, (() => e(new Error("stream destroyed"))));
|
|
3107
3107
|
this.on("error", (t => e(t)));
|
|
3108
3108
|
this.on("end", (() => t()));
|
|
3109
3109
|
}));
|
|
3110
3110
|
}
|
|
3111
3111
|
[Symbol.asyncIterator]() {
|
|
3112
|
-
this[
|
|
3112
|
+
this[Be] = false;
|
|
3113
3113
|
let t = false;
|
|
3114
|
-
const
|
|
3114
|
+
const e = async () => {
|
|
3115
3115
|
this.pause();
|
|
3116
3116
|
t = true;
|
|
3117
3117
|
return {
|
|
@@ -3119,123 +3119,123 @@ class Minipass extends d {
|
|
|
3119
3119
|
done: true
|
|
3120
3120
|
};
|
|
3121
3121
|
};
|
|
3122
|
-
const
|
|
3123
|
-
if (t) return
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3122
|
+
const s = () => {
|
|
3123
|
+
if (t) return e();
|
|
3124
|
+
const s = this.read();
|
|
3125
|
+
if (s !== null) return Promise.resolve({
|
|
3126
3126
|
done: false,
|
|
3127
|
-
value:
|
|
3127
|
+
value: s
|
|
3128
3128
|
});
|
|
3129
|
-
if (this[
|
|
3130
|
-
let s;
|
|
3129
|
+
if (this[he]) return e();
|
|
3131
3130
|
let i;
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
this.off("
|
|
3135
|
-
this.off(
|
|
3136
|
-
|
|
3137
|
-
|
|
3131
|
+
let n;
|
|
3132
|
+
const r = t => {
|
|
3133
|
+
this.off("data", o);
|
|
3134
|
+
this.off("end", h);
|
|
3135
|
+
this.off(Ae, a);
|
|
3136
|
+
e();
|
|
3137
|
+
n(t);
|
|
3138
3138
|
};
|
|
3139
|
-
const
|
|
3140
|
-
this.off("error",
|
|
3141
|
-
this.off("end",
|
|
3142
|
-
this.off(
|
|
3139
|
+
const o = t => {
|
|
3140
|
+
this.off("error", r);
|
|
3141
|
+
this.off("end", h);
|
|
3142
|
+
this.off(Ae, a);
|
|
3143
3143
|
this.pause();
|
|
3144
|
-
|
|
3144
|
+
i({
|
|
3145
3145
|
value: t,
|
|
3146
|
-
done: !!this[
|
|
3146
|
+
done: !!this[he]
|
|
3147
3147
|
});
|
|
3148
3148
|
};
|
|
3149
|
-
const
|
|
3150
|
-
this.off("error",
|
|
3151
|
-
this.off("data",
|
|
3152
|
-
this.off(
|
|
3153
|
-
|
|
3154
|
-
|
|
3149
|
+
const h = () => {
|
|
3150
|
+
this.off("error", r);
|
|
3151
|
+
this.off("data", o);
|
|
3152
|
+
this.off(Ae, a);
|
|
3153
|
+
e();
|
|
3154
|
+
i({
|
|
3155
3155
|
done: true,
|
|
3156
3156
|
value: undefined
|
|
3157
3157
|
});
|
|
3158
3158
|
};
|
|
3159
|
-
const
|
|
3159
|
+
const a = () => r(new Error("stream destroyed"));
|
|
3160
3160
|
return new Promise(((t, e) => {
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
this.once(
|
|
3164
|
-
this.once("error",
|
|
3165
|
-
this.once("end",
|
|
3166
|
-
this.once("data",
|
|
3161
|
+
n = e;
|
|
3162
|
+
i = t;
|
|
3163
|
+
this.once(Ae, a);
|
|
3164
|
+
this.once("error", r);
|
|
3165
|
+
this.once("end", h);
|
|
3166
|
+
this.once("data", o);
|
|
3167
3167
|
}));
|
|
3168
3168
|
};
|
|
3169
3169
|
return {
|
|
3170
|
-
next,
|
|
3171
|
-
throw:
|
|
3172
|
-
return:
|
|
3170
|
+
next: s,
|
|
3171
|
+
throw: e,
|
|
3172
|
+
return: e,
|
|
3173
3173
|
[Symbol.asyncIterator]() {
|
|
3174
3174
|
return this;
|
|
3175
3175
|
}
|
|
3176
3176
|
};
|
|
3177
3177
|
}
|
|
3178
3178
|
[Symbol.iterator]() {
|
|
3179
|
-
this[
|
|
3179
|
+
this[Be] = false;
|
|
3180
3180
|
let t = false;
|
|
3181
|
-
const
|
|
3181
|
+
const e = () => {
|
|
3182
3182
|
this.pause();
|
|
3183
|
-
this.off(
|
|
3184
|
-
this.off(
|
|
3185
|
-
this.off("end",
|
|
3183
|
+
this.off(Le, e);
|
|
3184
|
+
this.off(Ae, e);
|
|
3185
|
+
this.off("end", e);
|
|
3186
3186
|
t = true;
|
|
3187
3187
|
return {
|
|
3188
3188
|
done: true,
|
|
3189
3189
|
value: undefined
|
|
3190
3190
|
};
|
|
3191
3191
|
};
|
|
3192
|
-
const
|
|
3193
|
-
if (t) return
|
|
3194
|
-
const
|
|
3195
|
-
return
|
|
3192
|
+
const s = () => {
|
|
3193
|
+
if (t) return e();
|
|
3194
|
+
const s = this.read();
|
|
3195
|
+
return s === null ? e() : {
|
|
3196
3196
|
done: false,
|
|
3197
|
-
value:
|
|
3197
|
+
value: s
|
|
3198
3198
|
};
|
|
3199
3199
|
};
|
|
3200
|
-
this.once("end",
|
|
3201
|
-
this.once(
|
|
3202
|
-
this.once(
|
|
3200
|
+
this.once("end", e);
|
|
3201
|
+
this.once(Le, e);
|
|
3202
|
+
this.once(Ae, e);
|
|
3203
3203
|
return {
|
|
3204
|
-
next,
|
|
3205
|
-
throw:
|
|
3206
|
-
return:
|
|
3204
|
+
next: s,
|
|
3205
|
+
throw: e,
|
|
3206
|
+
return: e,
|
|
3207
3207
|
[Symbol.iterator]() {
|
|
3208
3208
|
return this;
|
|
3209
3209
|
}
|
|
3210
3210
|
};
|
|
3211
3211
|
}
|
|
3212
3212
|
destroy(t) {
|
|
3213
|
-
if (this[
|
|
3214
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3213
|
+
if (this[Ae]) {
|
|
3214
|
+
if (t) this.emit("error", t); else this.emit(Ae);
|
|
3215
3215
|
return this;
|
|
3216
3216
|
}
|
|
3217
|
-
this[
|
|
3218
|
-
this[
|
|
3219
|
-
this[
|
|
3220
|
-
this[
|
|
3217
|
+
this[Ae] = true;
|
|
3218
|
+
this[Be] = true;
|
|
3219
|
+
this[ke].length = 0;
|
|
3220
|
+
this[ve] = 0;
|
|
3221
3221
|
const e = this;
|
|
3222
|
-
if (typeof e.close === "function" && !this[
|
|
3223
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3222
|
+
if (typeof e.close === "function" && !this[ue]) e.close();
|
|
3223
|
+
if (t) this.emit("error", t); else this.emit(Ae);
|
|
3224
3224
|
return this;
|
|
3225
3225
|
}
|
|
3226
3226
|
static get isStream() {
|
|
3227
|
-
return
|
|
3227
|
+
return ne;
|
|
3228
3228
|
}
|
|
3229
3229
|
}
|
|
3230
3230
|
|
|
3231
|
-
const
|
|
3231
|
+
const He = i.native;
|
|
3232
3232
|
|
|
3233
|
-
const
|
|
3233
|
+
const Ze = {
|
|
3234
3234
|
lstatSync: h,
|
|
3235
3235
|
readdir: o,
|
|
3236
3236
|
readdirSync: r,
|
|
3237
3237
|
readlinkSync: n,
|
|
3238
|
-
realpathSync:
|
|
3238
|
+
realpathSync: He,
|
|
3239
3239
|
promises: {
|
|
3240
3240
|
lstat: u,
|
|
3241
3241
|
readdir: f,
|
|
@@ -3244,76 +3244,76 @@ const $t = {
|
|
|
3244
3244
|
}
|
|
3245
3245
|
};
|
|
3246
3246
|
|
|
3247
|
-
const
|
|
3248
|
-
|
|
3247
|
+
const qe = t => !t || t === Ze || t === a ? Ze : {
|
|
3248
|
+
...Ze,
|
|
3249
3249
|
...t,
|
|
3250
3250
|
promises: {
|
|
3251
|
-
|
|
3251
|
+
...Ze.promises,
|
|
3252
3252
|
...t.promises || {}
|
|
3253
3253
|
}
|
|
3254
3254
|
};
|
|
3255
3255
|
|
|
3256
|
-
const
|
|
3256
|
+
const Ve = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
3257
3257
|
|
|
3258
|
-
const
|
|
3258
|
+
const Je = t => t.replace(/\//g, "\\").replace(Ve, "$1\\");
|
|
3259
3259
|
|
|
3260
|
-
const
|
|
3260
|
+
const Ke = /[\\\/]/;
|
|
3261
3261
|
|
|
3262
|
-
const
|
|
3262
|
+
const Ye = 0;
|
|
3263
3263
|
|
|
3264
|
-
const
|
|
3264
|
+
const Xe = 1;
|
|
3265
3265
|
|
|
3266
|
-
const
|
|
3266
|
+
const Qe = 2;
|
|
3267
3267
|
|
|
3268
|
-
const
|
|
3268
|
+
const ts = 4;
|
|
3269
3269
|
|
|
3270
|
-
const
|
|
3270
|
+
const es = 6;
|
|
3271
3271
|
|
|
3272
|
-
const
|
|
3272
|
+
const ss = 8;
|
|
3273
3273
|
|
|
3274
|
-
const
|
|
3274
|
+
const is = 10;
|
|
3275
3275
|
|
|
3276
|
-
const
|
|
3276
|
+
const ns = 12;
|
|
3277
3277
|
|
|
3278
|
-
const
|
|
3278
|
+
const rs = 15;
|
|
3279
3279
|
|
|
3280
|
-
const
|
|
3280
|
+
const os = ~rs;
|
|
3281
3281
|
|
|
3282
|
-
const
|
|
3282
|
+
const hs = 16;
|
|
3283
3283
|
|
|
3284
|
-
const
|
|
3284
|
+
const as = 32;
|
|
3285
3285
|
|
|
3286
|
-
const
|
|
3286
|
+
const ls = 64;
|
|
3287
3287
|
|
|
3288
|
-
const
|
|
3288
|
+
const cs = 128;
|
|
3289
3289
|
|
|
3290
|
-
const
|
|
3290
|
+
const fs = 256;
|
|
3291
3291
|
|
|
3292
|
-
const
|
|
3292
|
+
const us = 512;
|
|
3293
3293
|
|
|
3294
|
-
const
|
|
3294
|
+
const ds = ls | cs | us;
|
|
3295
3295
|
|
|
3296
|
-
const
|
|
3296
|
+
const ps = 1023;
|
|
3297
3297
|
|
|
3298
|
-
const
|
|
3298
|
+
const gs = t => t.isFile() ? ss : t.isDirectory() ? ts : t.isSymbolicLink() ? is : t.isCharacterDevice() ? Qe : t.isBlockDevice() ? es : t.isSocket() ? ns : t.isFIFO() ? Xe : Ye;
|
|
3299
3299
|
|
|
3300
|
-
const
|
|
3300
|
+
const ms = new Map;
|
|
3301
3301
|
|
|
3302
|
-
const
|
|
3303
|
-
const e =
|
|
3302
|
+
const ws = t => {
|
|
3303
|
+
const e = ms.get(t);
|
|
3304
3304
|
if (e) return e;
|
|
3305
3305
|
const s = t.normalize("NFKD");
|
|
3306
|
-
|
|
3306
|
+
ms.set(t, s);
|
|
3307
3307
|
return s;
|
|
3308
3308
|
};
|
|
3309
3309
|
|
|
3310
|
-
const
|
|
3310
|
+
const ys = new Map;
|
|
3311
3311
|
|
|
3312
|
-
const
|
|
3313
|
-
const e =
|
|
3312
|
+
const bs = t => {
|
|
3313
|
+
const e = ys.get(t);
|
|
3314
3314
|
if (e) return e;
|
|
3315
|
-
const s =
|
|
3316
|
-
|
|
3315
|
+
const s = ws(t.toLowerCase());
|
|
3316
|
+
ys.set(t, s);
|
|
3317
3317
|
return s;
|
|
3318
3318
|
};
|
|
3319
3319
|
|
|
@@ -3334,7 +3334,7 @@ class ChildrenCache extends LRUCache {
|
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
3336
|
|
|
3337
|
-
const
|
|
3337
|
+
const Ss = Symbol("PathScurry setAsCwd");
|
|
3338
3338
|
|
|
3339
3339
|
class PathBase {
|
|
3340
3340
|
name;
|
|
@@ -3388,13 +3388,13 @@ class PathBase {
|
|
|
3388
3388
|
get atimeMs() {
|
|
3389
3389
|
return this.#mt;
|
|
3390
3390
|
}
|
|
3391
|
-
#
|
|
3391
|
+
#wt;
|
|
3392
3392
|
get mtimeMs() {
|
|
3393
|
-
return this.#
|
|
3393
|
+
return this.#wt;
|
|
3394
3394
|
}
|
|
3395
|
-
#
|
|
3395
|
+
#yt;
|
|
3396
3396
|
get ctimeMs() {
|
|
3397
|
-
return this.#
|
|
3397
|
+
return this.#yt;
|
|
3398
3398
|
}
|
|
3399
3399
|
#bt;
|
|
3400
3400
|
get birthtimeMs() {
|
|
@@ -3432,10 +3432,10 @@ class PathBase {
|
|
|
3432
3432
|
get path() {
|
|
3433
3433
|
return this.parentPath;
|
|
3434
3434
|
}
|
|
3435
|
-
constructor(t, e =
|
|
3435
|
+
constructor(t, e = Ye, s, i, n, r, o) {
|
|
3436
3436
|
this.name = t;
|
|
3437
|
-
this.#Et = n ?
|
|
3438
|
-
this.#Pt = e &
|
|
3437
|
+
this.#Et = n ? bs(t) : ws(t);
|
|
3438
|
+
this.#Pt = e & ps;
|
|
3439
3439
|
this.nocase = n;
|
|
3440
3440
|
this.roots = i;
|
|
3441
3441
|
this.root = s || this;
|
|
@@ -3447,7 +3447,7 @@ class PathBase {
|
|
|
3447
3447
|
if (this.parent) {
|
|
3448
3448
|
this.#ot = this.parent.#ot;
|
|
3449
3449
|
} else {
|
|
3450
|
-
this.#ot =
|
|
3450
|
+
this.#ot = qe(o.fs);
|
|
3451
3451
|
}
|
|
3452
3452
|
}
|
|
3453
3453
|
depth() {
|
|
@@ -3484,7 +3484,7 @@ class PathBase {
|
|
|
3484
3484
|
provisional: 0
|
|
3485
3485
|
});
|
|
3486
3486
|
this.#Ft.set(this, e);
|
|
3487
|
-
this.#Pt &= ~
|
|
3487
|
+
this.#Pt &= ~hs;
|
|
3488
3488
|
return e;
|
|
3489
3489
|
}
|
|
3490
3490
|
child(t, e) {
|
|
@@ -3495,7 +3495,7 @@ class PathBase {
|
|
|
3495
3495
|
return this.parent || this;
|
|
3496
3496
|
}
|
|
3497
3497
|
const s = this.children();
|
|
3498
|
-
const i = this.nocase ?
|
|
3498
|
+
const i = this.nocase ? bs(t) : ws(t);
|
|
3499
3499
|
for (const t of s) {
|
|
3500
3500
|
if (t.#Et === i) {
|
|
3501
3501
|
return t;
|
|
@@ -3503,13 +3503,13 @@ class PathBase {
|
|
|
3503
3503
|
}
|
|
3504
3504
|
const n = this.parent ? this.sep : "";
|
|
3505
3505
|
const r = this.#Tt ? this.#Tt + n + t : undefined;
|
|
3506
|
-
const o = this.newChild(t,
|
|
3506
|
+
const o = this.newChild(t, Ye, {
|
|
3507
3507
|
...e,
|
|
3508
3508
|
parent: this,
|
|
3509
3509
|
fullpath: r
|
|
3510
3510
|
});
|
|
3511
3511
|
if (!this.canReaddir()) {
|
|
3512
|
-
o.#Pt |=
|
|
3512
|
+
o.#Pt |= cs;
|
|
3513
3513
|
}
|
|
3514
3514
|
s.push(o);
|
|
3515
3515
|
return o;
|
|
@@ -3569,7 +3569,7 @@ class PathBase {
|
|
|
3569
3569
|
return this.#At = s;
|
|
3570
3570
|
}
|
|
3571
3571
|
isUnknown() {
|
|
3572
|
-
return (this.#Pt &
|
|
3572
|
+
return (this.#Pt & rs) === Ye;
|
|
3573
3573
|
}
|
|
3574
3574
|
isType(t) {
|
|
3575
3575
|
return this[`is${t}`]();
|
|
@@ -3578,28 +3578,28 @@ class PathBase {
|
|
|
3578
3578
|
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";
|
|
3579
3579
|
}
|
|
3580
3580
|
isFile() {
|
|
3581
|
-
return (this.#Pt &
|
|
3581
|
+
return (this.#Pt & rs) === ss;
|
|
3582
3582
|
}
|
|
3583
3583
|
isDirectory() {
|
|
3584
|
-
return (this.#Pt &
|
|
3584
|
+
return (this.#Pt & rs) === ts;
|
|
3585
3585
|
}
|
|
3586
3586
|
isCharacterDevice() {
|
|
3587
|
-
return (this.#Pt &
|
|
3587
|
+
return (this.#Pt & rs) === Qe;
|
|
3588
3588
|
}
|
|
3589
3589
|
isBlockDevice() {
|
|
3590
|
-
return (this.#Pt &
|
|
3590
|
+
return (this.#Pt & rs) === es;
|
|
3591
3591
|
}
|
|
3592
3592
|
isFIFO() {
|
|
3593
|
-
return (this.#Pt &
|
|
3593
|
+
return (this.#Pt & rs) === Xe;
|
|
3594
3594
|
}
|
|
3595
3595
|
isSocket() {
|
|
3596
|
-
return (this.#Pt &
|
|
3596
|
+
return (this.#Pt & rs) === ns;
|
|
3597
3597
|
}
|
|
3598
3598
|
isSymbolicLink() {
|
|
3599
|
-
return (this.#Pt &
|
|
3599
|
+
return (this.#Pt & is) === is;
|
|
3600
3600
|
}
|
|
3601
3601
|
lstatCached() {
|
|
3602
|
-
return this.#Pt &
|
|
3602
|
+
return this.#Pt & as ? this : undefined;
|
|
3603
3603
|
}
|
|
3604
3604
|
readlinkCached() {
|
|
3605
3605
|
return this.#Rt;
|
|
@@ -3614,17 +3614,17 @@ class PathBase {
|
|
|
3614
3614
|
canReadlink() {
|
|
3615
3615
|
if (this.#Rt) return true;
|
|
3616
3616
|
if (!this.parent) return false;
|
|
3617
|
-
const t = this.#Pt &
|
|
3618
|
-
return !(t !==
|
|
3617
|
+
const t = this.#Pt & rs;
|
|
3618
|
+
return !(t !== Ye && t !== is || this.#Pt & fs || this.#Pt & cs);
|
|
3619
3619
|
}
|
|
3620
3620
|
calledReaddir() {
|
|
3621
|
-
return !!(this.#Pt &
|
|
3621
|
+
return !!(this.#Pt & hs);
|
|
3622
3622
|
}
|
|
3623
3623
|
isENOENT() {
|
|
3624
|
-
return !!(this.#Pt &
|
|
3624
|
+
return !!(this.#Pt & cs);
|
|
3625
3625
|
}
|
|
3626
3626
|
isNamed(t) {
|
|
3627
|
-
return !this.nocase ? this.#Et ===
|
|
3627
|
+
return !this.nocase ? this.#Et === ws(t) : this.#Et === bs(t);
|
|
3628
3628
|
}
|
|
3629
3629
|
async readlink() {
|
|
3630
3630
|
const t = this.#Rt;
|
|
@@ -3670,41 +3670,41 @@ class PathBase {
|
|
|
3670
3670
|
return undefined;
|
|
3671
3671
|
}
|
|
3672
3672
|
}
|
|
3673
|
-
#
|
|
3674
|
-
this.#Pt |=
|
|
3673
|
+
#Nt(t) {
|
|
3674
|
+
this.#Pt |= hs;
|
|
3675
3675
|
for (let e = t.provisional; e < t.length; e++) {
|
|
3676
3676
|
const s = t[e];
|
|
3677
|
-
if (s) s.#
|
|
3677
|
+
if (s) s.#Bt();
|
|
3678
3678
|
}
|
|
3679
3679
|
}
|
|
3680
|
-
#
|
|
3681
|
-
if (this.#Pt &
|
|
3682
|
-
this.#Pt = (this.#Pt |
|
|
3683
|
-
this.#
|
|
3680
|
+
#Bt() {
|
|
3681
|
+
if (this.#Pt & cs) return;
|
|
3682
|
+
this.#Pt = (this.#Pt | cs) & os;
|
|
3683
|
+
this.#Wt();
|
|
3684
3684
|
}
|
|
3685
|
-
#
|
|
3685
|
+
#Wt() {
|
|
3686
3686
|
const t = this.children();
|
|
3687
3687
|
t.provisional = 0;
|
|
3688
3688
|
for (const e of t) {
|
|
3689
|
-
e.#
|
|
3689
|
+
e.#Bt();
|
|
3690
3690
|
}
|
|
3691
3691
|
}
|
|
3692
|
-
#
|
|
3693
|
-
this.#Pt |=
|
|
3692
|
+
#It() {
|
|
3693
|
+
this.#Pt |= us;
|
|
3694
3694
|
this.#_t();
|
|
3695
3695
|
}
|
|
3696
3696
|
#_t() {
|
|
3697
|
-
if (this.#Pt &
|
|
3697
|
+
if (this.#Pt & ls) return;
|
|
3698
3698
|
let t = this.#Pt;
|
|
3699
|
-
if ((t &
|
|
3700
|
-
this.#Pt = t |
|
|
3701
|
-
this.#
|
|
3699
|
+
if ((t & rs) === ts) t &= os;
|
|
3700
|
+
this.#Pt = t | ls;
|
|
3701
|
+
this.#Wt();
|
|
3702
3702
|
}
|
|
3703
3703
|
#jt(t = "") {
|
|
3704
3704
|
if (t === "ENOTDIR" || t === "EPERM") {
|
|
3705
3705
|
this.#_t();
|
|
3706
3706
|
} else if (t === "ENOENT") {
|
|
3707
|
-
this.#
|
|
3707
|
+
this.#Bt();
|
|
3708
3708
|
} else {
|
|
3709
3709
|
this.children().provisional = 0;
|
|
3710
3710
|
}
|
|
@@ -3714,41 +3714,41 @@ class PathBase {
|
|
|
3714
3714
|
const t = this.parent;
|
|
3715
3715
|
t.#_t();
|
|
3716
3716
|
} else if (t === "ENOENT") {
|
|
3717
|
-
this.#
|
|
3717
|
+
this.#Bt();
|
|
3718
3718
|
}
|
|
3719
3719
|
}
|
|
3720
3720
|
#Dt(t = "") {
|
|
3721
3721
|
let e = this.#Pt;
|
|
3722
|
-
e |=
|
|
3723
|
-
if (t === "ENOENT") e |=
|
|
3722
|
+
e |= fs;
|
|
3723
|
+
if (t === "ENOENT") e |= cs;
|
|
3724
3724
|
if (t === "EINVAL" || t === "UNKNOWN") {
|
|
3725
|
-
e &=
|
|
3725
|
+
e &= os;
|
|
3726
3726
|
}
|
|
3727
3727
|
this.#Pt = e;
|
|
3728
3728
|
if (t === "ENOTDIR" && this.parent) {
|
|
3729
3729
|
this.parent.#_t();
|
|
3730
3730
|
}
|
|
3731
3731
|
}
|
|
3732
|
-
#
|
|
3733
|
-
return this.#
|
|
3732
|
+
#Ut(t, e) {
|
|
3733
|
+
return this.#Gt(t, e) || this.#Ht(t, e);
|
|
3734
3734
|
}
|
|
3735
3735
|
#Ht(t, e) {
|
|
3736
|
-
const s =
|
|
3736
|
+
const s = gs(t);
|
|
3737
3737
|
const i = this.newChild(t.name, s, {
|
|
3738
3738
|
parent: this
|
|
3739
3739
|
});
|
|
3740
|
-
const n = i.#Pt &
|
|
3741
|
-
if (n !==
|
|
3742
|
-
i.#Pt |=
|
|
3740
|
+
const n = i.#Pt & rs;
|
|
3741
|
+
if (n !== ts && n !== is && n !== Ye) {
|
|
3742
|
+
i.#Pt |= ls;
|
|
3743
3743
|
}
|
|
3744
3744
|
e.unshift(i);
|
|
3745
3745
|
e.provisional++;
|
|
3746
3746
|
return i;
|
|
3747
3747
|
}
|
|
3748
|
-
#
|
|
3748
|
+
#Gt(t, e) {
|
|
3749
3749
|
for (let s = e.provisional; s < e.length; s++) {
|
|
3750
3750
|
const i = e[s];
|
|
3751
|
-
const n = this.nocase ?
|
|
3751
|
+
const n = this.nocase ? bs(t.name) : ws(t.name);
|
|
3752
3752
|
if (n !== i.#Et) {
|
|
3753
3753
|
continue;
|
|
3754
3754
|
}
|
|
@@ -3757,7 +3757,7 @@ class PathBase {
|
|
|
3757
3757
|
}
|
|
3758
3758
|
#Zt(t, e, s, i) {
|
|
3759
3759
|
const n = e.name;
|
|
3760
|
-
e.#Pt = e.#Pt &
|
|
3760
|
+
e.#Pt = e.#Pt & os | gs(t);
|
|
3761
3761
|
if (n !== t.name) e.name = t.name;
|
|
3762
3762
|
if (s !== i.provisional) {
|
|
3763
3763
|
if (s === i.length - 1) i.pop(); else i.splice(s, 1);
|
|
@@ -3767,7 +3767,7 @@ class PathBase {
|
|
|
3767
3767
|
return e;
|
|
3768
3768
|
}
|
|
3769
3769
|
async lstat() {
|
|
3770
|
-
if ((this.#Pt &
|
|
3770
|
+
if ((this.#Pt & cs) === 0) {
|
|
3771
3771
|
try {
|
|
3772
3772
|
this.#qt(await this.#ot.promises.lstat(this.fullpath()));
|
|
3773
3773
|
return this;
|
|
@@ -3777,7 +3777,7 @@ class PathBase {
|
|
|
3777
3777
|
}
|
|
3778
3778
|
}
|
|
3779
3779
|
lstatSync() {
|
|
3780
|
-
if ((this.#Pt &
|
|
3780
|
+
if ((this.#Pt & cs) === 0) {
|
|
3781
3781
|
try {
|
|
3782
3782
|
this.#qt(this.#ot.lstatSync(this.fullpath()));
|
|
3783
3783
|
return this;
|
|
@@ -3787,7 +3787,7 @@ class PathBase {
|
|
|
3787
3787
|
}
|
|
3788
3788
|
}
|
|
3789
3789
|
#qt(t) {
|
|
3790
|
-
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:
|
|
3790
|
+
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;
|
|
3791
3791
|
this.#St = e;
|
|
3792
3792
|
this.#mt = s;
|
|
3793
3793
|
this.#vt = i;
|
|
@@ -3795,21 +3795,21 @@ class PathBase {
|
|
|
3795
3795
|
this.#dt = r;
|
|
3796
3796
|
this.#gt = o;
|
|
3797
3797
|
this.#xt = h;
|
|
3798
|
-
this.#
|
|
3798
|
+
this.#yt = a;
|
|
3799
3799
|
this.#ht = l;
|
|
3800
3800
|
this.#ft = c;
|
|
3801
3801
|
this.#pt = f;
|
|
3802
3802
|
this.#at = u;
|
|
3803
3803
|
this.#kt = d;
|
|
3804
|
-
this.#
|
|
3804
|
+
this.#wt = p;
|
|
3805
3805
|
this.#lt = g;
|
|
3806
|
-
this.#ut =
|
|
3806
|
+
this.#ut = m;
|
|
3807
3807
|
this.#v = w;
|
|
3808
|
-
this.#ct =
|
|
3809
|
-
const
|
|
3810
|
-
this.#Pt = this.#Pt &
|
|
3811
|
-
if (
|
|
3812
|
-
this.#Pt |=
|
|
3808
|
+
this.#ct = y;
|
|
3809
|
+
const b = gs(t);
|
|
3810
|
+
this.#Pt = this.#Pt & os | b | as;
|
|
3811
|
+
if (b !== Ye && b !== ts && b !== is) {
|
|
3812
|
+
this.#Pt |= ls;
|
|
3813
3813
|
}
|
|
3814
3814
|
}
|
|
3815
3815
|
#Vt=[];
|
|
@@ -3845,9 +3845,9 @@ class PathBase {
|
|
|
3845
3845
|
s.provisional = 0;
|
|
3846
3846
|
} else {
|
|
3847
3847
|
for (const t of e) {
|
|
3848
|
-
this.#
|
|
3848
|
+
this.#Ut(t, s);
|
|
3849
3849
|
}
|
|
3850
|
-
this.#
|
|
3850
|
+
this.#Nt(s);
|
|
3851
3851
|
}
|
|
3852
3852
|
this.#Kt(s.slice(0, s.provisional));
|
|
3853
3853
|
return;
|
|
@@ -3866,21 +3866,21 @@ class PathBase {
|
|
|
3866
3866
|
if (this.#Yt) {
|
|
3867
3867
|
await this.#Yt;
|
|
3868
3868
|
} else {
|
|
3869
|
-
let
|
|
3870
|
-
this.#Yt = new Promise((t =>
|
|
3869
|
+
let s = () => {};
|
|
3870
|
+
this.#Yt = new Promise((t => s = t));
|
|
3871
3871
|
try {
|
|
3872
3872
|
for (const s of await this.#ot.promises.readdir(e, {
|
|
3873
3873
|
withFileTypes: true
|
|
3874
3874
|
})) {
|
|
3875
|
-
this.#
|
|
3875
|
+
this.#Ut(s, t);
|
|
3876
3876
|
}
|
|
3877
|
-
this.#
|
|
3877
|
+
this.#Nt(t);
|
|
3878
3878
|
} catch (e) {
|
|
3879
3879
|
this.#jt(e.code);
|
|
3880
3880
|
t.provisional = 0;
|
|
3881
3881
|
}
|
|
3882
3882
|
this.#Yt = undefined;
|
|
3883
|
-
|
|
3883
|
+
s();
|
|
3884
3884
|
}
|
|
3885
3885
|
return t.slice(0, t.provisional);
|
|
3886
3886
|
}
|
|
@@ -3897,9 +3897,9 @@ class PathBase {
|
|
|
3897
3897
|
for (const s of this.#ot.readdirSync(e, {
|
|
3898
3898
|
withFileTypes: true
|
|
3899
3899
|
})) {
|
|
3900
|
-
this.#
|
|
3900
|
+
this.#Ut(s, t);
|
|
3901
3901
|
}
|
|
3902
|
-
this.#
|
|
3902
|
+
this.#Nt(t);
|
|
3903
3903
|
} catch (e) {
|
|
3904
3904
|
this.#jt(e.code);
|
|
3905
3905
|
t.provisional = 0;
|
|
@@ -3907,37 +3907,37 @@ class PathBase {
|
|
|
3907
3907
|
return t.slice(0, t.provisional);
|
|
3908
3908
|
}
|
|
3909
3909
|
canReaddir() {
|
|
3910
|
-
if (this.#Pt &
|
|
3911
|
-
const t =
|
|
3912
|
-
if (!(t ===
|
|
3910
|
+
if (this.#Pt & ds) return false;
|
|
3911
|
+
const t = rs & this.#Pt;
|
|
3912
|
+
if (!(t === Ye || t === ts || t === is)) {
|
|
3913
3913
|
return false;
|
|
3914
3914
|
}
|
|
3915
3915
|
return true;
|
|
3916
3916
|
}
|
|
3917
3917
|
shouldWalk(t, e) {
|
|
3918
|
-
return (this.#Pt &
|
|
3918
|
+
return (this.#Pt & ts) === ts && !(this.#Pt & ds) && !t.has(this) && (!e || e(this));
|
|
3919
3919
|
}
|
|
3920
3920
|
async realpath() {
|
|
3921
3921
|
if (this.#Ot) return this.#Ot;
|
|
3922
|
-
if ((
|
|
3922
|
+
if ((us | fs | cs) & this.#Pt) return undefined;
|
|
3923
3923
|
try {
|
|
3924
3924
|
const t = await this.#ot.promises.realpath(this.fullpath());
|
|
3925
3925
|
return this.#Ot = this.resolve(t);
|
|
3926
3926
|
} catch (t) {
|
|
3927
|
-
this.#
|
|
3927
|
+
this.#It();
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
3930
3930
|
realpathSync() {
|
|
3931
3931
|
if (this.#Ot) return this.#Ot;
|
|
3932
|
-
if ((
|
|
3932
|
+
if ((us | fs | cs) & this.#Pt) return undefined;
|
|
3933
3933
|
try {
|
|
3934
3934
|
const t = this.#ot.realpathSync(this.fullpath());
|
|
3935
3935
|
return this.#Ot = this.resolve(t);
|
|
3936
3936
|
} catch (t) {
|
|
3937
|
-
this.#
|
|
3937
|
+
this.#It();
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
3940
|
-
[
|
|
3940
|
+
[Ss](t) {
|
|
3941
3941
|
if (t === this) return;
|
|
3942
3942
|
t.isCWD = false;
|
|
3943
3943
|
this.isCWD = true;
|
|
@@ -3962,18 +3962,18 @@ class PathBase {
|
|
|
3962
3962
|
|
|
3963
3963
|
class PathWin32 extends PathBase {
|
|
3964
3964
|
sep="\\";
|
|
3965
|
-
splitSep=
|
|
3966
|
-
constructor(t, e =
|
|
3965
|
+
splitSep=Ke;
|
|
3966
|
+
constructor(t, e = Ye, s, i, n, r, o) {
|
|
3967
3967
|
super(t, e, s, i, n, r, o);
|
|
3968
3968
|
}
|
|
3969
|
-
newChild(t, e =
|
|
3969
|
+
newChild(t, e = Ye, s = {}) {
|
|
3970
3970
|
return new PathWin32(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
3971
3971
|
}
|
|
3972
3972
|
getRootString(t) {
|
|
3973
3973
|
return e.parse(t).root;
|
|
3974
3974
|
}
|
|
3975
3975
|
getRoot(t) {
|
|
3976
|
-
t =
|
|
3976
|
+
t = Je(t.toUpperCase());
|
|
3977
3977
|
if (t === this.root.name) {
|
|
3978
3978
|
return this.root;
|
|
3979
3979
|
}
|
|
@@ -3985,7 +3985,7 @@ class PathWin32 extends PathBase {
|
|
|
3985
3985
|
return this.roots[t] = new PathScurryWin32(t, this).root;
|
|
3986
3986
|
}
|
|
3987
3987
|
sameRoot(t, e = this.root.name) {
|
|
3988
|
-
t = t.toUpperCase().replace(/\//g, "\\").replace(
|
|
3988
|
+
t = t.toUpperCase().replace(/\//g, "\\").replace(Ve, "$1\\");
|
|
3989
3989
|
return t === e;
|
|
3990
3990
|
}
|
|
3991
3991
|
}
|
|
@@ -3993,7 +3993,7 @@ class PathWin32 extends PathBase {
|
|
|
3993
3993
|
class PathPosix extends PathBase {
|
|
3994
3994
|
splitSep="/";
|
|
3995
3995
|
sep="/";
|
|
3996
|
-
constructor(t, e =
|
|
3996
|
+
constructor(t, e = Ye, s, i, n, r, o) {
|
|
3997
3997
|
super(t, e, s, i, n, r, o);
|
|
3998
3998
|
}
|
|
3999
3999
|
getRootString(t) {
|
|
@@ -4002,7 +4002,7 @@ class PathPosix extends PathBase {
|
|
|
4002
4002
|
getRoot(t) {
|
|
4003
4003
|
return this.root;
|
|
4004
4004
|
}
|
|
4005
|
-
newChild(t, e =
|
|
4005
|
+
newChild(t, e = Ye, s = {}) {
|
|
4006
4006
|
return new PathPosix(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
4007
4007
|
}
|
|
4008
4008
|
}
|
|
@@ -4017,8 +4017,8 @@ class PathScurryBase {
|
|
|
4017
4017
|
#Ft;
|
|
4018
4018
|
nocase;
|
|
4019
4019
|
#ot;
|
|
4020
|
-
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o =
|
|
4021
|
-
this.#ot =
|
|
4020
|
+
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o = Ze} = {}) {
|
|
4021
|
+
this.#ot = qe(o);
|
|
4022
4022
|
if (e instanceof URL || e.startsWith("file://")) {
|
|
4023
4023
|
e = t(e);
|
|
4024
4024
|
}
|
|
@@ -4231,38 +4231,38 @@ class PathScurryBase {
|
|
|
4231
4231
|
o.push(s ? t : t.fullpath());
|
|
4232
4232
|
}
|
|
4233
4233
|
const h = new Set;
|
|
4234
|
-
const
|
|
4234
|
+
const a = (t, e) => {
|
|
4235
4235
|
h.add(t);
|
|
4236
|
-
t.readdirCB(((t,
|
|
4236
|
+
t.readdirCB(((t, l) => {
|
|
4237
4237
|
if (t) {
|
|
4238
4238
|
return e(t);
|
|
4239
4239
|
}
|
|
4240
|
-
let
|
|
4241
|
-
if (!
|
|
4242
|
-
const
|
|
4243
|
-
if (--
|
|
4240
|
+
let c = l.length;
|
|
4241
|
+
if (!c) return e();
|
|
4242
|
+
const f = () => {
|
|
4243
|
+
if (--c === 0) {
|
|
4244
4244
|
e();
|
|
4245
4245
|
}
|
|
4246
4246
|
};
|
|
4247
|
-
for (const t of
|
|
4247
|
+
for (const t of l) {
|
|
4248
4248
|
if (!n || n(t)) {
|
|
4249
4249
|
o.push(s ? t : t.fullpath());
|
|
4250
4250
|
}
|
|
4251
4251
|
if (i && t.isSymbolicLink()) {
|
|
4252
|
-
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ?
|
|
4252
|
+
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ? a(t, f) : f()));
|
|
4253
4253
|
} else {
|
|
4254
4254
|
if (t.shouldWalk(h, r)) {
|
|
4255
|
-
|
|
4255
|
+
a(t, f);
|
|
4256
4256
|
} else {
|
|
4257
|
-
|
|
4257
|
+
f();
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
4260
4260
|
}
|
|
4261
4261
|
}), true);
|
|
4262
4262
|
};
|
|
4263
|
-
const
|
|
4263
|
+
const l = t;
|
|
4264
4264
|
return new Promise(((t, e) => {
|
|
4265
|
-
|
|
4265
|
+
a(l, (s => {
|
|
4266
4266
|
if (s) return e(s);
|
|
4267
4267
|
t(o);
|
|
4268
4268
|
}));
|
|
@@ -4360,7 +4360,7 @@ class PathScurryBase {
|
|
|
4360
4360
|
const h = new Set;
|
|
4361
4361
|
const a = [ t ];
|
|
4362
4362
|
let l = 0;
|
|
4363
|
-
const
|
|
4363
|
+
const c = () => {
|
|
4364
4364
|
let t = false;
|
|
4365
4365
|
while (!t) {
|
|
4366
4366
|
const e = a.shift();
|
|
@@ -4370,21 +4370,21 @@ class PathScurryBase {
|
|
|
4370
4370
|
}
|
|
4371
4371
|
l++;
|
|
4372
4372
|
h.add(e);
|
|
4373
|
-
const
|
|
4373
|
+
const f = (e, d, p = false) => {
|
|
4374
4374
|
if (e) return o.emit("error", e);
|
|
4375
|
-
if (i && !
|
|
4375
|
+
if (i && !p) {
|
|
4376
4376
|
const t = [];
|
|
4377
|
-
for (const e of
|
|
4377
|
+
for (const e of d) {
|
|
4378
4378
|
if (e.isSymbolicLink()) {
|
|
4379
4379
|
t.push(e.realpath().then((t => t?.isUnknown() ? t.lstat() : t)));
|
|
4380
4380
|
}
|
|
4381
4381
|
}
|
|
4382
4382
|
if (t.length) {
|
|
4383
|
-
Promise.all(t).then((() =>
|
|
4383
|
+
Promise.all(t).then((() => f(null, d, true)));
|
|
4384
4384
|
return;
|
|
4385
4385
|
}
|
|
4386
4386
|
}
|
|
4387
|
-
for (const e of
|
|
4387
|
+
for (const e of d) {
|
|
4388
4388
|
if (e && (!n || n(e))) {
|
|
4389
4389
|
if (!o.write(s ? e : e.fullpath())) {
|
|
4390
4390
|
t = true;
|
|
@@ -4392,24 +4392,24 @@ class PathScurryBase {
|
|
|
4392
4392
|
}
|
|
4393
4393
|
}
|
|
4394
4394
|
l--;
|
|
4395
|
-
for (const t of
|
|
4395
|
+
for (const t of d) {
|
|
4396
4396
|
const e = t.realpathCached() || t;
|
|
4397
4397
|
if (e.shouldWalk(h, r)) {
|
|
4398
4398
|
a.push(e);
|
|
4399
4399
|
}
|
|
4400
4400
|
}
|
|
4401
4401
|
if (t && !o.flowing) {
|
|
4402
|
-
o.once("drain",
|
|
4403
|
-
} else if (!
|
|
4404
|
-
|
|
4402
|
+
o.once("drain", c);
|
|
4403
|
+
} else if (!u) {
|
|
4404
|
+
c();
|
|
4405
4405
|
}
|
|
4406
4406
|
};
|
|
4407
|
-
let
|
|
4408
|
-
e.readdirCB(
|
|
4409
|
-
|
|
4407
|
+
let u = true;
|
|
4408
|
+
e.readdirCB(f, true);
|
|
4409
|
+
u = false;
|
|
4410
4410
|
}
|
|
4411
4411
|
};
|
|
4412
|
-
|
|
4412
|
+
c();
|
|
4413
4413
|
return o;
|
|
4414
4414
|
}
|
|
4415
4415
|
streamSync(t = this.cwd, e = {}) {
|
|
@@ -4429,7 +4429,7 @@ class PathScurryBase {
|
|
|
4429
4429
|
}
|
|
4430
4430
|
const a = [ t ];
|
|
4431
4431
|
let l = 0;
|
|
4432
|
-
const
|
|
4432
|
+
const c = () => {
|
|
4433
4433
|
let t = false;
|
|
4434
4434
|
while (!t) {
|
|
4435
4435
|
const e = a.shift();
|
|
@@ -4459,15 +4459,15 @@ class PathScurryBase {
|
|
|
4459
4459
|
}
|
|
4460
4460
|
}
|
|
4461
4461
|
}
|
|
4462
|
-
if (t && !o.flowing) o.once("drain",
|
|
4462
|
+
if (t && !o.flowing) o.once("drain", c);
|
|
4463
4463
|
};
|
|
4464
|
-
|
|
4464
|
+
c();
|
|
4465
4465
|
return o;
|
|
4466
4466
|
}
|
|
4467
4467
|
chdir(t = this.cwd) {
|
|
4468
4468
|
const e = this.cwd;
|
|
4469
4469
|
this.cwd = typeof t === "string" ? this.cwd.resolve(t) : t;
|
|
4470
|
-
this.cwd[
|
|
4470
|
+
this.cwd[Ss](e);
|
|
4471
4471
|
}
|
|
4472
4472
|
}
|
|
4473
4473
|
|
|
@@ -4488,7 +4488,7 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4488
4488
|
return e.parse(t).root.toUpperCase();
|
|
4489
4489
|
}
|
|
4490
4490
|
newRoot(t) {
|
|
4491
|
-
return new PathWin32(this.rootPath,
|
|
4491
|
+
return new PathWin32(this.rootPath, ts, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4492
4492
|
fs: t
|
|
4493
4493
|
});
|
|
4494
4494
|
}
|
|
@@ -4511,7 +4511,7 @@ class PathScurryPosix extends PathScurryBase {
|
|
|
4511
4511
|
return "/";
|
|
4512
4512
|
}
|
|
4513
4513
|
newRoot(t) {
|
|
4514
|
-
return new PathPosix(this.rootPath,
|
|
4514
|
+
return new PathPosix(this.rootPath, ts, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4515
4515
|
fs: t
|
|
4516
4516
|
});
|
|
4517
4517
|
}
|
|
@@ -4530,13 +4530,13 @@ class PathScurryDarwin extends PathScurryPosix {
|
|
|
4530
4530
|
}
|
|
4531
4531
|
}
|
|
4532
4532
|
|
|
4533
|
-
const
|
|
4533
|
+
const ks = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
4534
4534
|
|
|
4535
|
-
const
|
|
4535
|
+
const xs = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
4536
4536
|
|
|
4537
|
-
const
|
|
4537
|
+
const vs = t => t.length >= 1;
|
|
4538
4538
|
|
|
4539
|
-
const
|
|
4539
|
+
const Es = t => t.length >= 1;
|
|
4540
4540
|
|
|
4541
4541
|
class Pattern {
|
|
4542
4542
|
#te;
|
|
@@ -4551,10 +4551,10 @@ class Pattern {
|
|
|
4551
4551
|
#ae;
|
|
4552
4552
|
#le=true;
|
|
4553
4553
|
constructor(t, e, s, i) {
|
|
4554
|
-
if (!
|
|
4554
|
+
if (!vs(t)) {
|
|
4555
4555
|
throw new TypeError("empty pattern list");
|
|
4556
4556
|
}
|
|
4557
|
-
if (!
|
|
4557
|
+
if (!Es(e)) {
|
|
4558
4558
|
throw new TypeError("empty glob list");
|
|
4559
4559
|
}
|
|
4560
4560
|
if (e.length !== t.length) {
|
|
@@ -4603,7 +4603,7 @@ class Pattern {
|
|
|
4603
4603
|
return typeof this.#te[this.#se] === "string";
|
|
4604
4604
|
}
|
|
4605
4605
|
isGlobstar() {
|
|
4606
|
-
return this.#te[this.#se] ===
|
|
4606
|
+
return this.#te[this.#se] === zt;
|
|
4607
4607
|
}
|
|
4608
4608
|
isRegExp() {
|
|
4609
4609
|
return this.#te[this.#se] instanceof RegExp;
|
|
@@ -4649,7 +4649,7 @@ class Pattern {
|
|
|
4649
4649
|
}
|
|
4650
4650
|
}
|
|
4651
4651
|
|
|
4652
|
-
const
|
|
4652
|
+
const Cs = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
4653
4653
|
|
|
4654
4654
|
class Ignore {
|
|
4655
4655
|
relative;
|
|
@@ -4658,7 +4658,7 @@ class Ignore {
|
|
|
4658
4658
|
absoluteChildren;
|
|
4659
4659
|
platform;
|
|
4660
4660
|
mmopts;
|
|
4661
|
-
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r =
|
|
4661
|
+
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r = Cs}) {
|
|
4662
4662
|
this.relative = [];
|
|
4663
4663
|
this.absolute = [];
|
|
4664
4664
|
this.relativeChildren = [];
|
|
@@ -4834,7 +4834,7 @@ class Processor {
|
|
|
4834
4834
|
const e = n === ".." || n === "" || n === ".";
|
|
4835
4835
|
this.matches.add(t.resolve(n), i, e);
|
|
4836
4836
|
continue;
|
|
4837
|
-
} else if (n ===
|
|
4837
|
+
} else if (n === zt) {
|
|
4838
4838
|
if (!t.isSymbolicLink() || this.follow || e.checkFollowGlobstar()) {
|
|
4839
4839
|
this.subwalks.add(t, e);
|
|
4840
4840
|
}
|
|
@@ -4870,7 +4870,7 @@ class Processor {
|
|
|
4870
4870
|
const s = e.isAbsolute();
|
|
4871
4871
|
const n = e.pattern();
|
|
4872
4872
|
const r = e.rest();
|
|
4873
|
-
if (n ===
|
|
4873
|
+
if (n === zt) {
|
|
4874
4874
|
i.testGlobstar(t, e, r, s);
|
|
4875
4875
|
} else if (n instanceof RegExp) {
|
|
4876
4876
|
i.testRegExp(t, n, r, s);
|
|
@@ -4928,7 +4928,7 @@ class Processor {
|
|
|
4928
4928
|
}
|
|
4929
4929
|
}
|
|
4930
4930
|
|
|
4931
|
-
const
|
|
4931
|
+
const Ts = (t, e) => typeof t === "string" ? new Ignore([ t ], e) : Array.isArray(t) ? new Ignore(t, e) : t;
|
|
4932
4932
|
|
|
4933
4933
|
class GlobUtil {
|
|
4934
4934
|
path;
|
|
@@ -4950,7 +4950,7 @@ class GlobUtil {
|
|
|
4950
4950
|
this.#ue = !s.posix && s.platform === "win32" ? "\\" : "/";
|
|
4951
4951
|
this.includeChildMatches = s.includeChildMatches !== false;
|
|
4952
4952
|
if (s.ignore || !this.includeChildMatches) {
|
|
4953
|
-
this.#fe =
|
|
4953
|
+
this.#fe = Ts(s.ignore ?? [], s);
|
|
4954
4954
|
if (!this.includeChildMatches && typeof this.#fe.add !== "function") {
|
|
4955
4955
|
const t = "cannot ignore child matches, ignore lacks add() method.";
|
|
4956
4956
|
throw new Error(t);
|
|
@@ -5069,13 +5069,13 @@ class GlobUtil {
|
|
|
5069
5069
|
}
|
|
5070
5070
|
s.processPatterns(t, e);
|
|
5071
5071
|
let n = 1;
|
|
5072
|
-
const
|
|
5072
|
+
const r = () => {
|
|
5073
5073
|
if (--n === 0) i();
|
|
5074
5074
|
};
|
|
5075
5075
|
for (const [t, e, i] of s.matches.entries()) {
|
|
5076
5076
|
if (this.#de(t)) continue;
|
|
5077
5077
|
n++;
|
|
5078
|
-
this.match(t, e, i).then((() =>
|
|
5078
|
+
this.match(t, e, i).then((() => r()));
|
|
5079
5079
|
}
|
|
5080
5080
|
for (const t of s.subwalkTargets()) {
|
|
5081
5081
|
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
|
@@ -5083,28 +5083,28 @@ class GlobUtil {
|
|
|
5083
5083
|
}
|
|
5084
5084
|
n++;
|
|
5085
5085
|
const e = t.readdirCached();
|
|
5086
|
-
if (t.calledReaddir()) this.walkCB3(t, e, s,
|
|
5087
|
-
t.readdirCB(((e, i) => this.walkCB3(t, i, s,
|
|
5086
|
+
if (t.calledReaddir()) this.walkCB3(t, e, s, r); else {
|
|
5087
|
+
t.readdirCB(((e, i) => this.walkCB3(t, i, s, r)), true);
|
|
5088
5088
|
}
|
|
5089
5089
|
}
|
|
5090
|
-
|
|
5090
|
+
r();
|
|
5091
5091
|
}
|
|
5092
5092
|
walkCB3(t, e, s, i) {
|
|
5093
5093
|
s = s.filterEntries(t, e);
|
|
5094
5094
|
let n = 1;
|
|
5095
|
-
const
|
|
5095
|
+
const r = () => {
|
|
5096
5096
|
if (--n === 0) i();
|
|
5097
5097
|
};
|
|
5098
5098
|
for (const [t, e, i] of s.matches.entries()) {
|
|
5099
5099
|
if (this.#de(t)) continue;
|
|
5100
5100
|
n++;
|
|
5101
|
-
this.match(t, e, i).then((() =>
|
|
5101
|
+
this.match(t, e, i).then((() => r()));
|
|
5102
5102
|
}
|
|
5103
5103
|
for (const [t, e] of s.subwalks.entries()) {
|
|
5104
5104
|
n++;
|
|
5105
|
-
this.walkCB2(t, e, s.child(),
|
|
5105
|
+
this.walkCB2(t, e, s.child(), r);
|
|
5106
5106
|
}
|
|
5107
|
-
|
|
5107
|
+
r();
|
|
5108
5108
|
}
|
|
5109
5109
|
walkCBSync(t, e, s) {
|
|
5110
5110
|
if (this.signal?.aborted) s();
|
|
@@ -5119,7 +5119,7 @@ class GlobUtil {
|
|
|
5119
5119
|
}
|
|
5120
5120
|
s.processPatterns(t, e);
|
|
5121
5121
|
let n = 1;
|
|
5122
|
-
const
|
|
5122
|
+
const r = () => {
|
|
5123
5123
|
if (--n === 0) i();
|
|
5124
5124
|
};
|
|
5125
5125
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -5132,14 +5132,14 @@ class GlobUtil {
|
|
|
5132
5132
|
}
|
|
5133
5133
|
n++;
|
|
5134
5134
|
const e = t.readdirSync();
|
|
5135
|
-
this.walkCB3Sync(t, e, s,
|
|
5135
|
+
this.walkCB3Sync(t, e, s, r);
|
|
5136
5136
|
}
|
|
5137
|
-
|
|
5137
|
+
r();
|
|
5138
5138
|
}
|
|
5139
5139
|
walkCB3Sync(t, e, s, i) {
|
|
5140
5140
|
s = s.filterEntries(t, e);
|
|
5141
5141
|
let n = 1;
|
|
5142
|
-
const
|
|
5142
|
+
const r = () => {
|
|
5143
5143
|
if (--n === 0) i();
|
|
5144
5144
|
};
|
|
5145
5145
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -5148,9 +5148,9 @@ class GlobUtil {
|
|
|
5148
5148
|
}
|
|
5149
5149
|
for (const [t, e] of s.subwalks.entries()) {
|
|
5150
5150
|
n++;
|
|
5151
|
-
this.walkCB2Sync(t, e, s.child(),
|
|
5151
|
+
this.walkCB2Sync(t, e, s.child(), r);
|
|
5152
5152
|
}
|
|
5153
|
-
|
|
5153
|
+
r();
|
|
5154
5154
|
}
|
|
5155
5155
|
}
|
|
5156
5156
|
|
|
@@ -5225,9 +5225,9 @@ class GlobStream extends GlobUtil {
|
|
|
5225
5225
|
}
|
|
5226
5226
|
}
|
|
5227
5227
|
|
|
5228
|
-
const
|
|
5228
|
+
const As = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
5229
5229
|
|
|
5230
|
-
let
|
|
5230
|
+
let Ls = class Glob {
|
|
5231
5231
|
absolute;
|
|
5232
5232
|
cwd;
|
|
5233
5233
|
root;
|
|
@@ -5299,7 +5299,7 @@ let me = class Glob {
|
|
|
5299
5299
|
e = e.map((t => t.includes("/") ? t : `./**/${t}`));
|
|
5300
5300
|
}
|
|
5301
5301
|
this.pattern = e;
|
|
5302
|
-
this.platform = s.platform ||
|
|
5302
|
+
this.platform = s.platform || As;
|
|
5303
5303
|
this.opts = {
|
|
5304
5304
|
...s,
|
|
5305
5305
|
platform: this.platform
|
|
@@ -5310,7 +5310,7 @@ let me = class Glob {
|
|
|
5310
5310
|
throw new Error("nocase option contradicts provided scurry option");
|
|
5311
5311
|
}
|
|
5312
5312
|
} else {
|
|
5313
|
-
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix :
|
|
5313
|
+
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix : xs;
|
|
5314
5314
|
this.scurry = new t(this.cwd, {
|
|
5315
5315
|
nocase: s.nocase,
|
|
5316
5316
|
fs: s.fs
|
|
@@ -5395,7 +5395,7 @@ let me = class Glob {
|
|
|
5395
5395
|
}
|
|
5396
5396
|
};
|
|
5397
5397
|
|
|
5398
|
-
const
|
|
5398
|
+
const Ms = (t, e = {}) => {
|
|
5399
5399
|
if (!Array.isArray(t)) {
|
|
5400
5400
|
t = [ t ];
|
|
5401
5401
|
}
|
|
@@ -5405,69 +5405,69 @@ const hasMagic = (t, e = {}) => {
|
|
|
5405
5405
|
return false;
|
|
5406
5406
|
};
|
|
5407
5407
|
|
|
5408
|
-
function
|
|
5409
|
-
return new
|
|
5408
|
+
function Ps(t, e = {}) {
|
|
5409
|
+
return new Ls(t, e).streamSync();
|
|
5410
5410
|
}
|
|
5411
5411
|
|
|
5412
|
-
function
|
|
5413
|
-
return new
|
|
5412
|
+
function Fs(t, e = {}) {
|
|
5413
|
+
return new Ls(t, e).stream();
|
|
5414
5414
|
}
|
|
5415
5415
|
|
|
5416
|
-
function
|
|
5417
|
-
return new
|
|
5416
|
+
function Rs(t, e = {}) {
|
|
5417
|
+
return new Ls(t, e).walkSync();
|
|
5418
5418
|
}
|
|
5419
5419
|
|
|
5420
|
-
async function
|
|
5421
|
-
return new
|
|
5420
|
+
async function Os(t, e = {}) {
|
|
5421
|
+
return new Ls(t, e).walk();
|
|
5422
5422
|
}
|
|
5423
5423
|
|
|
5424
|
-
function
|
|
5425
|
-
return new
|
|
5424
|
+
function zs(t, e = {}) {
|
|
5425
|
+
return new Ls(t, e).iterateSync();
|
|
5426
5426
|
}
|
|
5427
5427
|
|
|
5428
|
-
function
|
|
5429
|
-
return new
|
|
5428
|
+
function Ds(t, e = {}) {
|
|
5429
|
+
return new Ls(t, e).iterate();
|
|
5430
5430
|
}
|
|
5431
5431
|
|
|
5432
|
-
const
|
|
5432
|
+
const Ns = Ps;
|
|
5433
5433
|
|
|
5434
|
-
const
|
|
5435
|
-
sync:
|
|
5434
|
+
const Bs = Object.assign(Fs, {
|
|
5435
|
+
sync: Ps
|
|
5436
5436
|
});
|
|
5437
5437
|
|
|
5438
|
-
const
|
|
5438
|
+
const Ws = zs;
|
|
5439
5439
|
|
|
5440
|
-
const
|
|
5441
|
-
sync:
|
|
5440
|
+
const Is = Object.assign(Ds, {
|
|
5441
|
+
sync: zs
|
|
5442
5442
|
});
|
|
5443
5443
|
|
|
5444
|
-
const
|
|
5445
|
-
stream:
|
|
5446
|
-
iterate:
|
|
5444
|
+
const _s = Object.assign(Rs, {
|
|
5445
|
+
stream: Ps,
|
|
5446
|
+
iterate: zs
|
|
5447
5447
|
});
|
|
5448
5448
|
|
|
5449
|
-
const
|
|
5450
|
-
glob:
|
|
5451
|
-
globSync,
|
|
5452
|
-
sync:
|
|
5453
|
-
globStream,
|
|
5454
|
-
stream:
|
|
5455
|
-
globStreamSync,
|
|
5456
|
-
streamSync:
|
|
5457
|
-
globIterate,
|
|
5458
|
-
iterate:
|
|
5459
|
-
globIterateSync,
|
|
5460
|
-
iterateSync:
|
|
5461
|
-
Glob:
|
|
5462
|
-
hasMagic,
|
|
5463
|
-
escape,
|
|
5464
|
-
unescape
|
|
5449
|
+
const js = Object.assign(Os, {
|
|
5450
|
+
glob: Os,
|
|
5451
|
+
globSync: Rs,
|
|
5452
|
+
sync: _s,
|
|
5453
|
+
globStream: Fs,
|
|
5454
|
+
stream: Bs,
|
|
5455
|
+
globStreamSync: Ps,
|
|
5456
|
+
streamSync: Ns,
|
|
5457
|
+
globIterate: Ds,
|
|
5458
|
+
iterate: Is,
|
|
5459
|
+
globIterateSync: zs,
|
|
5460
|
+
iterateSync: Ws,
|
|
5461
|
+
Glob: Ls,
|
|
5462
|
+
hasMagic: Ms,
|
|
5463
|
+
escape: lt,
|
|
5464
|
+
unescape: Y
|
|
5465
5465
|
});
|
|
5466
5466
|
|
|
5467
|
-
|
|
5467
|
+
js.glob = js;
|
|
5468
5468
|
|
|
5469
|
-
async function
|
|
5470
|
-
return e ? await
|
|
5469
|
+
async function $s(t, e) {
|
|
5470
|
+
return e ? await js(t, e) : await js(t);
|
|
5471
5471
|
}
|
|
5472
5472
|
|
|
5473
|
-
export { Glob };
|
|
5473
|
+
export { $s as Glob };
|