lakutata 2.0.80 → 2.0.82
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/cacher.cjs +8 -10
- package/com/cacher.d.ts +83 -14
- package/com/cacher.mjs +8 -10
- package/com/database.cjs +11 -11
- package/com/database.mjs +11 -11
- package/com/docker.cjs +17 -19
- package/com/docker.d.ts +3 -141
- package/com/docker.mjs +13 -15
- package/com/entrypoint.cjs +7 -5
- package/com/entrypoint.mjs +7 -5
- package/com/logger.cjs +7 -7
- package/com/logger.mjs +7 -7
- package/com/monitor.cjs +5 -3
- package/com/monitor.mjs +5 -3
- package/decorator/ctrl.cjs +3 -3
- package/decorator/ctrl.mjs +3 -3
- package/decorator/orm.cjs +98 -98
- package/decorator/orm.mjs +142 -56
- package/helper.cjs +9 -11
- package/helper.mjs +5 -7
- package/lakutata.cjs +23 -30
- package/lakutata.mjs +14 -18
- package/orm.cjs +1421 -884
- package/orm.mjs +1474 -724
- package/package.json +1 -1
- package/provider/database.cjs +11 -11
- package/provider/database.mjs +11 -11
- package/provider/passwordHash.cjs +4 -2
- package/provider/passwordHash.mjs +4 -2
- package/src/components/Database.cjs +13 -13
- package/src/components/Database.mjs +17 -17
- package/src/components/Logger.cjs +7 -7
- package/src/components/Logger.mjs +7 -7
- package/src/components/cacher/Cacher.cjs +1186 -272
- package/src/components/cacher/Cacher.mjs +1094 -180
- package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +478 -2962
- package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +468 -2946
- 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 +23 -25
- package/src/components/docker/ConnectionOptionsBuilder.mjs +19 -21
- package/src/components/docker/Docker.cjs +5035 -5096
- package/src/components/docker/Docker.mjs +4955 -5016
- package/src/components/docker/lib/DockerContainer.cjs +23 -25
- package/src/components/docker/lib/DockerContainer.mjs +17 -19
- package/src/components/docker/lib/DockerContainerTTY.cjs +9 -11
- package/src/components/docker/lib/DockerContainerTTY.mjs +9 -11
- package/src/components/docker/lib/DockerImage.cjs +4 -2
- package/src/components/docker/lib/DockerImage.mjs +4 -2
- 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 +2179 -1687
- package/src/components/entrypoint/Entrypoint.mjs +2182 -1690
- package/src/components/entrypoint/lib/AccessControl.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControl.mjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.cjs +4 -2
- package/src/components/entrypoint/lib/AccessControlRule.mjs +4 -2
- package/src/components/entrypoint/lib/Controller.cjs +4 -2
- package/src/components/entrypoint/lib/Controller.mjs +4 -2
- package/src/components/monitor/AliveMonitor.cjs +6 -4
- package/src/components/monitor/AliveMonitor.mjs +6 -4
- package/src/components/monitor/CpuMonitor.cjs +5 -3
- package/src/components/monitor/CpuMonitor.mjs +5 -3
- package/src/components/monitor/EventLoopMonitor.cjs +4 -2
- package/src/components/monitor/EventLoopMonitor.mjs +4 -2
- package/src/components/monitor/HttpRequestMonitor.cjs +5 -3
- package/src/components/monitor/HttpRequestMonitor.mjs +5 -3
- package/src/components/monitor/MemoryMonitor.cjs +8 -6
- package/src/components/monitor/MemoryMonitor.mjs +5 -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 +5 -5
- package/src/decorators/ctrl/CLIAction.mjs +10 -10
- package/src/decorators/ctrl/HTTPAction.cjs +9 -9
- package/src/decorators/ctrl/HTTPAction.mjs +7 -7
- package/src/decorators/ctrl/ServiceAction.cjs +6 -6
- package/src/decorators/ctrl/ServiceAction.mjs +7 -7
- package/src/decorators/ctrl/http/DELETE.cjs +5 -5
- package/src/decorators/ctrl/http/DELETE.mjs +5 -5
- package/src/decorators/ctrl/http/GET.cjs +5 -5
- package/src/decorators/ctrl/http/GET.mjs +5 -5
- package/src/decorators/ctrl/http/HEAD.cjs +5 -5
- package/src/decorators/ctrl/http/HEAD.mjs +5 -5
- package/src/decorators/ctrl/http/OPTIONS.cjs +5 -5
- package/src/decorators/ctrl/http/OPTIONS.mjs +5 -5
- package/src/decorators/ctrl/http/PATCH.cjs +5 -5
- package/src/decorators/ctrl/http/PATCH.mjs +5 -5
- package/src/decorators/ctrl/http/POST.cjs +5 -5
- package/src/decorators/ctrl/http/POST.mjs +5 -5
- package/src/decorators/ctrl/http/PUT.cjs +5 -5
- package/src/decorators/ctrl/http/PUT.mjs +5 -5
- 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 +17 -39
- package/src/decorators/orm/AfterInsert.mjs +18 -38
- package/src/decorators/orm/AfterLoad.cjs +17 -39
- package/src/decorators/orm/AfterLoad.mjs +18 -38
- package/src/decorators/orm/AfterRecover.cjs +17 -39
- package/src/decorators/orm/AfterRecover.mjs +18 -38
- package/src/decorators/orm/AfterRemove.cjs +17 -39
- package/src/decorators/orm/AfterRemove.mjs +18 -38
- package/src/decorators/orm/AfterSoftRemove.cjs +17 -39
- package/src/decorators/orm/AfterSoftRemove.mjs +18 -38
- package/src/decorators/orm/AfterUpdate.cjs +17 -39
- package/src/decorators/orm/AfterUpdate.mjs +18 -38
- package/src/decorators/orm/BeforeInsert.cjs +17 -39
- package/src/decorators/orm/BeforeInsert.mjs +18 -38
- package/src/decorators/orm/BeforeRecover.cjs +17 -39
- package/src/decorators/orm/BeforeRecover.mjs +18 -38
- package/src/decorators/orm/BeforeRemove.cjs +17 -39
- package/src/decorators/orm/BeforeRemove.mjs +18 -38
- package/src/decorators/orm/BeforeSoftRemove.cjs +17 -39
- package/src/decorators/orm/BeforeSoftRemove.mjs +18 -38
- package/src/decorators/orm/BeforeUpdate.cjs +17 -39
- package/src/decorators/orm/BeforeUpdate.mjs +18 -38
- package/src/decorators/orm/Check.cjs +17 -42
- package/src/decorators/orm/Check.mjs +18 -41
- package/src/decorators/orm/ChildEntity.cjs +17 -42
- package/src/decorators/orm/ChildEntity.mjs +18 -41
- package/src/decorators/orm/Column.cjs +17 -74
- package/src/decorators/orm/Column.mjs +19 -74
- package/src/decorators/orm/CreateDateColumn.cjs +17 -38
- package/src/decorators/orm/CreateDateColumn.mjs +18 -37
- package/src/decorators/orm/DeleteDateColumn.cjs +17 -38
- package/src/decorators/orm/DeleteDateColumn.mjs +17 -36
- package/src/decorators/orm/Entity.cjs +17 -48
- package/src/decorators/orm/Entity.mjs +17 -46
- package/src/decorators/orm/EventSubscriber.cjs +17 -35
- package/src/decorators/orm/EventSubscriber.mjs +18 -34
- package/src/decorators/orm/Exclusion.cjs +17 -42
- package/src/decorators/orm/Exclusion.mjs +18 -41
- package/src/decorators/orm/Generated.cjs +17 -37
- package/src/decorators/orm/Generated.mjs +18 -36
- package/src/decorators/orm/Index.cjs +17 -54
- package/src/decorators/orm/Index.mjs +19 -54
- package/src/decorators/orm/JoinColumn.cjs +17 -42
- package/src/decorators/orm/JoinColumn.mjs +18 -41
- package/src/decorators/orm/JoinTable.cjs +17 -43
- package/src/decorators/orm/JoinTable.mjs +17 -41
- package/src/decorators/orm/ManyToMany.cjs +17 -55
- package/src/decorators/orm/ManyToMany.mjs +17 -53
- package/src/decorators/orm/ManyToOne.cjs +17 -55
- package/src/decorators/orm/ManyToOne.mjs +17 -53
- package/src/decorators/orm/ObjectIdColumn.cjs +17 -41
- package/src/decorators/orm/ObjectIdColumn.mjs +18 -40
- package/src/decorators/orm/OneToMany.cjs +17 -47
- package/src/decorators/orm/OneToMany.mjs +19 -47
- package/src/decorators/orm/OneToOne.cjs +17 -55
- package/src/decorators/orm/OneToOne.mjs +17 -53
- package/src/decorators/orm/PrimaryColumn.cjs +17 -62
- package/src/decorators/orm/PrimaryColumn.mjs +19 -62
- package/src/decorators/orm/PrimaryGeneratedColumn.cjs +17 -67
- package/src/decorators/orm/PrimaryGeneratedColumn.mjs +19 -67
- package/src/decorators/orm/RelationId.cjs +17 -39
- package/src/decorators/orm/RelationId.mjs +18 -38
- package/src/decorators/orm/TableInheritance.cjs +17 -39
- package/src/decorators/orm/TableInheritance.mjs +18 -38
- package/src/decorators/orm/Tree.cjs +17 -37
- package/src/decorators/orm/Tree.mjs +18 -36
- package/src/decorators/orm/TreeChildren.cjs +17 -44
- package/src/decorators/orm/TreeChildren.mjs +17 -42
- package/src/decorators/orm/TreeLevelColumn.cjs +17 -38
- package/src/decorators/orm/TreeLevelColumn.mjs +17 -36
- package/src/decorators/orm/TreeParent.cjs +17 -44
- package/src/decorators/orm/TreeParent.mjs +17 -42
- package/src/decorators/orm/Unique.cjs +17 -57
- package/src/decorators/orm/Unique.mjs +19 -57
- package/src/decorators/orm/UpdateDateColumn.cjs +17 -38
- package/src/decorators/orm/UpdateDateColumn.mjs +18 -37
- package/src/decorators/orm/VersionColumn.cjs +17 -38
- package/src/decorators/orm/VersionColumn.mjs +18 -37
- package/src/decorators/orm/ViewColumn.cjs +17 -38
- package/src/decorators/orm/ViewColumn.mjs +18 -37
- package/src/decorators/orm/ViewEntity.cjs +17 -47
- package/src/decorators/orm/ViewEntity.mjs +18 -46
- package/src/decorators/orm/VirtualColumn.cjs +17 -55
- package/src/decorators/orm/VirtualColumn.mjs +17 -53
- package/src/lib/base/BaseObject.cjs +4 -2
- package/src/lib/base/BaseObject.mjs +4 -2
- package/src/lib/base/EventEmitter.cjs +1202 -1195
- package/src/lib/base/EventEmitter.mjs +1202 -1195
- 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/ApplicationConfigLoader.cjs +4 -2
- package/src/lib/base/internal/ApplicationConfigLoader.mjs +4 -2
- 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 +67 -67
- package/src/lib/base/internal/ControllerEntrypoint.mjs +38 -38
- package/src/lib/base/internal/DataValidator.cjs +176 -179
- package/src/lib/base/internal/DataValidator.mjs +221 -224
- 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/ModuleConfigLoader.cjs +4 -3
- package/src/lib/base/internal/ModuleConfigLoader.mjs +4 -3
- 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/ObjectType.cjs +4 -2
- package/src/lib/base/internal/ObjectType.mjs +4 -2
- 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 +744 -739
- package/src/lib/base/internal/PatternManager.mjs +748 -743
- 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 +146 -142
- package/src/lib/core/Application.mjs +204 -202
- package/src/lib/core/Component.cjs +4 -2
- package/src/lib/core/Component.mjs +4 -2
- package/src/lib/core/Container.cjs +4 -2
- package/src/lib/core/Container.mjs +4 -2
- package/src/lib/core/Module.cjs +5 -3
- package/src/lib/core/Module.mjs +5 -3
- package/src/lib/core/Provider.cjs +4 -2
- package/src/lib/core/Provider.mjs +4 -2
- 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 +1192 -943
- package/src/lib/helpers/Glob.mjs +1256 -1007
- 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 +18 -8
- package/src/lib/helpers/IsHtml.mjs +18 -8
- 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 +1525 -1531
- package/src/lib/helpers/IsXML.mjs +1521 -1527
- package/src/lib/helpers/MD5.cjs +3 -3
- package/src/lib/helpers/MD5.mjs +3 -3
- 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 +3 -3
- package/src/lib/helpers/NonceStr.mjs +3 -3
- package/src/lib/helpers/ObjectConstructor.cjs +2 -2
- package/src/lib/helpers/ObjectConstructor.mjs +4 -4
- package/src/lib/helpers/ObjectHash.cjs +385 -378
- package/src/lib/helpers/ObjectHash.mjs +381 -374
- 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 +170 -149
- package/src/lib/helpers/RandomString.mjs +167 -146
- package/src/lib/helpers/SHA1.cjs +3 -3
- package/src/lib/helpers/SHA1.mjs +3 -3
- package/src/lib/helpers/SHA256.cjs +3 -3
- package/src/lib/helpers/SHA256.mjs +3 -3
- 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 +17 -17
- package/src/lib/helpers/SortArray.mjs +16 -16
- 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/Statistics.cjs +1 -1
- package/src/lib/helpers/Statistics.mjs +1 -1
- 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/UUID.cjs +1 -1
- package/src/lib/helpers/UUID.mjs +1 -1
- 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 +111 -109
- package/src/lib/ioc/DependencyInjectionContainer.mjs +123 -121
- 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 +5222 -5297
- package/src/lib/ioc/ListModules.mjs +5187 -5262
- 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 +4198 -4020
- package/src/lib/validation/VLD.mjs +3137 -2959
- package/src/options/ApplicationOptions.cjs +4 -2
- package/src/options/ApplicationOptions.mjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.cjs +4 -2
- package/src/options/LoadAnonymousObjectOptions.mjs +4 -2
- package/src/options/LoadNamedObjectOptions.cjs +4 -2
- package/src/options/LoadNamedObjectOptions.mjs +4 -2
- package/src/options/LoadObjectOptions.cjs +4 -2
- package/src/options/LoadObjectOptions.mjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.cjs +4 -2
- package/src/options/ModuleLoadObjectsOptions.mjs +4 -2
- package/src/options/ModuleOptions.cjs +4 -4
- package/src/options/ModuleOptions.mjs +4 -4
- package/src/options/OverridableNamedObjectOptions.cjs +4 -2
- package/src/options/OverridableNamedObjectOptions.mjs +4 -2
- package/src/options/OverridableObjectOptions.cjs +4 -2
- package/src/options/OverridableObjectOptions.mjs +4 -2
- package/src/providers/Database.cjs +13 -13
- package/src/providers/Database.mjs +18 -18
- package/src/providers/PasswordHash.cjs +334 -332
- package/src/providers/PasswordHash.mjs +389 -387
- package/src/providers/migration/GenerateMigration.cjs +15 -19
- package/src/providers/migration/GenerateMigration.mjs +15 -19
- package/vendor/Package.1.cjs +256 -256
- package/vendor/Package.1.mjs +254 -254
- package/vendor/Package.10.cjs +2 -8
- package/vendor/Package.10.mjs +2 -8
- package/vendor/Package.11.cjs +5 -83
- package/vendor/Package.11.mjs +5 -77
- package/vendor/Package.112.cjs +48900 -0
- package/vendor/Package.112.mjs +48764 -0
- package/vendor/Package.12.cjs +4 -2
- package/vendor/Package.12.mjs +6 -4
- package/vendor/Package.13.cjs +87 -1
- package/vendor/Package.13.mjs +81 -1
- package/vendor/Package.14.cjs +1 -14057
- package/vendor/Package.14.mjs +1 -14031
- package/vendor/Package.15.cjs +1 -1
- package/vendor/Package.15.mjs +1 -1
- package/vendor/Package.16.cjs +18115 -1921
- package/vendor/Package.16.mjs +18115 -1839
- package/vendor/Package.17.cjs +1926 -47922
- package/vendor/Package.17.mjs +1852 -47915
- package/vendor/Package.18.cjs +35 -1
- package/vendor/Package.18.mjs +35 -1
- package/vendor/Package.19.cjs +37 -0
- package/vendor/Package.19.mjs +35 -0
- package/vendor/Package.2.cjs +5856 -5827
- package/vendor/Package.2.mjs +5854 -5825
- package/vendor/Package.20.cjs +37 -0
- package/vendor/Package.20.mjs +35 -0
- package/vendor/Package.21.cjs +37 -0
- package/vendor/Package.21.mjs +35 -0
- package/vendor/Package.22.cjs +37 -0
- package/vendor/Package.22.mjs +35 -0
- package/vendor/Package.23.cjs +37 -0
- package/vendor/Package.23.mjs +35 -0
- package/vendor/Package.24.cjs +37 -0
- package/vendor/Package.24.mjs +35 -0
- package/vendor/Package.25.cjs +37 -0
- package/vendor/Package.25.mjs +35 -0
- package/vendor/Package.26.cjs +37 -0
- package/vendor/Package.26.mjs +35 -0
- package/vendor/Package.27.cjs +37 -0
- package/vendor/Package.27.mjs +35 -0
- package/vendor/Package.28.cjs +37 -0
- package/vendor/Package.28.mjs +35 -0
- package/vendor/Package.29.cjs +40 -0
- package/vendor/Package.29.mjs +38 -0
- package/vendor/Package.3.cjs +60 -60
- package/vendor/Package.3.mjs +85 -85
- package/vendor/Package.30.cjs +41 -0
- package/vendor/Package.30.mjs +39 -0
- package/vendor/Package.31.cjs +72 -0
- package/vendor/Package.31.mjs +70 -0
- package/vendor/Package.32.cjs +37 -0
- package/vendor/Package.32.mjs +35 -0
- package/vendor/Package.33.cjs +37 -0
- package/vendor/Package.33.mjs +35 -0
- package/vendor/Package.34.cjs +46 -0
- package/vendor/Package.34.mjs +44 -0
- package/vendor/Package.35.cjs +34 -0
- package/vendor/Package.35.mjs +32 -0
- package/vendor/Package.36.cjs +40 -0
- package/vendor/Package.36.mjs +38 -0
- package/vendor/Package.37.cjs +36 -0
- package/vendor/Package.37.mjs +34 -0
- package/vendor/Package.38.cjs +52 -0
- package/vendor/Package.38.mjs +50 -0
- package/vendor/Package.39.cjs +41 -0
- package/vendor/Package.39.mjs +39 -0
- package/vendor/Package.4.cjs +884 -874
- package/vendor/Package.4.mjs +887 -877
- package/vendor/Package.40.cjs +42 -0
- package/vendor/Package.40.mjs +40 -0
- package/vendor/Package.41.cjs +53 -0
- package/vendor/Package.41.mjs +51 -0
- package/vendor/Package.42.cjs +53 -0
- package/vendor/Package.42.mjs +51 -0
- package/vendor/Package.43.cjs +40 -0
- package/vendor/Package.43.mjs +38 -0
- package/vendor/Package.44.cjs +46 -0
- package/vendor/Package.44.mjs +44 -0
- package/vendor/Package.45.cjs +53 -0
- package/vendor/Package.45.mjs +51 -0
- package/vendor/Package.46.cjs +59 -0
- package/vendor/Package.46.mjs +57 -0
- package/vendor/Package.47.cjs +65 -0
- package/vendor/Package.47.mjs +63 -0
- package/vendor/Package.48.cjs +38 -0
- package/vendor/Package.48.mjs +36 -0
- package/vendor/Package.49.cjs +38 -0
- package/vendor/Package.49.mjs +36 -0
- package/vendor/Package.5.cjs +19 -15
- package/vendor/Package.5.mjs +14 -10
- package/vendor/Package.50.cjs +36 -0
- package/vendor/Package.50.mjs +34 -0
- package/vendor/Package.51.cjs +43 -0
- package/vendor/Package.51.mjs +41 -0
- package/vendor/Package.52.cjs +37 -0
- package/vendor/Package.52.mjs +35 -0
- package/vendor/Package.53.cjs +43 -0
- package/vendor/Package.53.mjs +41 -0
- package/vendor/Package.54.cjs +55 -0
- package/vendor/Package.54.mjs +53 -0
- package/vendor/Package.55.cjs +37 -0
- package/vendor/Package.55.mjs +35 -0
- package/vendor/Package.56.cjs +37 -0
- package/vendor/Package.56.mjs +35 -0
- package/vendor/Package.57.cjs +37 -0
- package/vendor/Package.57.mjs +35 -0
- package/vendor/Package.58.cjs +45 -0
- package/vendor/Package.58.mjs +43 -0
- package/vendor/Package.59.cjs +53 -0
- package/vendor/Package.59.mjs +51 -0
- package/vendor/Package.6.cjs +2067 -2058
- package/vendor/Package.6.mjs +2073 -2064
- package/vendor/Package.60.cjs +47649 -0
- package/vendor/Package.60.mjs +47606 -0
- package/vendor/Package.610.cjs +19 -19
- package/vendor/Package.610.mjs +11 -11
- package/vendor/Package.611.cjs +40 -30
- package/vendor/Package.611.mjs +30 -20
- package/vendor/Package.612.cjs +48 -42
- package/vendor/Package.612.mjs +39 -33
- package/vendor/Package.613.cjs +64 -63
- package/vendor/Package.613.mjs +34 -33
- package/vendor/Package.62.cjs +300 -297
- package/vendor/Package.62.mjs +283 -280
- package/vendor/Package.63.cjs +511 -168
- package/vendor/Package.63.mjs +490 -165
- package/vendor/Package.64.cjs +139 -511
- package/vendor/Package.64.mjs +139 -491
- package/vendor/Package.65.cjs +4135 -150
- package/vendor/Package.65.mjs +4143 -150
- package/vendor/Package.66.cjs +346 -4150
- package/vendor/Package.66.mjs +346 -4158
- package/vendor/Package.67.cjs +433 -282
- package/vendor/Package.67.mjs +431 -280
- package/vendor/Package.68.cjs +248 -397
- package/vendor/Package.68.mjs +81 -230
- package/vendor/Package.69.cjs +8 -8
- package/vendor/Package.7.cjs +3 -3
- package/vendor/Package.7.mjs +3 -3
- package/vendor/Package.8.cjs +0 -4
- package/vendor/Package.8.mjs +0 -4
- package/vendor/Package.9.cjs +138 -124
- package/vendor/Package.9.mjs +135 -121
- package/vendor/TypeDef.internal.3.d.ts +0 -4
- package/vendor/Package.102.cjs +0 -48773
- package/vendor/Package.102.mjs +0 -48697
- package/vendor/Package.122.cjs +0 -3
- package/vendor/Package.122.mjs +0 -1
package/src/lib/helpers/Glob.mjs
CHANGED
|
@@ -1,35 +1,263 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fileURLToPath as t } from "node:url";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { win32 as e, posix as s } from "node:path";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { realpathSync as i, readlinkSync as n, readdirSync as r, readdir as o, lstatSync as h } from "fs";
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import * as a from "node:fs";
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { realpath as l, readlink as c, readdir as f, lstat as u } from "node:fs/promises";
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { EventEmitter as d } from "node:events";
|
|
12
12
|
|
|
13
|
-
import
|
|
13
|
+
import p from "node:stream";
|
|
14
14
|
|
|
15
|
-
import g from "node:
|
|
15
|
+
import { StringDecoder as g } from "node:string_decoder";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const balanced = (t, e, s) => {
|
|
18
|
+
const i = t instanceof RegExp ? maybeMatch(t, s) : t;
|
|
19
|
+
const n = e instanceof RegExp ? maybeMatch(e, s) : e;
|
|
20
|
+
const r = i !== null && n != null && range(i, n, s);
|
|
21
|
+
return r && {
|
|
22
|
+
start: r[0],
|
|
23
|
+
end: r[1],
|
|
24
|
+
pre: s.slice(0, r[0]),
|
|
25
|
+
body: s.slice(r[0] + i.length, r[1]),
|
|
26
|
+
post: s.slice(r[1] + n.length)
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const maybeMatch = (t, e) => {
|
|
31
|
+
const s = e.match(t);
|
|
32
|
+
return s ? s[0] : null;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const range = (t, e, s) => {
|
|
36
|
+
let i, n, r, o = undefined, h;
|
|
37
|
+
let a = s.indexOf(t);
|
|
38
|
+
let l = s.indexOf(e, a + 1);
|
|
39
|
+
let c = a;
|
|
40
|
+
if (a >= 0 && l > 0) {
|
|
41
|
+
if (t === e) {
|
|
42
|
+
return [ a, l ];
|
|
43
|
+
}
|
|
44
|
+
i = [];
|
|
45
|
+
r = s.length;
|
|
46
|
+
while (c >= 0 && !h) {
|
|
47
|
+
if (c === a) {
|
|
48
|
+
i.push(c);
|
|
49
|
+
a = s.indexOf(t, c + 1);
|
|
50
|
+
} else if (i.length === 1) {
|
|
51
|
+
const t = i.pop();
|
|
52
|
+
if (t !== undefined) h = [ t, l ];
|
|
53
|
+
} else {
|
|
54
|
+
n = i.pop();
|
|
55
|
+
if (n !== undefined && n < r) {
|
|
56
|
+
r = n;
|
|
57
|
+
o = l;
|
|
58
|
+
}
|
|
59
|
+
l = s.indexOf(e, c + 1);
|
|
60
|
+
}
|
|
61
|
+
c = a < l && a >= 0 ? a : l;
|
|
62
|
+
}
|
|
63
|
+
if (i.length && o !== undefined) {
|
|
64
|
+
h = [ r, o ];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return h;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const y = "\0SLASH" + Math.random() + "\0";
|
|
71
|
+
|
|
72
|
+
const w = "\0OPEN" + Math.random() + "\0";
|
|
73
|
+
|
|
74
|
+
const b = "\0CLOSE" + Math.random() + "\0";
|
|
75
|
+
|
|
76
|
+
const S = "\0COMMA" + Math.random() + "\0";
|
|
77
|
+
|
|
78
|
+
const k = "\0PERIOD" + Math.random() + "\0";
|
|
79
|
+
|
|
80
|
+
const x = new RegExp(y, "g");
|
|
81
|
+
|
|
82
|
+
const v = new RegExp(w, "g");
|
|
83
|
+
|
|
84
|
+
const E = new RegExp(b, "g");
|
|
85
|
+
|
|
86
|
+
const C = new RegExp(S, "g");
|
|
87
|
+
|
|
88
|
+
const T = new RegExp(k, "g");
|
|
89
|
+
|
|
90
|
+
const A = /\\\\/g;
|
|
91
|
+
|
|
92
|
+
const L = /\\{/g;
|
|
93
|
+
|
|
94
|
+
const M = /\\}/g;
|
|
95
|
+
|
|
96
|
+
const P = /\\,/g;
|
|
97
|
+
|
|
98
|
+
const F = /\\./g;
|
|
99
|
+
|
|
100
|
+
function numeric(t) {
|
|
101
|
+
return !isNaN(t) ? parseInt(t, 10) : t.charCodeAt(0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function escapeBraces(t) {
|
|
105
|
+
return t.replace(A, y).replace(L, w).replace(M, b).replace(P, S).replace(F, k);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function unescapeBraces(t) {
|
|
109
|
+
return t.replace(x, "\\").replace(v, "{").replace(E, "}").replace(C, ",").replace(T, ".");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function parseCommaParts(t) {
|
|
113
|
+
if (!t) {
|
|
114
|
+
return [ "" ];
|
|
115
|
+
}
|
|
116
|
+
const e = [];
|
|
117
|
+
const s = balanced("{", "}", t);
|
|
118
|
+
if (!s) {
|
|
119
|
+
return t.split(",");
|
|
120
|
+
}
|
|
121
|
+
const {pre: i, body: n, post: r} = s;
|
|
122
|
+
const o = i.split(",");
|
|
123
|
+
o[o.length - 1] += "{" + n + "}";
|
|
124
|
+
const h = parseCommaParts(r);
|
|
125
|
+
if (r.length) {
|
|
126
|
+
o[o.length - 1] += h.shift();
|
|
127
|
+
o.push.apply(o, h);
|
|
128
|
+
}
|
|
129
|
+
e.push.apply(e, o);
|
|
130
|
+
return e;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function expand(t) {
|
|
134
|
+
if (!t) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
if (t.slice(0, 2) === "{}") {
|
|
138
|
+
t = "\\{\\}" + t.slice(2);
|
|
139
|
+
}
|
|
140
|
+
return expand_(escapeBraces(t), true).map(unescapeBraces);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function embrace(t) {
|
|
144
|
+
return "{" + t + "}";
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function isPadded(t) {
|
|
148
|
+
return /^-?0\d/.test(t);
|
|
149
|
+
}
|
|
18
150
|
|
|
19
|
-
|
|
151
|
+
function lte(t, e) {
|
|
152
|
+
return t <= e;
|
|
153
|
+
}
|
|
20
154
|
|
|
21
|
-
|
|
155
|
+
function gte(t, e) {
|
|
156
|
+
return t >= e;
|
|
157
|
+
}
|
|
22
158
|
|
|
23
|
-
|
|
159
|
+
function expand_(t, e) {
|
|
160
|
+
const s = [];
|
|
161
|
+
const i = balanced("{", "}", t);
|
|
162
|
+
if (!i) return [ t ];
|
|
163
|
+
const n = i.pre;
|
|
164
|
+
const r = i.post.length ? expand_(i.post, false) : [ "" ];
|
|
165
|
+
if (/\$$/.test(i.pre)) {
|
|
166
|
+
for (let t = 0; t < r.length; t++) {
|
|
167
|
+
const e = n + "{" + i.body + "}" + r[t];
|
|
168
|
+
s.push(e);
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body);
|
|
172
|
+
const h = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body);
|
|
173
|
+
const a = o || h;
|
|
174
|
+
const l = i.body.indexOf(",") >= 0;
|
|
175
|
+
if (!a && !l) {
|
|
176
|
+
if (i.post.match(/,(?!,).*\}/)) {
|
|
177
|
+
t = i.pre + "{" + i.body + b + i.post;
|
|
178
|
+
return expand_(t);
|
|
179
|
+
}
|
|
180
|
+
return [ t ];
|
|
181
|
+
}
|
|
182
|
+
let c;
|
|
183
|
+
if (a) {
|
|
184
|
+
c = i.body.split(/\.\./);
|
|
185
|
+
} else {
|
|
186
|
+
c = parseCommaParts(i.body);
|
|
187
|
+
if (c.length === 1 && c[0] !== undefined) {
|
|
188
|
+
c = expand_(c[0], false).map(embrace);
|
|
189
|
+
if (c.length === 1) {
|
|
190
|
+
return r.map((t => i.pre + c[0] + t));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
let f;
|
|
195
|
+
if (a && c[0] !== undefined && c[1] !== undefined) {
|
|
196
|
+
const t = numeric(c[0]);
|
|
197
|
+
const e = numeric(c[1]);
|
|
198
|
+
const s = Math.max(c[0].length, c[1].length);
|
|
199
|
+
let i = c.length === 3 && c[2] !== undefined ? Math.abs(numeric(c[2])) : 1;
|
|
200
|
+
let n = lte;
|
|
201
|
+
const r = e < t;
|
|
202
|
+
if (r) {
|
|
203
|
+
i *= -1;
|
|
204
|
+
n = gte;
|
|
205
|
+
}
|
|
206
|
+
const o = c.some(isPadded);
|
|
207
|
+
f = [];
|
|
208
|
+
for (let r = t; n(r, e); r += i) {
|
|
209
|
+
let t;
|
|
210
|
+
if (h) {
|
|
211
|
+
t = String.fromCharCode(r);
|
|
212
|
+
if (t === "\\") {
|
|
213
|
+
t = "";
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
t = String(r);
|
|
217
|
+
if (o) {
|
|
218
|
+
const e = s - t.length;
|
|
219
|
+
if (e > 0) {
|
|
220
|
+
const s = new Array(e + 1).join("0");
|
|
221
|
+
if (r < 0) {
|
|
222
|
+
t = "-" + s + t.slice(1);
|
|
223
|
+
} else {
|
|
224
|
+
t = s + t;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
f.push(t);
|
|
230
|
+
}
|
|
231
|
+
} else {
|
|
232
|
+
f = [];
|
|
233
|
+
for (let t = 0; t < c.length; t++) {
|
|
234
|
+
f.push.apply(f, expand_(c[t], false));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
for (let t = 0; t < f.length; t++) {
|
|
238
|
+
for (let i = 0; i < r.length; i++) {
|
|
239
|
+
const o = n + f[t] + r[i];
|
|
240
|
+
if (!e || a || o) {
|
|
241
|
+
s.push(o);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return s;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const R = 1024 * 64;
|
|
250
|
+
|
|
251
|
+
const assertValidPattern = t => {
|
|
24
252
|
if (typeof t !== "string") {
|
|
25
253
|
throw new TypeError("invalid pattern");
|
|
26
254
|
}
|
|
27
|
-
if (t.length >
|
|
255
|
+
if (t.length > R) {
|
|
28
256
|
throw new TypeError("pattern is too long");
|
|
29
257
|
}
|
|
30
258
|
};
|
|
31
259
|
|
|
32
|
-
const
|
|
260
|
+
const O = {
|
|
33
261
|
"[:alnum:]": [ "\\p{L}\\p{Nl}\\p{Nd}", true ],
|
|
34
262
|
"[:alpha:]": [ "\\p{L}\\p{Nl}", true ],
|
|
35
263
|
"[:ascii:]": [ "\\x" + "00-\\x" + "7f", false ],
|
|
@@ -46,13 +274,13 @@ const b = {
|
|
|
46
274
|
"[:xdigit:]": [ "A-Fa-f0-9", false ]
|
|
47
275
|
};
|
|
48
276
|
|
|
49
|
-
const
|
|
277
|
+
const braceEscape = t => t.replace(/[[\]\\-]/g, "\\$&");
|
|
50
278
|
|
|
51
|
-
const
|
|
279
|
+
const regexpEscape = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
52
280
|
|
|
53
|
-
const
|
|
281
|
+
const rangesToString = t => t.join("");
|
|
54
282
|
|
|
55
|
-
const
|
|
283
|
+
const parseClass = (t, e) => {
|
|
56
284
|
const s = e;
|
|
57
285
|
if (t.charAt(s) !== "[") {
|
|
58
286
|
throw new Error("not in a brace expression");
|
|
@@ -86,7 +314,7 @@ const x = (t, e) => {
|
|
|
86
314
|
}
|
|
87
315
|
}
|
|
88
316
|
if (e === "[" && !a) {
|
|
89
|
-
for (const [e, [o, a, l]] of Object.entries(
|
|
317
|
+
for (const [e, [o, a, l]] of Object.entries(O)) {
|
|
90
318
|
if (t.startsWith(e, r)) {
|
|
91
319
|
if (f) {
|
|
92
320
|
return [ "$.", false, t.length - s, true ];
|
|
@@ -101,16 +329,16 @@ const x = (t, e) => {
|
|
|
101
329
|
a = false;
|
|
102
330
|
if (f) {
|
|
103
331
|
if (e > f) {
|
|
104
|
-
i.push(
|
|
332
|
+
i.push(braceEscape(f) + "-" + braceEscape(e));
|
|
105
333
|
} else if (e === f) {
|
|
106
|
-
i.push(
|
|
334
|
+
i.push(braceEscape(e));
|
|
107
335
|
}
|
|
108
336
|
f = "";
|
|
109
337
|
r++;
|
|
110
338
|
continue;
|
|
111
339
|
}
|
|
112
340
|
if (t.startsWith("-]", r + 1)) {
|
|
113
|
-
i.push(
|
|
341
|
+
i.push(braceEscape(e + "-"));
|
|
114
342
|
r += 2;
|
|
115
343
|
continue;
|
|
116
344
|
}
|
|
@@ -119,7 +347,7 @@ const x = (t, e) => {
|
|
|
119
347
|
r += 2;
|
|
120
348
|
continue;
|
|
121
349
|
}
|
|
122
|
-
i.push(
|
|
350
|
+
i.push(braceEscape(e));
|
|
123
351
|
r++;
|
|
124
352
|
}
|
|
125
353
|
if (c < r) {
|
|
@@ -130,37 +358,42 @@ const x = (t, e) => {
|
|
|
130
358
|
}
|
|
131
359
|
if (n.length === 0 && i.length === 1 && /^\\?.$/.test(i[0]) && !l) {
|
|
132
360
|
const t = i[0].length === 2 ? i[0].slice(-1) : i[0];
|
|
133
|
-
return [
|
|
361
|
+
return [ regexpEscape(t), false, c - s, false ];
|
|
134
362
|
}
|
|
135
|
-
const u = "[" + (l ? "^" : "") +
|
|
136
|
-
const d = "[" + (l ? "" : "^") +
|
|
363
|
+
const u = "[" + (l ? "^" : "") + rangesToString(i) + "]";
|
|
364
|
+
const d = "[" + (l ? "" : "^") + rangesToString(n) + "]";
|
|
137
365
|
const p = i.length && n.length ? "(" + u + "|" + d + ")" : i.length ? u : d;
|
|
138
366
|
return [ p, h, c - s, true ];
|
|
139
367
|
};
|
|
140
368
|
|
|
141
|
-
const
|
|
369
|
+
const unescape = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = true} = {}) => {
|
|
370
|
+
if (s) {
|
|
371
|
+
return e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
372
|
+
}
|
|
373
|
+
return e ? t.replace(/\[([^\/\\{}])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
374
|
+
};
|
|
142
375
|
|
|
143
|
-
const
|
|
376
|
+
const z = new Set([ "!", "?", "+", "*", "@" ]);
|
|
144
377
|
|
|
145
|
-
const
|
|
378
|
+
const isExtglobType = t => z.has(t);
|
|
146
379
|
|
|
147
|
-
const
|
|
380
|
+
const D = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
148
381
|
|
|
149
|
-
const
|
|
382
|
+
const B = "(?!\\.)";
|
|
150
383
|
|
|
151
|
-
const
|
|
384
|
+
const N = new Set([ "[", "." ]);
|
|
152
385
|
|
|
153
|
-
const
|
|
386
|
+
const I = new Set([ "..", "." ]);
|
|
154
387
|
|
|
155
|
-
const
|
|
388
|
+
const W = new Set("().*{}+?[]^$\\!");
|
|
156
389
|
|
|
157
|
-
const
|
|
390
|
+
const regExpEscape$1 = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
158
391
|
|
|
159
|
-
const
|
|
392
|
+
const _ = "[^/]";
|
|
160
393
|
|
|
161
|
-
const
|
|
394
|
+
const j = _ + "*?";
|
|
162
395
|
|
|
163
|
-
const
|
|
396
|
+
const $ = _ + "+?";
|
|
164
397
|
|
|
165
398
|
class AST {
|
|
166
399
|
type;
|
|
@@ -306,7 +539,7 @@ class AST {
|
|
|
306
539
|
l += s;
|
|
307
540
|
continue;
|
|
308
541
|
}
|
|
309
|
-
if (!i.noext &&
|
|
542
|
+
if (!i.noext && isExtglobType(s) && t.charAt(a) === "(") {
|
|
310
543
|
e.push(l);
|
|
311
544
|
l = "";
|
|
312
545
|
const n = new AST(s, e);
|
|
@@ -347,7 +580,7 @@ class AST {
|
|
|
347
580
|
f += s;
|
|
348
581
|
continue;
|
|
349
582
|
}
|
|
350
|
-
if (
|
|
583
|
+
if (isExtglobType(s) && t.charAt(a) === "(") {
|
|
351
584
|
l.push(f);
|
|
352
585
|
f = "";
|
|
353
586
|
const e = new AST(s, l);
|
|
@@ -404,7 +637,7 @@ class AST {
|
|
|
404
637
|
const e = t ?? !!this.#a.dot;
|
|
405
638
|
if (this.#t === this) this.#f();
|
|
406
639
|
if (!this.type) {
|
|
407
|
-
const s = this.isStart() && this.isEnd();
|
|
640
|
+
const s = this.isStart() && this.isEnd() && !this.#i.some((t => typeof t !== "string"));
|
|
408
641
|
const i = this.#i.map((e => {
|
|
409
642
|
const [i, n, r, o] = typeof e === "string" ? AST.#d(e, this.#e, s) : e.toRegExpSource(t);
|
|
410
643
|
this.#e = this.#e || r;
|
|
@@ -414,12 +647,12 @@ class AST {
|
|
|
414
647
|
let n = "";
|
|
415
648
|
if (this.isStart()) {
|
|
416
649
|
if (typeof this.#i[0] === "string") {
|
|
417
|
-
const s = this.#i.length === 1 &&
|
|
650
|
+
const s = this.#i.length === 1 && I.has(this.#i[0]);
|
|
418
651
|
if (!s) {
|
|
419
|
-
const s =
|
|
652
|
+
const s = N;
|
|
420
653
|
const r = e && s.has(i.charAt(0)) || i.startsWith("\\.") && s.has(i.charAt(2)) || i.startsWith("\\.\\.") && s.has(i.charAt(4));
|
|
421
654
|
const o = !e && !t && s.has(i.charAt(0));
|
|
422
|
-
n = r ?
|
|
655
|
+
n = r ? D : o ? B : "";
|
|
423
656
|
}
|
|
424
657
|
}
|
|
425
658
|
}
|
|
@@ -428,7 +661,7 @@ class AST {
|
|
|
428
661
|
r = "(?:$|\\/)";
|
|
429
662
|
}
|
|
430
663
|
const o = n + i + r;
|
|
431
|
-
return [ o,
|
|
664
|
+
return [ o, unescape(i), this.#e = !!this.#e, this.#s ];
|
|
432
665
|
}
|
|
433
666
|
const s = this.type === "*" || this.type === "+";
|
|
434
667
|
const i = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
@@ -438,9 +671,9 @@ class AST {
|
|
|
438
671
|
this.#i = [ t ];
|
|
439
672
|
this.type = null;
|
|
440
673
|
this.#e = undefined;
|
|
441
|
-
return [ t,
|
|
674
|
+
return [ t, unescape(this.toString()), false, false ];
|
|
442
675
|
}
|
|
443
|
-
let r = !s || t || e || !
|
|
676
|
+
let r = !s || t || e || !B ? "" : this.#p(true);
|
|
444
677
|
if (r === n) {
|
|
445
678
|
r = "";
|
|
446
679
|
}
|
|
@@ -449,12 +682,12 @@ class AST {
|
|
|
449
682
|
}
|
|
450
683
|
let o = "";
|
|
451
684
|
if (this.type === "!" && this.#c) {
|
|
452
|
-
o = (this.isStart() && !e ?
|
|
685
|
+
o = (this.isStart() && !e ? B : "") + $;
|
|
453
686
|
} else {
|
|
454
|
-
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ?
|
|
687
|
+
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ? B : "") + j + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && r ? ")" : this.type === "*" && r ? `)?` : `)${this.type}`;
|
|
455
688
|
o = i + n + s;
|
|
456
689
|
}
|
|
457
|
-
return [ o,
|
|
690
|
+
return [ o, unescape(n), this.#e = !!this.#e, this.#s ];
|
|
458
691
|
}
|
|
459
692
|
#p(t) {
|
|
460
693
|
return this.#i.map((e => {
|
|
@@ -474,7 +707,7 @@ class AST {
|
|
|
474
707
|
const h = t.charAt(o);
|
|
475
708
|
if (i) {
|
|
476
709
|
i = false;
|
|
477
|
-
n += (
|
|
710
|
+
n += (W.has(h) ? "\\" : "") + h;
|
|
478
711
|
continue;
|
|
479
712
|
}
|
|
480
713
|
if (h === "\\") {
|
|
@@ -486,7 +719,7 @@ class AST {
|
|
|
486
719
|
continue;
|
|
487
720
|
}
|
|
488
721
|
if (h === "[") {
|
|
489
|
-
const [s, i, h, a] =
|
|
722
|
+
const [s, i, h, a] = parseClass(t, o);
|
|
490
723
|
if (h) {
|
|
491
724
|
n += s;
|
|
492
725
|
r = r || i;
|
|
@@ -496,102 +729,107 @@ class AST {
|
|
|
496
729
|
}
|
|
497
730
|
}
|
|
498
731
|
if (h === "*") {
|
|
499
|
-
|
|
732
|
+
n += s && t === "*" ? $ : j;
|
|
500
733
|
e = true;
|
|
501
734
|
continue;
|
|
502
735
|
}
|
|
503
736
|
if (h === "?") {
|
|
504
|
-
n +=
|
|
737
|
+
n += _;
|
|
505
738
|
e = true;
|
|
506
739
|
continue;
|
|
507
740
|
}
|
|
508
|
-
n +=
|
|
741
|
+
n += regExpEscape$1(h);
|
|
509
742
|
}
|
|
510
|
-
return [ n,
|
|
743
|
+
return [ n, unescape(t), !!e, r ];
|
|
511
744
|
}
|
|
512
745
|
}
|
|
513
746
|
|
|
514
|
-
const
|
|
747
|
+
const escape = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = false} = {}) => {
|
|
748
|
+
if (s) {
|
|
749
|
+
return e ? t.replace(/[?*()[\]{}]/g, "[$&]") : t.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
750
|
+
}
|
|
751
|
+
return e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&");
|
|
752
|
+
};
|
|
515
753
|
|
|
516
|
-
const
|
|
517
|
-
|
|
754
|
+
const minimatch = (t, e, s = {}) => {
|
|
755
|
+
assertValidPattern(e);
|
|
518
756
|
if (!s.nocomment && e.charAt(0) === "#") {
|
|
519
757
|
return false;
|
|
520
758
|
}
|
|
521
759
|
return new Minimatch(e, s).match(t);
|
|
522
760
|
};
|
|
523
761
|
|
|
524
|
-
const
|
|
762
|
+
const G = /^\*+([^+@!?\*\[\(]*)$/;
|
|
525
763
|
|
|
526
|
-
const
|
|
764
|
+
const starDotExtTest = t => e => !e.startsWith(".") && e.endsWith(t);
|
|
527
765
|
|
|
528
|
-
const
|
|
766
|
+
const starDotExtTestDot = t => e => e.endsWith(t);
|
|
529
767
|
|
|
530
|
-
const
|
|
768
|
+
const starDotExtTestNocase = t => {
|
|
531
769
|
t = t.toLowerCase();
|
|
532
770
|
return e => !e.startsWith(".") && e.toLowerCase().endsWith(t);
|
|
533
771
|
};
|
|
534
772
|
|
|
535
|
-
const
|
|
773
|
+
const starDotExtTestNocaseDot = t => {
|
|
536
774
|
t = t.toLowerCase();
|
|
537
775
|
return e => e.toLowerCase().endsWith(t);
|
|
538
776
|
};
|
|
539
777
|
|
|
540
|
-
const
|
|
778
|
+
const U = /^\*+\.\*+$/;
|
|
541
779
|
|
|
542
|
-
const
|
|
780
|
+
const starDotStarTest = t => !t.startsWith(".") && t.includes(".");
|
|
543
781
|
|
|
544
|
-
const
|
|
782
|
+
const starDotStarTestDot = t => t !== "." && t !== ".." && t.includes(".");
|
|
545
783
|
|
|
546
|
-
const
|
|
784
|
+
const H = /^\.\*+$/;
|
|
547
785
|
|
|
548
|
-
const
|
|
786
|
+
const dotStarTest = t => t !== "." && t !== ".." && t.startsWith(".");
|
|
549
787
|
|
|
550
|
-
const
|
|
788
|
+
const Z = /^\*+$/;
|
|
551
789
|
|
|
552
|
-
const
|
|
790
|
+
const starTest = t => t.length !== 0 && !t.startsWith(".");
|
|
553
791
|
|
|
554
|
-
const
|
|
792
|
+
const starTestDot = t => t.length !== 0 && t !== "." && t !== "..";
|
|
555
793
|
|
|
556
|
-
const
|
|
794
|
+
const q = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
557
795
|
|
|
558
|
-
const
|
|
559
|
-
const s =
|
|
796
|
+
const qmarksTestNocase = ([t, e = ""]) => {
|
|
797
|
+
const s = qmarksTestNoExt([ t ]);
|
|
560
798
|
if (!e) return s;
|
|
561
799
|
e = e.toLowerCase();
|
|
562
800
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
563
801
|
};
|
|
564
802
|
|
|
565
|
-
const
|
|
566
|
-
const s =
|
|
803
|
+
const qmarksTestNocaseDot = ([t, e = ""]) => {
|
|
804
|
+
const s = qmarksTestNoExtDot([ t ]);
|
|
567
805
|
if (!e) return s;
|
|
568
806
|
e = e.toLowerCase();
|
|
569
807
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
570
808
|
};
|
|
571
809
|
|
|
572
|
-
const
|
|
573
|
-
const s =
|
|
810
|
+
const qmarksTestDot = ([t, e = ""]) => {
|
|
811
|
+
const s = qmarksTestNoExtDot([ t ]);
|
|
574
812
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
575
813
|
};
|
|
576
814
|
|
|
577
|
-
const
|
|
578
|
-
const s =
|
|
815
|
+
const qmarksTest = ([t, e = ""]) => {
|
|
816
|
+
const s = qmarksTestNoExt([ t ]);
|
|
579
817
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
580
818
|
};
|
|
581
819
|
|
|
582
|
-
const
|
|
820
|
+
const qmarksTestNoExt = ([t]) => {
|
|
583
821
|
const e = t.length;
|
|
584
822
|
return t => t.length === e && !t.startsWith(".");
|
|
585
823
|
};
|
|
586
824
|
|
|
587
|
-
const
|
|
825
|
+
const qmarksTestNoExtDot = ([t]) => {
|
|
588
826
|
const e = t.length;
|
|
589
827
|
return t => t.length === e && t !== "." && t !== "..";
|
|
590
828
|
};
|
|
591
829
|
|
|
592
|
-
const
|
|
830
|
+
const V = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
593
831
|
|
|
594
|
-
const
|
|
832
|
+
const J = {
|
|
595
833
|
win32: {
|
|
596
834
|
sep: "\\"
|
|
597
835
|
},
|
|
@@ -600,80 +838,80 @@ const rt = {
|
|
|
600
838
|
}
|
|
601
839
|
};
|
|
602
840
|
|
|
603
|
-
const
|
|
841
|
+
const K = V === "win32" ? J.win32.sep : J.posix.sep;
|
|
604
842
|
|
|
605
|
-
|
|
843
|
+
minimatch.sep = K;
|
|
606
844
|
|
|
607
|
-
const
|
|
845
|
+
const Y = Symbol("globstar **");
|
|
608
846
|
|
|
609
|
-
|
|
847
|
+
minimatch.GLOBSTAR = Y;
|
|
610
848
|
|
|
611
|
-
const
|
|
849
|
+
const X = "[^/]";
|
|
612
850
|
|
|
613
|
-
const
|
|
851
|
+
const Q = X + "*?";
|
|
614
852
|
|
|
615
|
-
const
|
|
853
|
+
const tt = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
616
854
|
|
|
617
|
-
const
|
|
855
|
+
const et = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
618
856
|
|
|
619
|
-
const
|
|
857
|
+
const filter = (t, e = {}) => s => minimatch(s, t, e);
|
|
620
858
|
|
|
621
|
-
|
|
859
|
+
minimatch.filter = filter;
|
|
622
860
|
|
|
623
|
-
const
|
|
861
|
+
const ext = (t, e = {}) => Object.assign({}, t, e);
|
|
624
862
|
|
|
625
|
-
const
|
|
863
|
+
const defaults = t => {
|
|
626
864
|
if (!t || typeof t !== "object" || !Object.keys(t).length) {
|
|
627
|
-
return
|
|
865
|
+
return minimatch;
|
|
628
866
|
}
|
|
629
|
-
const e =
|
|
630
|
-
const
|
|
631
|
-
return Object.assign(
|
|
867
|
+
const e = minimatch;
|
|
868
|
+
const m = (s, i, n = {}) => e(s, i, ext(t, n));
|
|
869
|
+
return Object.assign(m, {
|
|
632
870
|
Minimatch: class Minimatch extends e.Minimatch {
|
|
633
871
|
constructor(e, s = {}) {
|
|
634
|
-
super(e,
|
|
872
|
+
super(e, ext(t, s));
|
|
635
873
|
}
|
|
636
874
|
static defaults(s) {
|
|
637
|
-
return e.defaults(
|
|
875
|
+
return e.defaults(ext(t, s)).Minimatch;
|
|
638
876
|
}
|
|
639
877
|
},
|
|
640
878
|
AST: class AST extends e.AST {
|
|
641
879
|
constructor(e, s, i = {}) {
|
|
642
|
-
super(e, s,
|
|
880
|
+
super(e, s, ext(t, i));
|
|
643
881
|
}
|
|
644
882
|
static fromGlob(s, i = {}) {
|
|
645
|
-
return e.AST.fromGlob(s,
|
|
883
|
+
return e.AST.fromGlob(s, ext(t, i));
|
|
646
884
|
}
|
|
647
885
|
},
|
|
648
|
-
unescape: (s, i = {}) => e.unescape(s,
|
|
649
|
-
escape: (s, i = {}) => e.escape(s,
|
|
650
|
-
filter: (s, i = {}) => e.filter(s,
|
|
651
|
-
defaults: s => e.defaults(
|
|
652
|
-
makeRe: (s, i = {}) => e.makeRe(s,
|
|
653
|
-
braceExpand: (s, i = {}) => e.braceExpand(s,
|
|
654
|
-
match: (s, i, n = {}) => e.match(s, i,
|
|
886
|
+
unescape: (s, i = {}) => e.unescape(s, ext(t, i)),
|
|
887
|
+
escape: (s, i = {}) => e.escape(s, ext(t, i)),
|
|
888
|
+
filter: (s, i = {}) => e.filter(s, ext(t, i)),
|
|
889
|
+
defaults: s => e.defaults(ext(t, s)),
|
|
890
|
+
makeRe: (s, i = {}) => e.makeRe(s, ext(t, i)),
|
|
891
|
+
braceExpand: (s, i = {}) => e.braceExpand(s, ext(t, i)),
|
|
892
|
+
match: (s, i, n = {}) => e.match(s, i, ext(t, n)),
|
|
655
893
|
sep: e.sep,
|
|
656
|
-
GLOBSTAR:
|
|
894
|
+
GLOBSTAR: Y
|
|
657
895
|
});
|
|
658
896
|
};
|
|
659
897
|
|
|
660
|
-
|
|
898
|
+
minimatch.defaults = defaults;
|
|
661
899
|
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
if (
|
|
665
|
-
return [
|
|
900
|
+
const braceExpand = (t, e = {}) => {
|
|
901
|
+
assertValidPattern(t);
|
|
902
|
+
if (e.nobrace || !/\{(?:(?!\{).)*\}/.test(t)) {
|
|
903
|
+
return [ t ];
|
|
666
904
|
}
|
|
667
|
-
return t
|
|
905
|
+
return expand(t);
|
|
668
906
|
};
|
|
669
907
|
|
|
670
|
-
|
|
908
|
+
minimatch.braceExpand = braceExpand;
|
|
671
909
|
|
|
672
|
-
const
|
|
910
|
+
const makeRe = (t, e = {}) => new Minimatch(t, e).makeRe();
|
|
673
911
|
|
|
674
|
-
|
|
912
|
+
minimatch.makeRe = makeRe;
|
|
675
913
|
|
|
676
|
-
const
|
|
914
|
+
const match = (t, e, s = {}) => {
|
|
677
915
|
const i = new Minimatch(e, s);
|
|
678
916
|
t = t.filter((t => i.match(t)));
|
|
679
917
|
if (i.options.nonull && !t.length) {
|
|
@@ -682,11 +920,11 @@ const wt = (t, e, s = {}) => {
|
|
|
682
920
|
return t;
|
|
683
921
|
};
|
|
684
922
|
|
|
685
|
-
|
|
923
|
+
minimatch.match = match;
|
|
686
924
|
|
|
687
|
-
const
|
|
925
|
+
const st = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
688
926
|
|
|
689
|
-
const
|
|
927
|
+
const regExpEscape = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
690
928
|
|
|
691
929
|
class Minimatch {
|
|
692
930
|
options;
|
|
@@ -707,11 +945,11 @@ class Minimatch {
|
|
|
707
945
|
windowsNoMagicRoot;
|
|
708
946
|
regexp;
|
|
709
947
|
constructor(t, e = {}) {
|
|
710
|
-
|
|
948
|
+
assertValidPattern(t);
|
|
711
949
|
e = e || {};
|
|
712
950
|
this.options = e;
|
|
713
951
|
this.pattern = t;
|
|
714
|
-
this.platform = e.platform ||
|
|
952
|
+
this.platform = e.platform || V;
|
|
715
953
|
this.isWindows = this.platform === "win32";
|
|
716
954
|
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false;
|
|
717
955
|
if (this.windowsPathsNoEscape) {
|
|
@@ -765,7 +1003,7 @@ class Minimatch {
|
|
|
765
1003
|
this.debug(this.pattern, this.globParts);
|
|
766
1004
|
let i = this.globParts.map(((t, e, s) => {
|
|
767
1005
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
768
|
-
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !
|
|
1006
|
+
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !st.test(t[2])) && !st.test(t[3]);
|
|
769
1007
|
const s = /^[a-z]:/i.test(t[0]);
|
|
770
1008
|
if (e) {
|
|
771
1009
|
return [ ...t.slice(0, 4), ...t.slice(4).map((t => this.parse(t))) ];
|
|
@@ -1032,7 +1270,7 @@ class Minimatch {
|
|
|
1032
1270
|
if (l === false) {
|
|
1033
1271
|
return false;
|
|
1034
1272
|
}
|
|
1035
|
-
if (l ===
|
|
1273
|
+
if (l === Y) {
|
|
1036
1274
|
this.debug("GLOBSTAR", [ e, l, c ]);
|
|
1037
1275
|
var f = r;
|
|
1038
1276
|
var u = o + 1;
|
|
@@ -1087,25 +1325,25 @@ class Minimatch {
|
|
|
1087
1325
|
}
|
|
1088
1326
|
}
|
|
1089
1327
|
braceExpand() {
|
|
1090
|
-
return
|
|
1328
|
+
return braceExpand(this.pattern, this.options);
|
|
1091
1329
|
}
|
|
1092
1330
|
parse(t) {
|
|
1093
|
-
|
|
1331
|
+
assertValidPattern(t);
|
|
1094
1332
|
const e = this.options;
|
|
1095
|
-
if (t === "**") return
|
|
1333
|
+
if (t === "**") return Y;
|
|
1096
1334
|
if (t === "") return "";
|
|
1097
1335
|
let s;
|
|
1098
1336
|
let i = null;
|
|
1099
|
-
if (s = t.match(
|
|
1100
|
-
i = e.dot ?
|
|
1101
|
-
} else if (s = t.match(W)) {
|
|
1102
|
-
i = (e.nocase ? e.dot ? U : j : e.dot ? _ : I)(s[1]);
|
|
1103
|
-
} else if (s = t.match(Y)) {
|
|
1104
|
-
i = (e.nocase ? e.dot ? Q : X : e.dot ? tt : et)(s);
|
|
1337
|
+
if (s = t.match(Z)) {
|
|
1338
|
+
i = e.dot ? starTestDot : starTest;
|
|
1105
1339
|
} else if (s = t.match(G)) {
|
|
1106
|
-
i = e.dot ?
|
|
1340
|
+
i = (e.nocase ? e.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : e.dot ? starDotExtTestDot : starDotExtTest)(s[1]);
|
|
1107
1341
|
} else if (s = t.match(q)) {
|
|
1108
|
-
i =
|
|
1342
|
+
i = (e.nocase ? e.dot ? qmarksTestNocaseDot : qmarksTestNocase : e.dot ? qmarksTestDot : qmarksTest)(s);
|
|
1343
|
+
} else if (s = t.match(U)) {
|
|
1344
|
+
i = e.dot ? starDotStarTestDot : starDotStarTest;
|
|
1345
|
+
} else if (s = t.match(H)) {
|
|
1346
|
+
i = dotStarTest;
|
|
1109
1347
|
}
|
|
1110
1348
|
const n = AST.fromGlob(t, this.options).toMMPattern();
|
|
1111
1349
|
if (i && typeof n === "object") {
|
|
@@ -1123,38 +1361,49 @@ class Minimatch {
|
|
|
1123
1361
|
return this.regexp;
|
|
1124
1362
|
}
|
|
1125
1363
|
const e = this.options;
|
|
1126
|
-
const s = e.noglobstar ?
|
|
1364
|
+
const s = e.noglobstar ? Q : e.dot ? tt : et;
|
|
1127
1365
|
const i = new Set(e.nocase ? [ "i" ] : []);
|
|
1128
1366
|
let n = t.map((t => {
|
|
1129
1367
|
const e = t.map((t => {
|
|
1130
1368
|
if (t instanceof RegExp) {
|
|
1131
1369
|
for (const e of t.flags.split("")) i.add(e);
|
|
1132
1370
|
}
|
|
1133
|
-
return typeof t === "string" ?
|
|
1371
|
+
return typeof t === "string" ? regExpEscape(t) : t === Y ? Y : t._src;
|
|
1134
1372
|
}));
|
|
1135
1373
|
e.forEach(((t, i) => {
|
|
1136
1374
|
const n = e[i + 1];
|
|
1137
1375
|
const r = e[i - 1];
|
|
1138
|
-
if (t !==
|
|
1376
|
+
if (t !== Y || r === Y) {
|
|
1139
1377
|
return;
|
|
1140
1378
|
}
|
|
1141
1379
|
if (r === undefined) {
|
|
1142
|
-
if (n !== undefined && n !==
|
|
1380
|
+
if (n !== undefined && n !== Y) {
|
|
1143
1381
|
e[i + 1] = "(?:\\/|" + s + "\\/)?" + n;
|
|
1144
1382
|
} else {
|
|
1145
1383
|
e[i] = s;
|
|
1146
1384
|
}
|
|
1147
1385
|
} else if (n === undefined) {
|
|
1148
|
-
e[i - 1] = r + "(
|
|
1149
|
-
} else if (n !==
|
|
1386
|
+
e[i - 1] = r + "(?:\\/|\\/" + s + ")?";
|
|
1387
|
+
} else if (n !== Y) {
|
|
1150
1388
|
e[i - 1] = r + "(?:\\/|\\/" + s + "\\/)" + n;
|
|
1151
|
-
e[i + 1] =
|
|
1389
|
+
e[i + 1] = Y;
|
|
1152
1390
|
}
|
|
1153
1391
|
}));
|
|
1154
|
-
|
|
1392
|
+
const n = e.filter((t => t !== Y));
|
|
1393
|
+
if (this.partial && n.length >= 1) {
|
|
1394
|
+
const t = [];
|
|
1395
|
+
for (let e = 1; e <= n.length; e++) {
|
|
1396
|
+
t.push(n.slice(0, e).join("/"));
|
|
1397
|
+
}
|
|
1398
|
+
return "(?:" + t.join("|") + ")";
|
|
1399
|
+
}
|
|
1400
|
+
return n.join("/");
|
|
1155
1401
|
})).join("|");
|
|
1156
1402
|
const [r, o] = t.length > 1 ? [ "(?:", ")" ] : [ "", "" ];
|
|
1157
1403
|
n = "^" + r + n + o + "$";
|
|
1404
|
+
if (this.partial) {
|
|
1405
|
+
n = "^(?:\\/|" + r + n.slice(1, -1) + o + ")$";
|
|
1406
|
+
}
|
|
1158
1407
|
if (this.negate) n = "^(?!" + n + ").+$";
|
|
1159
1408
|
try {
|
|
1160
1409
|
this.regexp = new RegExp(n, [ ...i ].join(""));
|
|
@@ -1217,34 +1466,34 @@ class Minimatch {
|
|
|
1217
1466
|
return this.negate;
|
|
1218
1467
|
}
|
|
1219
1468
|
static defaults(t) {
|
|
1220
|
-
return
|
|
1469
|
+
return minimatch.defaults(t).Minimatch;
|
|
1221
1470
|
}
|
|
1222
1471
|
}
|
|
1223
1472
|
|
|
1224
|
-
|
|
1473
|
+
minimatch.AST = AST;
|
|
1225
1474
|
|
|
1226
|
-
|
|
1475
|
+
minimatch.Minimatch = Minimatch;
|
|
1227
1476
|
|
|
1228
|
-
|
|
1477
|
+
minimatch.escape = escape;
|
|
1229
1478
|
|
|
1230
|
-
|
|
1479
|
+
minimatch.unescape = unescape;
|
|
1231
1480
|
|
|
1232
|
-
const
|
|
1481
|
+
const it = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
1233
1482
|
|
|
1234
|
-
const
|
|
1483
|
+
const nt = new Set;
|
|
1235
1484
|
|
|
1236
|
-
const
|
|
1485
|
+
const rt = typeof process === "object" && !!process ? process : {};
|
|
1237
1486
|
|
|
1238
|
-
const
|
|
1239
|
-
typeof
|
|
1487
|
+
const emitWarning = (t, e, s, i) => {
|
|
1488
|
+
typeof rt.emitWarning === "function" ? rt.emitWarning(t, e, s, i) : console.error(`[${s}] ${e}: ${t}`);
|
|
1240
1489
|
};
|
|
1241
1490
|
|
|
1242
|
-
let
|
|
1491
|
+
let ot = globalThis.AbortController;
|
|
1243
1492
|
|
|
1244
|
-
let
|
|
1493
|
+
let ht = globalThis.AbortSignal;
|
|
1245
1494
|
|
|
1246
|
-
if (typeof
|
|
1247
|
-
|
|
1495
|
+
if (typeof ot === "undefined") {
|
|
1496
|
+
ht = class AbortSignal {
|
|
1248
1497
|
onabort;
|
|
1249
1498
|
_onabort=[];
|
|
1250
1499
|
reason;
|
|
@@ -1253,11 +1502,11 @@ if (typeof Et === "undefined") {
|
|
|
1253
1502
|
this._onabort.push(e);
|
|
1254
1503
|
}
|
|
1255
1504
|
};
|
|
1256
|
-
|
|
1505
|
+
ot = class AbortController {
|
|
1257
1506
|
constructor() {
|
|
1258
|
-
|
|
1507
|
+
warnACPolyfill();
|
|
1259
1508
|
}
|
|
1260
|
-
signal=new
|
|
1509
|
+
signal=new ht;
|
|
1261
1510
|
abort(t) {
|
|
1262
1511
|
if (this.signal.aborted) return;
|
|
1263
1512
|
this.signal.reason = t;
|
|
@@ -1268,21 +1517,21 @@ if (typeof Et === "undefined") {
|
|
|
1268
1517
|
this.signal.onabort?.(t);
|
|
1269
1518
|
}
|
|
1270
1519
|
};
|
|
1271
|
-
let t =
|
|
1272
|
-
const
|
|
1520
|
+
let t = rt.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1521
|
+
const warnACPolyfill = () => {
|
|
1273
1522
|
if (!t) return;
|
|
1274
1523
|
t = false;
|
|
1275
|
-
|
|
1524
|
+
emitWarning("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", warnACPolyfill);
|
|
1276
1525
|
};
|
|
1277
1526
|
}
|
|
1278
1527
|
|
|
1279
|
-
const
|
|
1528
|
+
const shouldWarn = t => !nt.has(t);
|
|
1280
1529
|
|
|
1281
|
-
const
|
|
1530
|
+
const at = Symbol("type");
|
|
1282
1531
|
|
|
1283
|
-
const
|
|
1532
|
+
const isPosInt = t => t && t === Math.floor(t) && t > 0 && isFinite(t);
|
|
1284
1533
|
|
|
1285
|
-
const
|
|
1534
|
+
const getUintArray = t => !isPosInt(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;
|
|
1286
1535
|
|
|
1287
1536
|
class ZeroArray extends Array {
|
|
1288
1537
|
constructor(t) {
|
|
@@ -1296,7 +1545,7 @@ class Stack {
|
|
|
1296
1545
|
length;
|
|
1297
1546
|
static #g=false;
|
|
1298
1547
|
static create(t) {
|
|
1299
|
-
const e =
|
|
1548
|
+
const e = getUintArray(t);
|
|
1300
1549
|
if (!e) return [];
|
|
1301
1550
|
Stack.#g = true;
|
|
1302
1551
|
const s = new Stack(t, e);
|
|
@@ -1320,12 +1569,12 @@ class Stack {
|
|
|
1320
1569
|
|
|
1321
1570
|
class LRUCache {
|
|
1322
1571
|
#m;
|
|
1323
|
-
#w;
|
|
1324
1572
|
#y;
|
|
1573
|
+
#w;
|
|
1325
1574
|
#b;
|
|
1326
1575
|
#S;
|
|
1327
1576
|
#k;
|
|
1328
|
-
#
|
|
1577
|
+
#x;
|
|
1329
1578
|
ttl;
|
|
1330
1579
|
ttlResolution;
|
|
1331
1580
|
ttlAutopurge;
|
|
@@ -1341,33 +1590,33 @@ class LRUCache {
|
|
|
1341
1590
|
allowStaleOnFetchAbort;
|
|
1342
1591
|
allowStaleOnFetchRejection;
|
|
1343
1592
|
ignoreFetchAbort;
|
|
1344
|
-
#
|
|
1593
|
+
#v;
|
|
1345
1594
|
#E;
|
|
1346
1595
|
#C;
|
|
1347
1596
|
#T;
|
|
1348
|
-
#L;
|
|
1349
1597
|
#A;
|
|
1598
|
+
#L;
|
|
1350
1599
|
#M;
|
|
1351
1600
|
#P;
|
|
1352
1601
|
#F;
|
|
1353
1602
|
#R;
|
|
1354
|
-
#z;
|
|
1355
1603
|
#O;
|
|
1604
|
+
#z;
|
|
1356
1605
|
#D;
|
|
1357
|
-
#N;
|
|
1358
1606
|
#B;
|
|
1359
|
-
#
|
|
1607
|
+
#N;
|
|
1360
1608
|
#I;
|
|
1609
|
+
#W;
|
|
1361
1610
|
#_;
|
|
1362
1611
|
static unsafeExposeInternals(t) {
|
|
1363
1612
|
return {
|
|
1364
1613
|
starts: t.#D,
|
|
1365
|
-
ttls: t.#
|
|
1366
|
-
sizes: t.#
|
|
1614
|
+
ttls: t.#B,
|
|
1615
|
+
sizes: t.#z,
|
|
1367
1616
|
keyMap: t.#C,
|
|
1368
1617
|
keyList: t.#T,
|
|
1369
|
-
valList: t.#
|
|
1370
|
-
next: t.#
|
|
1618
|
+
valList: t.#A,
|
|
1619
|
+
next: t.#L,
|
|
1371
1620
|
prev: t.#M,
|
|
1372
1621
|
get head() {
|
|
1373
1622
|
return t.#P;
|
|
@@ -1377,33 +1626,33 @@ class LRUCache {
|
|
|
1377
1626
|
},
|
|
1378
1627
|
free: t.#R,
|
|
1379
1628
|
isBackgroundFetch: e => t.#j(e),
|
|
1380
|
-
backgroundFetch: (e, s, i, n) => t
|
|
1629
|
+
backgroundFetch: (e, s, i, n) => t.#$(e, s, i, n),
|
|
1381
1630
|
moveToTail: e => t.#G(e),
|
|
1382
|
-
indexes: e => t
|
|
1631
|
+
indexes: e => t.#U(e),
|
|
1383
1632
|
rindexes: e => t.#H(e),
|
|
1384
|
-
isStale: e => t.#
|
|
1633
|
+
isStale: e => t.#Z(e)
|
|
1385
1634
|
};
|
|
1386
1635
|
}
|
|
1387
1636
|
get max() {
|
|
1388
1637
|
return this.#m;
|
|
1389
1638
|
}
|
|
1390
1639
|
get maxSize() {
|
|
1391
|
-
return this.#
|
|
1640
|
+
return this.#y;
|
|
1392
1641
|
}
|
|
1393
1642
|
get calculatedSize() {
|
|
1394
1643
|
return this.#E;
|
|
1395
1644
|
}
|
|
1396
1645
|
get size() {
|
|
1397
|
-
return this.#
|
|
1646
|
+
return this.#v;
|
|
1398
1647
|
}
|
|
1399
1648
|
get fetchMethod() {
|
|
1400
1649
|
return this.#k;
|
|
1401
1650
|
}
|
|
1402
1651
|
get memoMethod() {
|
|
1403
|
-
return this.#
|
|
1652
|
+
return this.#x;
|
|
1404
1653
|
}
|
|
1405
1654
|
get dispose() {
|
|
1406
|
-
return this.#
|
|
1655
|
+
return this.#w;
|
|
1407
1656
|
}
|
|
1408
1657
|
get onInsert() {
|
|
1409
1658
|
return this.#b;
|
|
@@ -1412,20 +1661,20 @@ class LRUCache {
|
|
|
1412
1661
|
return this.#S;
|
|
1413
1662
|
}
|
|
1414
1663
|
constructor(t) {
|
|
1415
|
-
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:
|
|
1416
|
-
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: y, memoMethod: w, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: S, allowStaleOnFetchRejection: k, allowStaleOnFetchAbort: x, ignoreFetchAbort: v} = t;
|
|
1665
|
+
if (e !== 0 && !isPosInt(e)) {
|
|
1417
1666
|
throw new TypeError("max option must be a nonnegative integer");
|
|
1418
1667
|
}
|
|
1419
|
-
const
|
|
1420
|
-
if (!
|
|
1668
|
+
const E = e ? getUintArray(e) : Array;
|
|
1669
|
+
if (!E) {
|
|
1421
1670
|
throw new Error("invalid max value: " + e);
|
|
1422
1671
|
}
|
|
1423
1672
|
this.#m = e;
|
|
1424
|
-
this.#
|
|
1425
|
-
this.maxEntrySize = p || this.#
|
|
1673
|
+
this.#y = d;
|
|
1674
|
+
this.maxEntrySize = p || this.#y;
|
|
1426
1675
|
this.sizeCalculation = g;
|
|
1427
1676
|
if (this.sizeCalculation) {
|
|
1428
|
-
if (!this.#
|
|
1677
|
+
if (!this.#y && !this.maxEntrySize) {
|
|
1429
1678
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1430
1679
|
}
|
|
1431
1680
|
if (typeof this.sizeCalculation !== "function") {
|
|
@@ -1435,77 +1684,77 @@ class LRUCache {
|
|
|
1435
1684
|
if (w !== undefined && typeof w !== "function") {
|
|
1436
1685
|
throw new TypeError("memoMethod must be a function if defined");
|
|
1437
1686
|
}
|
|
1438
|
-
this.#
|
|
1439
|
-
if (
|
|
1687
|
+
this.#x = w;
|
|
1688
|
+
if (y !== undefined && typeof y !== "function") {
|
|
1440
1689
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
1441
1690
|
}
|
|
1442
|
-
this.#k =
|
|
1443
|
-
this.#
|
|
1691
|
+
this.#k = y;
|
|
1692
|
+
this.#I = !!y;
|
|
1444
1693
|
this.#C = new Map;
|
|
1445
1694
|
this.#T = new Array(e).fill(undefined);
|
|
1446
|
-
this.#
|
|
1447
|
-
this.#
|
|
1448
|
-
this.#M = new
|
|
1695
|
+
this.#A = new Array(e).fill(undefined);
|
|
1696
|
+
this.#L = new E(e);
|
|
1697
|
+
this.#M = new E(e);
|
|
1449
1698
|
this.#P = 0;
|
|
1450
1699
|
this.#F = 0;
|
|
1451
1700
|
this.#R = Stack.create(e);
|
|
1452
|
-
this.#
|
|
1701
|
+
this.#v = 0;
|
|
1453
1702
|
this.#E = 0;
|
|
1454
1703
|
if (typeof a === "function") {
|
|
1455
|
-
this.#
|
|
1704
|
+
this.#w = a;
|
|
1456
1705
|
}
|
|
1457
1706
|
if (typeof l === "function") {
|
|
1458
1707
|
this.#b = l;
|
|
1459
1708
|
}
|
|
1460
1709
|
if (typeof c === "function") {
|
|
1461
1710
|
this.#S = c;
|
|
1462
|
-
this.#
|
|
1711
|
+
this.#O = [];
|
|
1463
1712
|
} else {
|
|
1464
1713
|
this.#S = undefined;
|
|
1465
|
-
this.#
|
|
1714
|
+
this.#O = undefined;
|
|
1466
1715
|
}
|
|
1467
|
-
this.#
|
|
1716
|
+
this.#N = !!this.#w;
|
|
1468
1717
|
this.#_ = !!this.#b;
|
|
1469
|
-
this.#
|
|
1718
|
+
this.#W = !!this.#S;
|
|
1470
1719
|
this.noDisposeOnSet = !!f;
|
|
1471
1720
|
this.noUpdateTTL = !!u;
|
|
1472
|
-
this.noDeleteOnFetchRejection = !!
|
|
1473
|
-
this.allowStaleOnFetchRejection = !!
|
|
1474
|
-
this.allowStaleOnFetchAbort = !!
|
|
1721
|
+
this.noDeleteOnFetchRejection = !!b;
|
|
1722
|
+
this.allowStaleOnFetchRejection = !!k;
|
|
1723
|
+
this.allowStaleOnFetchAbort = !!x;
|
|
1475
1724
|
this.ignoreFetchAbort = !!v;
|
|
1476
1725
|
if (this.maxEntrySize !== 0) {
|
|
1477
|
-
if (this.#
|
|
1478
|
-
if (!
|
|
1726
|
+
if (this.#y !== 0) {
|
|
1727
|
+
if (!isPosInt(this.#y)) {
|
|
1479
1728
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
1480
1729
|
}
|
|
1481
1730
|
}
|
|
1482
|
-
if (!
|
|
1731
|
+
if (!isPosInt(this.maxEntrySize)) {
|
|
1483
1732
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1484
1733
|
}
|
|
1485
|
-
this.#
|
|
1734
|
+
this.#q();
|
|
1486
1735
|
}
|
|
1487
1736
|
this.allowStale = !!h;
|
|
1488
|
-
this.noDeleteOnStaleGet = !!
|
|
1737
|
+
this.noDeleteOnStaleGet = !!S;
|
|
1489
1738
|
this.updateAgeOnGet = !!r;
|
|
1490
1739
|
this.updateAgeOnHas = !!o;
|
|
1491
|
-
this.ttlResolution =
|
|
1740
|
+
this.ttlResolution = isPosInt(i) || i === 0 ? i : 1;
|
|
1492
1741
|
this.ttlAutopurge = !!n;
|
|
1493
1742
|
this.ttl = s || 0;
|
|
1494
1743
|
if (this.ttl) {
|
|
1495
|
-
if (!
|
|
1744
|
+
if (!isPosInt(this.ttl)) {
|
|
1496
1745
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
1497
1746
|
}
|
|
1498
1747
|
this.#V();
|
|
1499
1748
|
}
|
|
1500
|
-
if (this.#m === 0 && this.ttl === 0 && this.#
|
|
1749
|
+
if (this.#m === 0 && this.ttl === 0 && this.#y === 0) {
|
|
1501
1750
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1502
1751
|
}
|
|
1503
|
-
if (!this.ttlAutopurge && !this.#m && !this.#
|
|
1752
|
+
if (!this.ttlAutopurge && !this.#m && !this.#y) {
|
|
1504
1753
|
const t = "LRU_CACHE_UNBOUNDED";
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
1754
|
+
if (shouldWarn(t)) {
|
|
1755
|
+
nt.add(t);
|
|
1507
1756
|
const e = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
|
1508
|
-
|
|
1757
|
+
emitWarning(e, "UnboundedCacheWarning", t, LRUCache);
|
|
1509
1758
|
}
|
|
1510
1759
|
}
|
|
1511
1760
|
}
|
|
@@ -1515,14 +1764,14 @@ class LRUCache {
|
|
|
1515
1764
|
#V() {
|
|
1516
1765
|
const t = new ZeroArray(this.#m);
|
|
1517
1766
|
const e = new ZeroArray(this.#m);
|
|
1518
|
-
this.#
|
|
1767
|
+
this.#B = t;
|
|
1519
1768
|
this.#D = e;
|
|
1520
|
-
this.#J = (s, i, n =
|
|
1769
|
+
this.#J = (s, i, n = it.now()) => {
|
|
1521
1770
|
e[s] = i !== 0 ? n : 0;
|
|
1522
1771
|
t[s] = i;
|
|
1523
1772
|
if (i !== 0 && this.ttlAutopurge) {
|
|
1524
1773
|
const t = setTimeout((() => {
|
|
1525
|
-
if (this.#
|
|
1774
|
+
if (this.#Z(s)) {
|
|
1526
1775
|
this.#K(this.#T[s], "expire");
|
|
1527
1776
|
}
|
|
1528
1777
|
}), i + 1);
|
|
@@ -1532,23 +1781,23 @@ class LRUCache {
|
|
|
1532
1781
|
}
|
|
1533
1782
|
};
|
|
1534
1783
|
this.#Y = s => {
|
|
1535
|
-
e[s] = t[s] !== 0 ?
|
|
1784
|
+
e[s] = t[s] !== 0 ? it.now() : 0;
|
|
1536
1785
|
};
|
|
1537
|
-
this.#X = (
|
|
1538
|
-
if (t[
|
|
1539
|
-
const
|
|
1540
|
-
const
|
|
1541
|
-
if (!
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1786
|
+
this.#X = (i, n) => {
|
|
1787
|
+
if (t[n]) {
|
|
1788
|
+
const r = t[n];
|
|
1789
|
+
const o = e[n];
|
|
1790
|
+
if (!r || !o) return;
|
|
1791
|
+
i.ttl = r;
|
|
1792
|
+
i.start = o;
|
|
1793
|
+
i.now = s || getNow();
|
|
1794
|
+
const h = i.now - o;
|
|
1795
|
+
i.remainingTTL = r - h;
|
|
1547
1796
|
}
|
|
1548
1797
|
};
|
|
1549
1798
|
let s = 0;
|
|
1550
|
-
const
|
|
1551
|
-
const t =
|
|
1799
|
+
const getNow = () => {
|
|
1800
|
+
const t = it.now();
|
|
1552
1801
|
if (this.ttlResolution > 0) {
|
|
1553
1802
|
s = t;
|
|
1554
1803
|
const e = setTimeout((() => s = 0), this.ttlResolution);
|
|
@@ -1558,33 +1807,33 @@ class LRUCache {
|
|
|
1558
1807
|
}
|
|
1559
1808
|
return t;
|
|
1560
1809
|
};
|
|
1561
|
-
this.getRemainingTTL =
|
|
1562
|
-
const
|
|
1563
|
-
if (
|
|
1810
|
+
this.getRemainingTTL = i => {
|
|
1811
|
+
const n = this.#C.get(i);
|
|
1812
|
+
if (n === undefined) {
|
|
1564
1813
|
return 0;
|
|
1565
1814
|
}
|
|
1566
|
-
const
|
|
1567
|
-
const
|
|
1568
|
-
if (!
|
|
1815
|
+
const r = t[n];
|
|
1816
|
+
const o = e[n];
|
|
1817
|
+
if (!r || !o) {
|
|
1569
1818
|
return Infinity;
|
|
1570
1819
|
}
|
|
1571
|
-
const
|
|
1572
|
-
return
|
|
1820
|
+
const h = (s || getNow()) - o;
|
|
1821
|
+
return r - h;
|
|
1573
1822
|
};
|
|
1574
|
-
this.#
|
|
1575
|
-
const
|
|
1576
|
-
const
|
|
1577
|
-
return !!
|
|
1823
|
+
this.#Z = i => {
|
|
1824
|
+
const n = e[i];
|
|
1825
|
+
const r = t[i];
|
|
1826
|
+
return !!r && !!n && (s || getNow()) - n > r;
|
|
1578
1827
|
};
|
|
1579
1828
|
}
|
|
1580
1829
|
#Y=() => {};
|
|
1581
1830
|
#X=() => {};
|
|
1582
1831
|
#J=() => {};
|
|
1583
|
-
#
|
|
1584
|
-
#
|
|
1832
|
+
#Z=() => false;
|
|
1833
|
+
#q() {
|
|
1585
1834
|
const t = new ZeroArray(this.#m);
|
|
1586
1835
|
this.#E = 0;
|
|
1587
|
-
this.#
|
|
1836
|
+
this.#z = t;
|
|
1588
1837
|
this.#Q = e => {
|
|
1589
1838
|
this.#E -= t[e];
|
|
1590
1839
|
t[e] = 0;
|
|
@@ -1593,13 +1842,13 @@ class LRUCache {
|
|
|
1593
1842
|
if (this.#j(e)) {
|
|
1594
1843
|
return 0;
|
|
1595
1844
|
}
|
|
1596
|
-
if (!
|
|
1845
|
+
if (!isPosInt(s)) {
|
|
1597
1846
|
if (i) {
|
|
1598
1847
|
if (typeof i !== "function") {
|
|
1599
1848
|
throw new TypeError("sizeCalculation must be a function");
|
|
1600
1849
|
}
|
|
1601
1850
|
s = i(e, t);
|
|
1602
|
-
if (!
|
|
1851
|
+
if (!isPosInt(s)) {
|
|
1603
1852
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1604
1853
|
}
|
|
1605
1854
|
} else {
|
|
@@ -1610,8 +1859,8 @@ class LRUCache {
|
|
|
1610
1859
|
};
|
|
1611
1860
|
this.#et = (e, s, i) => {
|
|
1612
1861
|
t[e] = s;
|
|
1613
|
-
if (this.#
|
|
1614
|
-
const s = this.#
|
|
1862
|
+
if (this.#y) {
|
|
1863
|
+
const s = this.#y - t[e];
|
|
1615
1864
|
while (this.#E > s) {
|
|
1616
1865
|
this.#st(true);
|
|
1617
1866
|
}
|
|
@@ -1631,13 +1880,13 @@ class LRUCache {
|
|
|
1631
1880
|
}
|
|
1632
1881
|
return 0;
|
|
1633
1882
|
};
|
|
1634
|
-
*
|
|
1635
|
-
if (this.#
|
|
1883
|
+
* #U({allowStale: t = this.allowStale} = {}) {
|
|
1884
|
+
if (this.#v) {
|
|
1636
1885
|
for (let e = this.#F; true; ) {
|
|
1637
1886
|
if (!this.#it(e)) {
|
|
1638
1887
|
break;
|
|
1639
1888
|
}
|
|
1640
|
-
if (t || !this.#
|
|
1889
|
+
if (t || !this.#Z(e)) {
|
|
1641
1890
|
yield e;
|
|
1642
1891
|
}
|
|
1643
1892
|
if (e === this.#P) {
|
|
@@ -1649,18 +1898,18 @@ class LRUCache {
|
|
|
1649
1898
|
}
|
|
1650
1899
|
}
|
|
1651
1900
|
* #H({allowStale: t = this.allowStale} = {}) {
|
|
1652
|
-
if (this.#
|
|
1901
|
+
if (this.#v) {
|
|
1653
1902
|
for (let e = this.#P; true; ) {
|
|
1654
1903
|
if (!this.#it(e)) {
|
|
1655
1904
|
break;
|
|
1656
1905
|
}
|
|
1657
|
-
if (t || !this.#
|
|
1906
|
+
if (t || !this.#Z(e)) {
|
|
1658
1907
|
yield e;
|
|
1659
1908
|
}
|
|
1660
1909
|
if (e === this.#F) {
|
|
1661
1910
|
break;
|
|
1662
1911
|
} else {
|
|
1663
|
-
e = this.#
|
|
1912
|
+
e = this.#L[e];
|
|
1664
1913
|
}
|
|
1665
1914
|
}
|
|
1666
1915
|
}
|
|
@@ -1669,23 +1918,23 @@ class LRUCache {
|
|
|
1669
1918
|
return t !== undefined && this.#C.get(this.#T[t]) === t;
|
|
1670
1919
|
}
|
|
1671
1920
|
* entries() {
|
|
1672
|
-
for (const t of this
|
|
1673
|
-
if (this.#
|
|
1674
|
-
yield [ this.#T[t], this.#
|
|
1921
|
+
for (const t of this.#U()) {
|
|
1922
|
+
if (this.#A[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#A[t])) {
|
|
1923
|
+
yield [ this.#T[t], this.#A[t] ];
|
|
1675
1924
|
}
|
|
1676
1925
|
}
|
|
1677
1926
|
}
|
|
1678
1927
|
* rentries() {
|
|
1679
1928
|
for (const t of this.#H()) {
|
|
1680
|
-
if (this.#
|
|
1681
|
-
yield [ this.#T[t], this.#
|
|
1929
|
+
if (this.#A[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#A[t])) {
|
|
1930
|
+
yield [ this.#T[t], this.#A[t] ];
|
|
1682
1931
|
}
|
|
1683
1932
|
}
|
|
1684
1933
|
}
|
|
1685
1934
|
* keys() {
|
|
1686
|
-
for (const t of this
|
|
1935
|
+
for (const t of this.#U()) {
|
|
1687
1936
|
const e = this.#T[t];
|
|
1688
|
-
if (e !== undefined && !this.#j(this.#
|
|
1937
|
+
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1689
1938
|
yield e;
|
|
1690
1939
|
}
|
|
1691
1940
|
}
|
|
@@ -1693,24 +1942,24 @@ class LRUCache {
|
|
|
1693
1942
|
* rkeys() {
|
|
1694
1943
|
for (const t of this.#H()) {
|
|
1695
1944
|
const e = this.#T[t];
|
|
1696
|
-
if (e !== undefined && !this.#j(this.#
|
|
1945
|
+
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1697
1946
|
yield e;
|
|
1698
1947
|
}
|
|
1699
1948
|
}
|
|
1700
1949
|
}
|
|
1701
1950
|
* values() {
|
|
1702
|
-
for (const t of this
|
|
1703
|
-
const e = this.#
|
|
1704
|
-
if (e !== undefined && !this.#j(this.#
|
|
1705
|
-
yield this.#
|
|
1951
|
+
for (const t of this.#U()) {
|
|
1952
|
+
const e = this.#A[t];
|
|
1953
|
+
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1954
|
+
yield this.#A[t];
|
|
1706
1955
|
}
|
|
1707
1956
|
}
|
|
1708
1957
|
}
|
|
1709
1958
|
* rvalues() {
|
|
1710
1959
|
for (const t of this.#H()) {
|
|
1711
|
-
const e = this.#
|
|
1712
|
-
if (e !== undefined && !this.#j(this.#
|
|
1713
|
-
yield this.#
|
|
1960
|
+
const e = this.#A[t];
|
|
1961
|
+
if (e !== undefined && !this.#j(this.#A[t])) {
|
|
1962
|
+
yield this.#A[t];
|
|
1714
1963
|
}
|
|
1715
1964
|
}
|
|
1716
1965
|
}
|
|
@@ -1719,8 +1968,8 @@ class LRUCache {
|
|
|
1719
1968
|
}
|
|
1720
1969
|
[Symbol.toStringTag]="LRUCache";
|
|
1721
1970
|
find(t, e = {}) {
|
|
1722
|
-
for (const s of this
|
|
1723
|
-
const i = this.#
|
|
1971
|
+
for (const s of this.#U()) {
|
|
1972
|
+
const i = this.#A[s];
|
|
1724
1973
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1725
1974
|
if (n === undefined) continue;
|
|
1726
1975
|
if (t(n, this.#T[s], this)) {
|
|
@@ -1729,8 +1978,8 @@ class LRUCache {
|
|
|
1729
1978
|
}
|
|
1730
1979
|
}
|
|
1731
1980
|
forEach(t, e = this) {
|
|
1732
|
-
for (const s of this
|
|
1733
|
-
const i = this.#
|
|
1981
|
+
for (const s of this.#U()) {
|
|
1982
|
+
const i = this.#A[s];
|
|
1734
1983
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1735
1984
|
if (n === undefined) continue;
|
|
1736
1985
|
t.call(e, n, this.#T[s], this);
|
|
@@ -1738,7 +1987,7 @@ class LRUCache {
|
|
|
1738
1987
|
}
|
|
1739
1988
|
rforEach(t, e = this) {
|
|
1740
1989
|
for (const s of this.#H()) {
|
|
1741
|
-
const i = this.#
|
|
1990
|
+
const i = this.#A[s];
|
|
1742
1991
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1743
1992
|
if (n === undefined) continue;
|
|
1744
1993
|
t.call(e, n, this.#T[s], this);
|
|
@@ -1749,7 +1998,7 @@ class LRUCache {
|
|
|
1749
1998
|
for (const e of this.#H({
|
|
1750
1999
|
allowStale: true
|
|
1751
2000
|
})) {
|
|
1752
|
-
if (this.#
|
|
2001
|
+
if (this.#Z(e)) {
|
|
1753
2002
|
this.#K(this.#T[e], "expire");
|
|
1754
2003
|
t = true;
|
|
1755
2004
|
}
|
|
@@ -1759,45 +2008,45 @@ class LRUCache {
|
|
|
1759
2008
|
info(t) {
|
|
1760
2009
|
const e = this.#C.get(t);
|
|
1761
2010
|
if (e === undefined) return undefined;
|
|
1762
|
-
const s = this.#
|
|
2011
|
+
const s = this.#A[e];
|
|
1763
2012
|
const i = this.#j(s) ? s.__staleWhileFetching : s;
|
|
1764
2013
|
if (i === undefined) return undefined;
|
|
1765
2014
|
const n = {
|
|
1766
2015
|
value: i
|
|
1767
2016
|
};
|
|
1768
|
-
if (this.#
|
|
1769
|
-
const t = this.#
|
|
2017
|
+
if (this.#B && this.#D) {
|
|
2018
|
+
const t = this.#B[e];
|
|
1770
2019
|
const s = this.#D[e];
|
|
1771
2020
|
if (t && s) {
|
|
1772
|
-
const e = t - (
|
|
2021
|
+
const e = t - (it.now() - s);
|
|
1773
2022
|
n.ttl = e;
|
|
1774
2023
|
n.start = Date.now();
|
|
1775
2024
|
}
|
|
1776
2025
|
}
|
|
1777
|
-
if (this.#
|
|
1778
|
-
n.size = this.#
|
|
2026
|
+
if (this.#z) {
|
|
2027
|
+
n.size = this.#z[e];
|
|
1779
2028
|
}
|
|
1780
2029
|
return n;
|
|
1781
2030
|
}
|
|
1782
2031
|
dump() {
|
|
1783
2032
|
const t = [];
|
|
1784
|
-
for (const e of this
|
|
2033
|
+
for (const e of this.#U({
|
|
1785
2034
|
allowStale: true
|
|
1786
2035
|
})) {
|
|
1787
2036
|
const s = this.#T[e];
|
|
1788
|
-
const i = this.#
|
|
2037
|
+
const i = this.#A[e];
|
|
1789
2038
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1790
2039
|
if (n === undefined || s === undefined) continue;
|
|
1791
2040
|
const r = {
|
|
1792
2041
|
value: n
|
|
1793
2042
|
};
|
|
1794
|
-
if (this.#
|
|
1795
|
-
r.ttl = this.#
|
|
1796
|
-
const t =
|
|
2043
|
+
if (this.#B && this.#D) {
|
|
2044
|
+
r.ttl = this.#B[e];
|
|
2045
|
+
const t = it.now() - this.#D[e];
|
|
1797
2046
|
r.start = Math.floor(Date.now() - t);
|
|
1798
2047
|
}
|
|
1799
|
-
if (this.#
|
|
1800
|
-
r.size = this.#
|
|
2048
|
+
if (this.#z) {
|
|
2049
|
+
r.size = this.#z[e];
|
|
1801
2050
|
}
|
|
1802
2051
|
t.unshift([ s, r ]);
|
|
1803
2052
|
}
|
|
@@ -1808,7 +2057,7 @@ class LRUCache {
|
|
|
1808
2057
|
for (const [e, s] of t) {
|
|
1809
2058
|
if (s.start) {
|
|
1810
2059
|
const t = Date.now() - s.start;
|
|
1811
|
-
s.start =
|
|
2060
|
+
s.start = it.now() - t;
|
|
1812
2061
|
}
|
|
1813
2062
|
this.set(e, s.value, s);
|
|
1814
2063
|
}
|
|
@@ -1829,16 +2078,16 @@ class LRUCache {
|
|
|
1829
2078
|
this.#K(t, "set");
|
|
1830
2079
|
return this;
|
|
1831
2080
|
}
|
|
1832
|
-
let c = this.#
|
|
2081
|
+
let c = this.#v === 0 ? undefined : this.#C.get(t);
|
|
1833
2082
|
if (c === undefined) {
|
|
1834
|
-
c = this.#
|
|
2083
|
+
c = this.#v === 0 ? this.#F : this.#R.length !== 0 ? this.#R.pop() : this.#v === this.#m ? this.#st(false) : this.#v;
|
|
1835
2084
|
this.#T[c] = t;
|
|
1836
|
-
this.#
|
|
2085
|
+
this.#A[c] = e;
|
|
1837
2086
|
this.#C.set(t, c);
|
|
1838
|
-
this.#
|
|
2087
|
+
this.#L[this.#F] = c;
|
|
1839
2088
|
this.#M[c] = this.#F;
|
|
1840
2089
|
this.#F = c;
|
|
1841
|
-
this.#
|
|
2090
|
+
this.#v++;
|
|
1842
2091
|
this.#et(c, l, h);
|
|
1843
2092
|
if (h) h.set = "add";
|
|
1844
2093
|
a = false;
|
|
@@ -1847,30 +2096,30 @@ class LRUCache {
|
|
|
1847
2096
|
}
|
|
1848
2097
|
} else {
|
|
1849
2098
|
this.#G(c);
|
|
1850
|
-
const s = this.#
|
|
2099
|
+
const s = this.#A[c];
|
|
1851
2100
|
if (e !== s) {
|
|
1852
|
-
if (this.#
|
|
2101
|
+
if (this.#I && this.#j(s)) {
|
|
1853
2102
|
s.__abortController.abort(new Error("replaced"));
|
|
1854
2103
|
const {__staleWhileFetching: e} = s;
|
|
1855
2104
|
if (e !== undefined && !r) {
|
|
1856
|
-
if (this.#
|
|
1857
|
-
this.#
|
|
2105
|
+
if (this.#N) {
|
|
2106
|
+
this.#w?.(e, t, "set");
|
|
1858
2107
|
}
|
|
1859
|
-
if (this.#
|
|
1860
|
-
this.#
|
|
2108
|
+
if (this.#W) {
|
|
2109
|
+
this.#O?.push([ e, t, "set" ]);
|
|
1861
2110
|
}
|
|
1862
2111
|
}
|
|
1863
2112
|
} else if (!r) {
|
|
1864
|
-
if (this.#
|
|
1865
|
-
this.#
|
|
2113
|
+
if (this.#N) {
|
|
2114
|
+
this.#w?.(s, t, "set");
|
|
1866
2115
|
}
|
|
1867
|
-
if (this.#
|
|
1868
|
-
this.#
|
|
2116
|
+
if (this.#W) {
|
|
2117
|
+
this.#O?.push([ s, t, "set" ]);
|
|
1869
2118
|
}
|
|
1870
2119
|
}
|
|
1871
2120
|
this.#Q(c);
|
|
1872
2121
|
this.#et(c, l, h);
|
|
1873
|
-
this.#
|
|
2122
|
+
this.#A[c] = e;
|
|
1874
2123
|
if (h) {
|
|
1875
2124
|
h.set = "replace";
|
|
1876
2125
|
const t = s && this.#j(s) ? s.__staleWhileFetching : s;
|
|
@@ -1883,17 +2132,17 @@ class LRUCache {
|
|
|
1883
2132
|
this.onInsert?.(e, t, e === s ? "update" : "replace");
|
|
1884
2133
|
}
|
|
1885
2134
|
}
|
|
1886
|
-
if (i !== 0 && !this.#
|
|
2135
|
+
if (i !== 0 && !this.#B) {
|
|
1887
2136
|
this.#V();
|
|
1888
2137
|
}
|
|
1889
|
-
if (this.#
|
|
2138
|
+
if (this.#B) {
|
|
1890
2139
|
if (!a) {
|
|
1891
2140
|
this.#J(c, i, n);
|
|
1892
2141
|
}
|
|
1893
2142
|
if (h) this.#X(h, c);
|
|
1894
2143
|
}
|
|
1895
|
-
if (!r && this.#
|
|
1896
|
-
const t = this.#
|
|
2144
|
+
if (!r && this.#W && this.#O) {
|
|
2145
|
+
const t = this.#O;
|
|
1897
2146
|
let e;
|
|
1898
2147
|
while (e = t?.shift()) {
|
|
1899
2148
|
this.#S?.(...e);
|
|
@@ -1903,8 +2152,8 @@ class LRUCache {
|
|
|
1903
2152
|
}
|
|
1904
2153
|
pop() {
|
|
1905
2154
|
try {
|
|
1906
|
-
while (this.#
|
|
1907
|
-
const t = this.#
|
|
2155
|
+
while (this.#v) {
|
|
2156
|
+
const t = this.#A[this.#P];
|
|
1908
2157
|
this.#st(true);
|
|
1909
2158
|
if (this.#j(t)) {
|
|
1910
2159
|
if (t.__staleWhileFetching) {
|
|
@@ -1915,8 +2164,8 @@ class LRUCache {
|
|
|
1915
2164
|
}
|
|
1916
2165
|
}
|
|
1917
2166
|
} finally {
|
|
1918
|
-
if (this.#
|
|
1919
|
-
const t = this.#
|
|
2167
|
+
if (this.#W && this.#O) {
|
|
2168
|
+
const t = this.#O;
|
|
1920
2169
|
let e;
|
|
1921
2170
|
while (e = t?.shift()) {
|
|
1922
2171
|
this.#S?.(...e);
|
|
@@ -1927,42 +2176,42 @@ class LRUCache {
|
|
|
1927
2176
|
#st(t) {
|
|
1928
2177
|
const e = this.#P;
|
|
1929
2178
|
const s = this.#T[e];
|
|
1930
|
-
const i = this.#
|
|
1931
|
-
if (this.#
|
|
2179
|
+
const i = this.#A[e];
|
|
2180
|
+
if (this.#I && this.#j(i)) {
|
|
1932
2181
|
i.__abortController.abort(new Error("evicted"));
|
|
1933
|
-
} else if (this.#
|
|
1934
|
-
if (this.#
|
|
1935
|
-
this.#
|
|
2182
|
+
} else if (this.#N || this.#W) {
|
|
2183
|
+
if (this.#N) {
|
|
2184
|
+
this.#w?.(i, s, "evict");
|
|
1936
2185
|
}
|
|
1937
|
-
if (this.#
|
|
1938
|
-
this.#
|
|
2186
|
+
if (this.#W) {
|
|
2187
|
+
this.#O?.push([ i, s, "evict" ]);
|
|
1939
2188
|
}
|
|
1940
2189
|
}
|
|
1941
2190
|
this.#Q(e);
|
|
1942
2191
|
if (t) {
|
|
1943
2192
|
this.#T[e] = undefined;
|
|
1944
|
-
this.#
|
|
2193
|
+
this.#A[e] = undefined;
|
|
1945
2194
|
this.#R.push(e);
|
|
1946
2195
|
}
|
|
1947
|
-
if (this.#
|
|
2196
|
+
if (this.#v === 1) {
|
|
1948
2197
|
this.#P = this.#F = 0;
|
|
1949
2198
|
this.#R.length = 0;
|
|
1950
2199
|
} else {
|
|
1951
|
-
this.#P = this.#
|
|
2200
|
+
this.#P = this.#L[e];
|
|
1952
2201
|
}
|
|
1953
2202
|
this.#C.delete(s);
|
|
1954
|
-
this.#
|
|
2203
|
+
this.#v--;
|
|
1955
2204
|
return e;
|
|
1956
2205
|
}
|
|
1957
2206
|
has(t, e = {}) {
|
|
1958
2207
|
const {updateAgeOnHas: s = this.updateAgeOnHas, status: i} = e;
|
|
1959
2208
|
const n = this.#C.get(t);
|
|
1960
2209
|
if (n !== undefined) {
|
|
1961
|
-
const t = this.#
|
|
2210
|
+
const t = this.#A[n];
|
|
1962
2211
|
if (this.#j(t) && t.__staleWhileFetching === undefined) {
|
|
1963
2212
|
return false;
|
|
1964
2213
|
}
|
|
1965
|
-
if (!this.#
|
|
2214
|
+
if (!this.#Z(n)) {
|
|
1966
2215
|
if (s) {
|
|
1967
2216
|
this.#Y(n);
|
|
1968
2217
|
}
|
|
@@ -1983,18 +2232,18 @@ class LRUCache {
|
|
|
1983
2232
|
peek(t, e = {}) {
|
|
1984
2233
|
const {allowStale: s = this.allowStale} = e;
|
|
1985
2234
|
const i = this.#C.get(t);
|
|
1986
|
-
if (i === undefined || !s && this.#
|
|
2235
|
+
if (i === undefined || !s && this.#Z(i)) {
|
|
1987
2236
|
return;
|
|
1988
2237
|
}
|
|
1989
|
-
const n = this.#
|
|
2238
|
+
const n = this.#A[i];
|
|
1990
2239
|
return this.#j(n) ? n.__staleWhileFetching : n;
|
|
1991
2240
|
}
|
|
1992
|
-
|
|
1993
|
-
const n = e === undefined ? undefined : this.#
|
|
2241
|
+
#$(t, e, s, i) {
|
|
2242
|
+
const n = e === undefined ? undefined : this.#A[e];
|
|
1994
2243
|
if (this.#j(n)) {
|
|
1995
2244
|
return n;
|
|
1996
2245
|
}
|
|
1997
|
-
const r = new
|
|
2246
|
+
const r = new ot;
|
|
1998
2247
|
const {signal: o} = s;
|
|
1999
2248
|
o?.addEventListener("abort", (() => r.abort(o.reason)), {
|
|
2000
2249
|
signal: r.signal
|
|
@@ -2004,26 +2253,26 @@ class LRUCache {
|
|
|
2004
2253
|
options: s,
|
|
2005
2254
|
context: i
|
|
2006
2255
|
};
|
|
2007
|
-
const
|
|
2256
|
+
const cb = (i, n = false) => {
|
|
2008
2257
|
const {aborted: o} = r.signal;
|
|
2009
|
-
const
|
|
2258
|
+
const l = s.ignoreFetchAbort && i !== undefined;
|
|
2010
2259
|
if (s.status) {
|
|
2011
2260
|
if (o && !n) {
|
|
2012
2261
|
s.status.fetchAborted = true;
|
|
2013
2262
|
s.status.fetchError = r.signal.reason;
|
|
2014
|
-
if (
|
|
2263
|
+
if (l) s.status.fetchAbortIgnored = true;
|
|
2015
2264
|
} else {
|
|
2016
2265
|
s.status.fetchResolved = true;
|
|
2017
2266
|
}
|
|
2018
2267
|
}
|
|
2019
|
-
if (o && !
|
|
2020
|
-
return
|
|
2268
|
+
if (o && !l && !n) {
|
|
2269
|
+
return fetchFail(r.signal.reason);
|
|
2021
2270
|
}
|
|
2022
|
-
const
|
|
2023
|
-
if (this.#
|
|
2271
|
+
const c = a;
|
|
2272
|
+
if (this.#A[e] === a) {
|
|
2024
2273
|
if (i === undefined) {
|
|
2025
|
-
if (
|
|
2026
|
-
this.#
|
|
2274
|
+
if (c.__staleWhileFetching) {
|
|
2275
|
+
this.#A[e] = c.__staleWhileFetching;
|
|
2027
2276
|
} else {
|
|
2028
2277
|
this.#K(t, "fetch");
|
|
2029
2278
|
}
|
|
@@ -2034,37 +2283,37 @@ class LRUCache {
|
|
|
2034
2283
|
}
|
|
2035
2284
|
return i;
|
|
2036
2285
|
};
|
|
2037
|
-
const
|
|
2286
|
+
const eb = t => {
|
|
2038
2287
|
if (s.status) {
|
|
2039
2288
|
s.status.fetchRejected = true;
|
|
2040
2289
|
s.status.fetchError = t;
|
|
2041
2290
|
}
|
|
2042
|
-
return
|
|
2291
|
+
return fetchFail(t);
|
|
2043
2292
|
};
|
|
2044
|
-
const
|
|
2293
|
+
const fetchFail = i => {
|
|
2045
2294
|
const {aborted: n} = r.signal;
|
|
2046
2295
|
const o = n && s.allowStaleOnFetchAbort;
|
|
2047
2296
|
const h = o || s.allowStaleOnFetchRejection;
|
|
2048
|
-
const
|
|
2049
|
-
const
|
|
2050
|
-
if (this.#
|
|
2051
|
-
const s = !
|
|
2297
|
+
const l = h || s.noDeleteOnFetchRejection;
|
|
2298
|
+
const c = a;
|
|
2299
|
+
if (this.#A[e] === a) {
|
|
2300
|
+
const s = !l || c.__staleWhileFetching === undefined;
|
|
2052
2301
|
if (s) {
|
|
2053
2302
|
this.#K(t, "fetch");
|
|
2054
2303
|
} else if (!o) {
|
|
2055
|
-
this.#
|
|
2304
|
+
this.#A[e] = c.__staleWhileFetching;
|
|
2056
2305
|
}
|
|
2057
2306
|
}
|
|
2058
2307
|
if (h) {
|
|
2059
|
-
if (s.status &&
|
|
2308
|
+
if (s.status && c.__staleWhileFetching !== undefined) {
|
|
2060
2309
|
s.status.returnedStale = true;
|
|
2061
2310
|
}
|
|
2062
|
-
return
|
|
2063
|
-
} else if (
|
|
2311
|
+
return c.__staleWhileFetching;
|
|
2312
|
+
} else if (c.__returned === c) {
|
|
2064
2313
|
throw i;
|
|
2065
2314
|
}
|
|
2066
2315
|
};
|
|
2067
|
-
const
|
|
2316
|
+
const pcall = (e, i) => {
|
|
2068
2317
|
const o = this.#k?.(t, n, h);
|
|
2069
2318
|
if (o && o instanceof Promise) {
|
|
2070
2319
|
o.then((t => e(t === undefined ? undefined : t)), i);
|
|
@@ -2073,46 +2322,46 @@ class LRUCache {
|
|
|
2073
2322
|
if (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) {
|
|
2074
2323
|
e(undefined);
|
|
2075
2324
|
if (s.allowStaleOnFetchAbort) {
|
|
2076
|
-
e = t =>
|
|
2325
|
+
e = t => cb(t, true);
|
|
2077
2326
|
}
|
|
2078
2327
|
}
|
|
2079
2328
|
}));
|
|
2080
2329
|
};
|
|
2081
2330
|
if (s.status) s.status.fetchDispatched = true;
|
|
2082
|
-
const
|
|
2083
|
-
const
|
|
2331
|
+
const a = new Promise(pcall).then(cb, eb);
|
|
2332
|
+
const l = Object.assign(a, {
|
|
2084
2333
|
__abortController: r,
|
|
2085
2334
|
__staleWhileFetching: n,
|
|
2086
2335
|
__returned: undefined
|
|
2087
2336
|
});
|
|
2088
2337
|
if (e === undefined) {
|
|
2089
|
-
this.set(t,
|
|
2338
|
+
this.set(t, l, {
|
|
2090
2339
|
...h.options,
|
|
2091
2340
|
status: undefined
|
|
2092
2341
|
});
|
|
2093
2342
|
e = this.#C.get(t);
|
|
2094
2343
|
} else {
|
|
2095
|
-
this.#
|
|
2344
|
+
this.#A[e] = l;
|
|
2096
2345
|
}
|
|
2097
|
-
return
|
|
2346
|
+
return l;
|
|
2098
2347
|
}
|
|
2099
2348
|
#j(t) {
|
|
2100
|
-
if (!this.#
|
|
2349
|
+
if (!this.#I) return false;
|
|
2101
2350
|
const e = t;
|
|
2102
|
-
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof
|
|
2351
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof ot;
|
|
2103
2352
|
}
|
|
2104
2353
|
async fetch(t, e = {}) {
|
|
2105
|
-
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:
|
|
2106
|
-
if (!this.#
|
|
2107
|
-
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: y, signal: w} = e;
|
|
2355
|
+
if (!this.#I) {
|
|
2356
|
+
if (y) y.fetch = "get";
|
|
2108
2357
|
return this.get(t, {
|
|
2109
2358
|
allowStale: s,
|
|
2110
2359
|
updateAgeOnGet: i,
|
|
2111
2360
|
noDeleteOnStaleGet: n,
|
|
2112
|
-
status:
|
|
2361
|
+
status: y
|
|
2113
2362
|
});
|
|
2114
2363
|
}
|
|
2115
|
-
const
|
|
2364
|
+
const b = {
|
|
2116
2365
|
allowStale: s,
|
|
2117
2366
|
updateAgeOnGet: i,
|
|
2118
2367
|
noDeleteOnStaleGet: n,
|
|
@@ -2125,40 +2374,40 @@ class LRUCache {
|
|
|
2125
2374
|
allowStaleOnFetchRejection: f,
|
|
2126
2375
|
allowStaleOnFetchAbort: d,
|
|
2127
2376
|
ignoreFetchAbort: u,
|
|
2128
|
-
status:
|
|
2377
|
+
status: y,
|
|
2129
2378
|
signal: w
|
|
2130
2379
|
};
|
|
2131
|
-
let
|
|
2132
|
-
if (
|
|
2133
|
-
if (
|
|
2134
|
-
const e = this
|
|
2380
|
+
let S = this.#C.get(t);
|
|
2381
|
+
if (S === undefined) {
|
|
2382
|
+
if (y) y.fetch = "miss";
|
|
2383
|
+
const e = this.#$(t, S, b, p);
|
|
2135
2384
|
return e.__returned = e;
|
|
2136
2385
|
} else {
|
|
2137
|
-
const e = this.#
|
|
2386
|
+
const e = this.#A[S];
|
|
2138
2387
|
if (this.#j(e)) {
|
|
2139
2388
|
const t = s && e.__staleWhileFetching !== undefined;
|
|
2140
|
-
if (
|
|
2141
|
-
|
|
2142
|
-
if (t)
|
|
2389
|
+
if (y) {
|
|
2390
|
+
y.fetch = "inflight";
|
|
2391
|
+
if (t) y.returnedStale = true;
|
|
2143
2392
|
}
|
|
2144
2393
|
return t ? e.__staleWhileFetching : e.__returned = e;
|
|
2145
2394
|
}
|
|
2146
|
-
const n = this.#
|
|
2395
|
+
const n = this.#Z(S);
|
|
2147
2396
|
if (!g && !n) {
|
|
2148
|
-
if (
|
|
2149
|
-
this.#G(
|
|
2397
|
+
if (y) y.fetch = "hit";
|
|
2398
|
+
this.#G(S);
|
|
2150
2399
|
if (i) {
|
|
2151
|
-
this.#Y(
|
|
2400
|
+
this.#Y(S);
|
|
2152
2401
|
}
|
|
2153
|
-
if (
|
|
2402
|
+
if (y) this.#X(y, S);
|
|
2154
2403
|
return e;
|
|
2155
2404
|
}
|
|
2156
|
-
const r = this
|
|
2405
|
+
const r = this.#$(t, S, b, p);
|
|
2157
2406
|
const o = r.__staleWhileFetching !== undefined;
|
|
2158
2407
|
const h = o && s;
|
|
2159
|
-
if (
|
|
2160
|
-
|
|
2161
|
-
if (h && n)
|
|
2408
|
+
if (y) {
|
|
2409
|
+
y.fetch = n ? "stale" : "refresh";
|
|
2410
|
+
if (h && n) y.returnedStale = true;
|
|
2162
2411
|
}
|
|
2163
2412
|
return h ? r.__staleWhileFetching : r.__returned = r;
|
|
2164
2413
|
}
|
|
@@ -2169,7 +2418,7 @@ class LRUCache {
|
|
|
2169
2418
|
return s;
|
|
2170
2419
|
}
|
|
2171
2420
|
memo(t, e = {}) {
|
|
2172
|
-
const s = this.#
|
|
2421
|
+
const s = this.#x;
|
|
2173
2422
|
if (!s) {
|
|
2174
2423
|
throw new Error("no memoMethod provided to constructor");
|
|
2175
2424
|
}
|
|
@@ -2187,10 +2436,10 @@ class LRUCache {
|
|
|
2187
2436
|
const {allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r} = e;
|
|
2188
2437
|
const o = this.#C.get(t);
|
|
2189
2438
|
if (o !== undefined) {
|
|
2190
|
-
const e = this.#
|
|
2439
|
+
const e = this.#A[o];
|
|
2191
2440
|
const h = this.#j(e);
|
|
2192
2441
|
if (r) this.#X(r, o);
|
|
2193
|
-
if (this.#
|
|
2442
|
+
if (this.#Z(o)) {
|
|
2194
2443
|
if (r) r.get = "stale";
|
|
2195
2444
|
if (!h) {
|
|
2196
2445
|
if (!n) {
|
|
@@ -2221,14 +2470,14 @@ class LRUCache {
|
|
|
2221
2470
|
}
|
|
2222
2471
|
#nt(t, e) {
|
|
2223
2472
|
this.#M[e] = t;
|
|
2224
|
-
this.#
|
|
2473
|
+
this.#L[t] = e;
|
|
2225
2474
|
}
|
|
2226
2475
|
#G(t) {
|
|
2227
2476
|
if (t !== this.#F) {
|
|
2228
2477
|
if (t === this.#P) {
|
|
2229
|
-
this.#P = this.#
|
|
2478
|
+
this.#P = this.#L[t];
|
|
2230
2479
|
} else {
|
|
2231
|
-
this.#nt(this.#M[t], this.#
|
|
2480
|
+
this.#nt(this.#M[t], this.#L[t]);
|
|
2232
2481
|
}
|
|
2233
2482
|
this.#nt(this.#F, t);
|
|
2234
2483
|
this.#F = t;
|
|
@@ -2239,45 +2488,45 @@ class LRUCache {
|
|
|
2239
2488
|
}
|
|
2240
2489
|
#K(t, e) {
|
|
2241
2490
|
let s = false;
|
|
2242
|
-
if (this.#
|
|
2491
|
+
if (this.#v !== 0) {
|
|
2243
2492
|
const i = this.#C.get(t);
|
|
2244
2493
|
if (i !== undefined) {
|
|
2245
2494
|
s = true;
|
|
2246
|
-
if (this.#
|
|
2495
|
+
if (this.#v === 1) {
|
|
2247
2496
|
this.#rt(e);
|
|
2248
2497
|
} else {
|
|
2249
2498
|
this.#Q(i);
|
|
2250
|
-
const s = this.#
|
|
2499
|
+
const s = this.#A[i];
|
|
2251
2500
|
if (this.#j(s)) {
|
|
2252
2501
|
s.__abortController.abort(new Error("deleted"));
|
|
2253
|
-
} else if (this.#
|
|
2254
|
-
if (this.#
|
|
2255
|
-
this.#
|
|
2502
|
+
} else if (this.#N || this.#W) {
|
|
2503
|
+
if (this.#N) {
|
|
2504
|
+
this.#w?.(s, t, e);
|
|
2256
2505
|
}
|
|
2257
|
-
if (this.#
|
|
2258
|
-
this.#
|
|
2506
|
+
if (this.#W) {
|
|
2507
|
+
this.#O?.push([ s, t, e ]);
|
|
2259
2508
|
}
|
|
2260
2509
|
}
|
|
2261
2510
|
this.#C.delete(t);
|
|
2262
2511
|
this.#T[i] = undefined;
|
|
2263
|
-
this.#
|
|
2512
|
+
this.#A[i] = undefined;
|
|
2264
2513
|
if (i === this.#F) {
|
|
2265
2514
|
this.#F = this.#M[i];
|
|
2266
2515
|
} else if (i === this.#P) {
|
|
2267
|
-
this.#P = this.#
|
|
2516
|
+
this.#P = this.#L[i];
|
|
2268
2517
|
} else {
|
|
2269
2518
|
const t = this.#M[i];
|
|
2270
|
-
this.#
|
|
2271
|
-
const e = this.#
|
|
2519
|
+
this.#L[t] = this.#L[i];
|
|
2520
|
+
const e = this.#L[i];
|
|
2272
2521
|
this.#M[e] = this.#M[i];
|
|
2273
2522
|
}
|
|
2274
|
-
this.#
|
|
2523
|
+
this.#v--;
|
|
2275
2524
|
this.#R.push(i);
|
|
2276
2525
|
}
|
|
2277
2526
|
}
|
|
2278
2527
|
}
|
|
2279
|
-
if (this.#
|
|
2280
|
-
const t = this.#
|
|
2528
|
+
if (this.#W && this.#O?.length) {
|
|
2529
|
+
const t = this.#O;
|
|
2281
2530
|
let e;
|
|
2282
2531
|
while (e = t?.shift()) {
|
|
2283
2532
|
this.#S?.(...e);
|
|
@@ -2292,36 +2541,36 @@ class LRUCache {
|
|
|
2292
2541
|
for (const e of this.#H({
|
|
2293
2542
|
allowStale: true
|
|
2294
2543
|
})) {
|
|
2295
|
-
const s = this.#
|
|
2544
|
+
const s = this.#A[e];
|
|
2296
2545
|
if (this.#j(s)) {
|
|
2297
2546
|
s.__abortController.abort(new Error("deleted"));
|
|
2298
2547
|
} else {
|
|
2299
2548
|
const i = this.#T[e];
|
|
2300
|
-
if (this.#
|
|
2301
|
-
this.#
|
|
2549
|
+
if (this.#N) {
|
|
2550
|
+
this.#w?.(s, i, t);
|
|
2302
2551
|
}
|
|
2303
|
-
if (this.#
|
|
2304
|
-
this.#
|
|
2552
|
+
if (this.#W) {
|
|
2553
|
+
this.#O?.push([ s, i, t ]);
|
|
2305
2554
|
}
|
|
2306
2555
|
}
|
|
2307
2556
|
}
|
|
2308
2557
|
this.#C.clear();
|
|
2309
|
-
this.#
|
|
2558
|
+
this.#A.fill(undefined);
|
|
2310
2559
|
this.#T.fill(undefined);
|
|
2311
|
-
if (this.#
|
|
2312
|
-
this.#
|
|
2560
|
+
if (this.#B && this.#D) {
|
|
2561
|
+
this.#B.fill(0);
|
|
2313
2562
|
this.#D.fill(0);
|
|
2314
2563
|
}
|
|
2315
|
-
if (this.#
|
|
2316
|
-
this.#
|
|
2564
|
+
if (this.#z) {
|
|
2565
|
+
this.#z.fill(0);
|
|
2317
2566
|
}
|
|
2318
2567
|
this.#P = 0;
|
|
2319
2568
|
this.#F = 0;
|
|
2320
2569
|
this.#R.length = 0;
|
|
2321
2570
|
this.#E = 0;
|
|
2322
|
-
this.#
|
|
2323
|
-
if (this.#
|
|
2324
|
-
const t = this.#
|
|
2571
|
+
this.#v = 0;
|
|
2572
|
+
if (this.#W && this.#O) {
|
|
2573
|
+
const t = this.#O;
|
|
2325
2574
|
let e;
|
|
2326
2575
|
while (e = t?.shift()) {
|
|
2327
2576
|
this.#S?.(...e);
|
|
@@ -2330,88 +2579,88 @@ class LRUCache {
|
|
|
2330
2579
|
}
|
|
2331
2580
|
}
|
|
2332
2581
|
|
|
2333
|
-
const
|
|
2582
|
+
const lt = typeof process === "object" && process ? process : {
|
|
2334
2583
|
stdout: null,
|
|
2335
2584
|
stderr: null
|
|
2336
2585
|
};
|
|
2337
2586
|
|
|
2338
|
-
const
|
|
2587
|
+
const isStream = t => !!t && typeof t === "object" && (t instanceof Minipass || t instanceof p || isReadable(t) || isWritable(t));
|
|
2339
2588
|
|
|
2340
|
-
const
|
|
2589
|
+
const isReadable = t => !!t && typeof t === "object" && t instanceof d && typeof t.pipe === "function" && t.pipe !== p.Writable.prototype.pipe;
|
|
2341
2590
|
|
|
2342
|
-
const
|
|
2591
|
+
const isWritable = t => !!t && typeof t === "object" && t instanceof d && typeof t.write === "function" && typeof t.end === "function";
|
|
2343
2592
|
|
|
2344
|
-
const
|
|
2593
|
+
const ct = Symbol("EOF");
|
|
2345
2594
|
|
|
2346
|
-
const
|
|
2595
|
+
const ft = Symbol("maybeEmitEnd");
|
|
2347
2596
|
|
|
2348
|
-
const
|
|
2597
|
+
const ut = Symbol("emittedEnd");
|
|
2349
2598
|
|
|
2350
|
-
const
|
|
2599
|
+
const dt = Symbol("emittingEnd");
|
|
2351
2600
|
|
|
2352
|
-
const
|
|
2601
|
+
const pt = Symbol("emittedError");
|
|
2353
2602
|
|
|
2354
|
-
const
|
|
2603
|
+
const gt = Symbol("closed");
|
|
2355
2604
|
|
|
2356
|
-
const
|
|
2605
|
+
const mt = Symbol("read");
|
|
2357
2606
|
|
|
2358
|
-
const
|
|
2607
|
+
const yt = Symbol("flush");
|
|
2359
2608
|
|
|
2360
|
-
const
|
|
2609
|
+
const wt = Symbol("flushChunk");
|
|
2361
2610
|
|
|
2362
|
-
const
|
|
2611
|
+
const bt = Symbol("encoding");
|
|
2363
2612
|
|
|
2364
|
-
const
|
|
2613
|
+
const St = Symbol("decoder");
|
|
2365
2614
|
|
|
2366
|
-
const
|
|
2615
|
+
const kt = Symbol("flowing");
|
|
2367
2616
|
|
|
2368
|
-
const
|
|
2617
|
+
const xt = Symbol("paused");
|
|
2369
2618
|
|
|
2370
|
-
const
|
|
2619
|
+
const vt = Symbol("resume");
|
|
2371
2620
|
|
|
2372
|
-
const
|
|
2621
|
+
const Et = Symbol("buffer");
|
|
2373
2622
|
|
|
2374
|
-
const
|
|
2623
|
+
const Ct = Symbol("pipes");
|
|
2375
2624
|
|
|
2376
|
-
const
|
|
2625
|
+
const Tt = Symbol("bufferLength");
|
|
2377
2626
|
|
|
2378
|
-
const
|
|
2627
|
+
const At = Symbol("bufferPush");
|
|
2379
2628
|
|
|
2380
|
-
const
|
|
2629
|
+
const Lt = Symbol("bufferShift");
|
|
2381
2630
|
|
|
2382
|
-
const
|
|
2631
|
+
const Mt = Symbol("objectMode");
|
|
2383
2632
|
|
|
2384
|
-
const
|
|
2633
|
+
const Pt = Symbol("destroyed");
|
|
2385
2634
|
|
|
2386
|
-
const
|
|
2635
|
+
const Ft = Symbol("error");
|
|
2387
2636
|
|
|
2388
|
-
const
|
|
2637
|
+
const Rt = Symbol("emitData");
|
|
2389
2638
|
|
|
2390
|
-
const
|
|
2639
|
+
const Ot = Symbol("emitEnd");
|
|
2391
2640
|
|
|
2392
|
-
const
|
|
2641
|
+
const zt = Symbol("emitEnd2");
|
|
2393
2642
|
|
|
2394
|
-
const
|
|
2643
|
+
const Dt = Symbol("async");
|
|
2395
2644
|
|
|
2396
|
-
const
|
|
2645
|
+
const Bt = Symbol("abort");
|
|
2397
2646
|
|
|
2398
|
-
const
|
|
2647
|
+
const Nt = Symbol("aborted");
|
|
2399
2648
|
|
|
2400
|
-
const
|
|
2649
|
+
const It = Symbol("signal");
|
|
2401
2650
|
|
|
2402
|
-
const
|
|
2651
|
+
const Wt = Symbol("dataListeners");
|
|
2403
2652
|
|
|
2404
|
-
const
|
|
2653
|
+
const _t = Symbol("discarded");
|
|
2405
2654
|
|
|
2406
|
-
const
|
|
2655
|
+
const defer = t => Promise.resolve().then(t);
|
|
2407
2656
|
|
|
2408
|
-
const
|
|
2657
|
+
const nodefer = t => t();
|
|
2409
2658
|
|
|
2410
|
-
const
|
|
2659
|
+
const isEndish = t => t === "end" || t === "finish" || t === "prefinish";
|
|
2411
2660
|
|
|
2412
|
-
const
|
|
2661
|
+
const isArrayBufferLike = t => t instanceof ArrayBuffer || !!t && typeof t === "object" && t.constructor && t.constructor.name === "ArrayBuffer" && t.byteLength >= 0;
|
|
2413
2662
|
|
|
2414
|
-
const
|
|
2663
|
+
const isArrayBufferView = t => !Buffer.isBuffer(t) && ArrayBuffer.isView(t);
|
|
2415
2664
|
|
|
2416
2665
|
class Pipe {
|
|
2417
2666
|
src;
|
|
@@ -2422,7 +2671,7 @@ class Pipe {
|
|
|
2422
2671
|
this.src = t;
|
|
2423
2672
|
this.dest = e;
|
|
2424
2673
|
this.opts = s;
|
|
2425
|
-
this.ondrain = () => t[
|
|
2674
|
+
this.ondrain = () => t[vt]();
|
|
2426
2675
|
this.dest.on("drain", this.ondrain);
|
|
2427
2676
|
}
|
|
2428
2677
|
unpipe() {
|
|
@@ -2447,30 +2696,30 @@ class PipeProxyErrors extends Pipe {
|
|
|
2447
2696
|
}
|
|
2448
2697
|
}
|
|
2449
2698
|
|
|
2450
|
-
const
|
|
2451
|
-
|
|
2452
|
-
const
|
|
2453
|
-
|
|
2454
|
-
class Minipass extends
|
|
2455
|
-
[
|
|
2456
|
-
[
|
|
2457
|
-
[
|
|
2458
|
-
[
|
|
2459
|
-
[
|
|
2460
|
-
[
|
|
2461
|
-
[
|
|
2462
|
-
[
|
|
2463
|
-
[
|
|
2699
|
+
const isObjectModeOptions = t => !!t.objectMode;
|
|
2700
|
+
|
|
2701
|
+
const isEncodingOptions = t => !t.objectMode && !!t.encoding && t.encoding !== "buffer";
|
|
2702
|
+
|
|
2703
|
+
class Minipass extends d {
|
|
2704
|
+
[kt]=false;
|
|
2705
|
+
[xt]=false;
|
|
2706
|
+
[Ct]=[];
|
|
2707
|
+
[Et]=[];
|
|
2708
|
+
[Mt];
|
|
2709
|
+
[bt];
|
|
2710
|
+
[Dt];
|
|
2711
|
+
[St];
|
|
2712
|
+
[ct]=false;
|
|
2713
|
+
[ut]=false;
|
|
2714
|
+
[dt]=false;
|
|
2715
|
+
[gt]=false;
|
|
2716
|
+
[pt]=null;
|
|
2717
|
+
[Tt]=0;
|
|
2718
|
+
[Pt]=false;
|
|
2719
|
+
[It];
|
|
2464
2720
|
[Nt]=false;
|
|
2465
|
-
[
|
|
2466
|
-
[
|
|
2467
|
-
[Wt]=null;
|
|
2468
|
-
[Kt]=0;
|
|
2469
|
-
[te]=false;
|
|
2470
|
-
[ae];
|
|
2471
|
-
[he]=false;
|
|
2472
|
-
[le]=0;
|
|
2473
|
-
[ce]=false;
|
|
2721
|
+
[Wt]=0;
|
|
2722
|
+
[_t]=false;
|
|
2474
2723
|
writable=true;
|
|
2475
2724
|
readable=true;
|
|
2476
2725
|
constructor(...t) {
|
|
@@ -2479,43 +2728,43 @@ class Minipass extends p {
|
|
|
2479
2728
|
if (e.objectMode && typeof e.encoding === "string") {
|
|
2480
2729
|
throw new TypeError("Encoding and objectMode may not be used together");
|
|
2481
2730
|
}
|
|
2482
|
-
if (
|
|
2483
|
-
this[
|
|
2484
|
-
this[
|
|
2485
|
-
} else if (
|
|
2486
|
-
this[
|
|
2487
|
-
this[
|
|
2731
|
+
if (isObjectModeOptions(e)) {
|
|
2732
|
+
this[Mt] = true;
|
|
2733
|
+
this[bt] = null;
|
|
2734
|
+
} else if (isEncodingOptions(e)) {
|
|
2735
|
+
this[bt] = e.encoding;
|
|
2736
|
+
this[Mt] = false;
|
|
2488
2737
|
} else {
|
|
2489
|
-
this[
|
|
2490
|
-
this[
|
|
2738
|
+
this[Mt] = false;
|
|
2739
|
+
this[bt] = null;
|
|
2491
2740
|
}
|
|
2492
|
-
this[
|
|
2493
|
-
this[
|
|
2741
|
+
this[Dt] = !!e.async;
|
|
2742
|
+
this[St] = this[bt] ? new g(this[bt]) : null;
|
|
2494
2743
|
if (e && e.debugExposeBuffer === true) {
|
|
2495
2744
|
Object.defineProperty(this, "buffer", {
|
|
2496
|
-
get: () => this[
|
|
2745
|
+
get: () => this[Et]
|
|
2497
2746
|
});
|
|
2498
2747
|
}
|
|
2499
2748
|
if (e && e.debugExposePipes === true) {
|
|
2500
2749
|
Object.defineProperty(this, "pipes", {
|
|
2501
|
-
get: () => this[
|
|
2750
|
+
get: () => this[Ct]
|
|
2502
2751
|
});
|
|
2503
2752
|
}
|
|
2504
2753
|
const {signal: s} = e;
|
|
2505
2754
|
if (s) {
|
|
2506
|
-
this[
|
|
2755
|
+
this[It] = s;
|
|
2507
2756
|
if (s.aborted) {
|
|
2508
|
-
this[
|
|
2757
|
+
this[Bt]();
|
|
2509
2758
|
} else {
|
|
2510
|
-
s.addEventListener("abort", (() => this[
|
|
2759
|
+
s.addEventListener("abort", (() => this[Bt]()));
|
|
2511
2760
|
}
|
|
2512
2761
|
}
|
|
2513
2762
|
}
|
|
2514
2763
|
get bufferLength() {
|
|
2515
|
-
return this[
|
|
2764
|
+
return this[Tt];
|
|
2516
2765
|
}
|
|
2517
2766
|
get encoding() {
|
|
2518
|
-
return this[
|
|
2767
|
+
return this[bt];
|
|
2519
2768
|
}
|
|
2520
2769
|
set encoding(t) {
|
|
2521
2770
|
throw new Error("Encoding must be set at instantiation time");
|
|
@@ -2524,30 +2773,30 @@ class Minipass extends p {
|
|
|
2524
2773
|
throw new Error("Encoding must be set at instantiation time");
|
|
2525
2774
|
}
|
|
2526
2775
|
get objectMode() {
|
|
2527
|
-
return this[
|
|
2776
|
+
return this[Mt];
|
|
2528
2777
|
}
|
|
2529
2778
|
set objectMode(t) {
|
|
2530
2779
|
throw new Error("objectMode must be set at instantiation time");
|
|
2531
2780
|
}
|
|
2532
2781
|
get ["async"]() {
|
|
2533
|
-
return this[
|
|
2782
|
+
return this[Dt];
|
|
2534
2783
|
}
|
|
2535
2784
|
set ["async"](t) {
|
|
2536
|
-
this[
|
|
2785
|
+
this[Dt] = this[Dt] || !!t;
|
|
2537
2786
|
}
|
|
2538
|
-
[
|
|
2539
|
-
this[
|
|
2540
|
-
this.emit("abort", this[
|
|
2541
|
-
this.destroy(this[
|
|
2787
|
+
[Bt]() {
|
|
2788
|
+
this[Nt] = true;
|
|
2789
|
+
this.emit("abort", this[It]?.reason);
|
|
2790
|
+
this.destroy(this[It]?.reason);
|
|
2542
2791
|
}
|
|
2543
2792
|
get aborted() {
|
|
2544
|
-
return this[
|
|
2793
|
+
return this[Nt];
|
|
2545
2794
|
}
|
|
2546
2795
|
set aborted(t) {}
|
|
2547
2796
|
write(t, e, s) {
|
|
2548
|
-
if (this[
|
|
2549
|
-
if (this[
|
|
2550
|
-
if (this[
|
|
2797
|
+
if (this[Nt]) return false;
|
|
2798
|
+
if (this[ct]) throw new Error("write after end");
|
|
2799
|
+
if (this[Pt]) {
|
|
2551
2800
|
this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), {
|
|
2552
2801
|
code: "ERR_STREAM_DESTROYED"
|
|
2553
2802
|
}));
|
|
@@ -2558,70 +2807,70 @@ class Minipass extends p {
|
|
|
2558
2807
|
e = "utf8";
|
|
2559
2808
|
}
|
|
2560
2809
|
if (!e) e = "utf8";
|
|
2561
|
-
const i = this[
|
|
2562
|
-
if (!this[
|
|
2563
|
-
if (
|
|
2810
|
+
const i = this[Dt] ? defer : nodefer;
|
|
2811
|
+
if (!this[Mt] && !Buffer.isBuffer(t)) {
|
|
2812
|
+
if (isArrayBufferView(t)) {
|
|
2564
2813
|
t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2565
|
-
} else if (
|
|
2814
|
+
} else if (isArrayBufferLike(t)) {
|
|
2566
2815
|
t = Buffer.from(t);
|
|
2567
2816
|
} else if (typeof t !== "string") {
|
|
2568
2817
|
throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2569
2818
|
}
|
|
2570
2819
|
}
|
|
2571
|
-
if (this[
|
|
2572
|
-
if (this[
|
|
2573
|
-
if (this[
|
|
2574
|
-
if (this[
|
|
2820
|
+
if (this[Mt]) {
|
|
2821
|
+
if (this[kt] && this[Tt] !== 0) this[yt](true);
|
|
2822
|
+
if (this[kt]) this.emit("data", t); else this[At](t);
|
|
2823
|
+
if (this[Tt] !== 0) this.emit("readable");
|
|
2575
2824
|
if (s) i(s);
|
|
2576
|
-
return this[
|
|
2825
|
+
return this[kt];
|
|
2577
2826
|
}
|
|
2578
2827
|
if (!t.length) {
|
|
2579
|
-
if (this[
|
|
2828
|
+
if (this[Tt] !== 0) this.emit("readable");
|
|
2580
2829
|
if (s) i(s);
|
|
2581
|
-
return this[
|
|
2830
|
+
return this[kt];
|
|
2582
2831
|
}
|
|
2583
|
-
if (typeof t === "string" && !(e === this[
|
|
2832
|
+
if (typeof t === "string" && !(e === this[bt] && !this[St]?.lastNeed)) {
|
|
2584
2833
|
t = Buffer.from(t, e);
|
|
2585
2834
|
}
|
|
2586
|
-
if (Buffer.isBuffer(t) && this[
|
|
2587
|
-
t = this[
|
|
2835
|
+
if (Buffer.isBuffer(t) && this[bt]) {
|
|
2836
|
+
t = this[St].write(t);
|
|
2588
2837
|
}
|
|
2589
|
-
if (this[
|
|
2590
|
-
if (this[
|
|
2591
|
-
if (this[
|
|
2838
|
+
if (this[kt] && this[Tt] !== 0) this[yt](true);
|
|
2839
|
+
if (this[kt]) this.emit("data", t); else this[At](t);
|
|
2840
|
+
if (this[Tt] !== 0) this.emit("readable");
|
|
2592
2841
|
if (s) i(s);
|
|
2593
|
-
return this[
|
|
2842
|
+
return this[kt];
|
|
2594
2843
|
}
|
|
2595
2844
|
read(t) {
|
|
2596
|
-
if (this[
|
|
2597
|
-
this[
|
|
2598
|
-
if (this[
|
|
2599
|
-
this[
|
|
2845
|
+
if (this[Pt]) return null;
|
|
2846
|
+
this[_t] = false;
|
|
2847
|
+
if (this[Tt] === 0 || t === 0 || t && t > this[Tt]) {
|
|
2848
|
+
this[ft]();
|
|
2600
2849
|
return null;
|
|
2601
2850
|
}
|
|
2602
|
-
if (this[
|
|
2603
|
-
if (this[
|
|
2604
|
-
this[
|
|
2851
|
+
if (this[Mt]) t = null;
|
|
2852
|
+
if (this[Et].length > 1 && !this[Mt]) {
|
|
2853
|
+
this[Et] = [ this[bt] ? this[Et].join("") : Buffer.concat(this[Et], this[Tt]) ];
|
|
2605
2854
|
}
|
|
2606
|
-
const e = this[
|
|
2607
|
-
this[
|
|
2855
|
+
const e = this[mt](t || null, this[Et][0]);
|
|
2856
|
+
this[ft]();
|
|
2608
2857
|
return e;
|
|
2609
2858
|
}
|
|
2610
|
-
[
|
|
2611
|
-
if (this[
|
|
2859
|
+
[mt](t, e) {
|
|
2860
|
+
if (this[Mt]) this[Lt](); else {
|
|
2612
2861
|
const s = e;
|
|
2613
|
-
if (t === s.length || t === null) this[
|
|
2614
|
-
this[
|
|
2862
|
+
if (t === s.length || t === null) this[Lt](); else if (typeof s === "string") {
|
|
2863
|
+
this[Et][0] = s.slice(t);
|
|
2615
2864
|
e = s.slice(0, t);
|
|
2616
|
-
this[
|
|
2865
|
+
this[Tt] -= t;
|
|
2617
2866
|
} else {
|
|
2618
|
-
this[
|
|
2867
|
+
this[Et][0] = s.subarray(t);
|
|
2619
2868
|
e = s.subarray(0, t);
|
|
2620
|
-
this[
|
|
2869
|
+
this[Tt] -= t;
|
|
2621
2870
|
}
|
|
2622
2871
|
}
|
|
2623
2872
|
this.emit("data", e);
|
|
2624
|
-
if (!this[
|
|
2873
|
+
if (!this[Et].length && !this[ct]) this.emit("drain");
|
|
2625
2874
|
return e;
|
|
2626
2875
|
}
|
|
2627
2876
|
end(t, e, s) {
|
|
@@ -2635,78 +2884,78 @@ class Minipass extends p {
|
|
|
2635
2884
|
}
|
|
2636
2885
|
if (t !== undefined) this.write(t, e);
|
|
2637
2886
|
if (s) this.once("end", s);
|
|
2638
|
-
this[
|
|
2887
|
+
this[ct] = true;
|
|
2639
2888
|
this.writable = false;
|
|
2640
|
-
if (this[
|
|
2889
|
+
if (this[kt] || !this[xt]) this[ft]();
|
|
2641
2890
|
return this;
|
|
2642
2891
|
}
|
|
2643
|
-
[
|
|
2644
|
-
if (this[
|
|
2645
|
-
if (!this[
|
|
2646
|
-
this[
|
|
2892
|
+
[vt]() {
|
|
2893
|
+
if (this[Pt]) return;
|
|
2894
|
+
if (!this[Wt] && !this[Ct].length) {
|
|
2895
|
+
this[_t] = true;
|
|
2647
2896
|
}
|
|
2648
|
-
this[
|
|
2649
|
-
this[
|
|
2897
|
+
this[xt] = false;
|
|
2898
|
+
this[kt] = true;
|
|
2650
2899
|
this.emit("resume");
|
|
2651
|
-
if (this[
|
|
2900
|
+
if (this[Et].length) this[yt](); else if (this[ct]) this[ft](); else this.emit("drain");
|
|
2652
2901
|
}
|
|
2653
2902
|
resume() {
|
|
2654
|
-
return this[
|
|
2903
|
+
return this[vt]();
|
|
2655
2904
|
}
|
|
2656
2905
|
pause() {
|
|
2657
|
-
this[
|
|
2658
|
-
this[
|
|
2659
|
-
this[
|
|
2906
|
+
this[kt] = false;
|
|
2907
|
+
this[xt] = true;
|
|
2908
|
+
this[_t] = false;
|
|
2660
2909
|
}
|
|
2661
2910
|
get destroyed() {
|
|
2662
|
-
return this[
|
|
2911
|
+
return this[Pt];
|
|
2663
2912
|
}
|
|
2664
2913
|
get flowing() {
|
|
2665
|
-
return this[
|
|
2914
|
+
return this[kt];
|
|
2666
2915
|
}
|
|
2667
2916
|
get paused() {
|
|
2668
|
-
return this[
|
|
2917
|
+
return this[xt];
|
|
2669
2918
|
}
|
|
2670
|
-
[
|
|
2671
|
-
if (this[
|
|
2672
|
-
this[
|
|
2919
|
+
[At](t) {
|
|
2920
|
+
if (this[Mt]) this[Tt] += 1; else this[Tt] += t.length;
|
|
2921
|
+
this[Et].push(t);
|
|
2673
2922
|
}
|
|
2674
|
-
[
|
|
2675
|
-
if (this[
|
|
2676
|
-
return this[
|
|
2923
|
+
[Lt]() {
|
|
2924
|
+
if (this[Mt]) this[Tt] -= 1; else this[Tt] -= this[Et][0].length;
|
|
2925
|
+
return this[Et].shift();
|
|
2677
2926
|
}
|
|
2678
|
-
[
|
|
2679
|
-
do {} while (this[
|
|
2680
|
-
if (!t && !this[
|
|
2927
|
+
[yt](t = false) {
|
|
2928
|
+
do {} while (this[wt](this[Lt]()) && this[Et].length);
|
|
2929
|
+
if (!t && !this[Et].length && !this[ct]) this.emit("drain");
|
|
2681
2930
|
}
|
|
2682
|
-
[
|
|
2931
|
+
[wt](t) {
|
|
2683
2932
|
this.emit("data", t);
|
|
2684
|
-
return this[
|
|
2933
|
+
return this[kt];
|
|
2685
2934
|
}
|
|
2686
2935
|
pipe(t, e) {
|
|
2687
|
-
if (this[
|
|
2688
|
-
this[
|
|
2689
|
-
const s = this[
|
|
2936
|
+
if (this[Pt]) return t;
|
|
2937
|
+
this[_t] = false;
|
|
2938
|
+
const s = this[ut];
|
|
2690
2939
|
e = e || {};
|
|
2691
|
-
if (t ===
|
|
2940
|
+
if (t === lt.stdout || t === lt.stderr) e.end = false; else e.end = e.end !== false;
|
|
2692
2941
|
e.proxyErrors = !!e.proxyErrors;
|
|
2693
2942
|
if (s) {
|
|
2694
2943
|
if (e.end) t.end();
|
|
2695
2944
|
} else {
|
|
2696
|
-
this[
|
|
2697
|
-
if (this[
|
|
2945
|
+
this[Ct].push(!e.proxyErrors ? new Pipe(this, t, e) : new PipeProxyErrors(this, t, e));
|
|
2946
|
+
if (this[Dt]) defer((() => this[vt]())); else this[vt]();
|
|
2698
2947
|
}
|
|
2699
2948
|
return t;
|
|
2700
2949
|
}
|
|
2701
2950
|
unpipe(t) {
|
|
2702
|
-
const e = this[
|
|
2951
|
+
const e = this[Ct].find((e => e.dest === t));
|
|
2703
2952
|
if (e) {
|
|
2704
|
-
if (this[
|
|
2705
|
-
if (this[
|
|
2706
|
-
this[
|
|
2953
|
+
if (this[Ct].length === 1) {
|
|
2954
|
+
if (this[kt] && this[Wt] === 0) {
|
|
2955
|
+
this[kt] = false;
|
|
2707
2956
|
}
|
|
2708
|
-
this[
|
|
2709
|
-
} else this[
|
|
2957
|
+
this[Ct] = [];
|
|
2958
|
+
} else this[Ct].splice(this[Ct].indexOf(e), 1);
|
|
2710
2959
|
e.unpipe();
|
|
2711
2960
|
}
|
|
2712
2961
|
}
|
|
@@ -2716,19 +2965,19 @@ class Minipass extends p {
|
|
|
2716
2965
|
on(t, e) {
|
|
2717
2966
|
const s = super.on(t, e);
|
|
2718
2967
|
if (t === "data") {
|
|
2719
|
-
this[
|
|
2720
|
-
this[
|
|
2721
|
-
if (!this[
|
|
2722
|
-
this[
|
|
2968
|
+
this[_t] = false;
|
|
2969
|
+
this[Wt]++;
|
|
2970
|
+
if (!this[Ct].length && !this[kt]) {
|
|
2971
|
+
this[vt]();
|
|
2723
2972
|
}
|
|
2724
|
-
} else if (t === "readable" && this[
|
|
2973
|
+
} else if (t === "readable" && this[Tt] !== 0) {
|
|
2725
2974
|
super.emit("readable");
|
|
2726
|
-
} else if (
|
|
2975
|
+
} else if (isEndish(t) && this[ut]) {
|
|
2727
2976
|
super.emit(t);
|
|
2728
2977
|
this.removeAllListeners(t);
|
|
2729
|
-
} else if (t === "error" && this[
|
|
2978
|
+
} else if (t === "error" && this[pt]) {
|
|
2730
2979
|
const t = e;
|
|
2731
|
-
if (this[
|
|
2980
|
+
if (this[Dt]) defer((() => t.call(this, this[pt]))); else t.call(this, this[pt]);
|
|
2732
2981
|
}
|
|
2733
2982
|
return s;
|
|
2734
2983
|
}
|
|
@@ -2738,9 +2987,9 @@ class Minipass extends p {
|
|
|
2738
2987
|
off(t, e) {
|
|
2739
2988
|
const s = super.off(t, e);
|
|
2740
2989
|
if (t === "data") {
|
|
2741
|
-
this[
|
|
2742
|
-
if (this[
|
|
2743
|
-
this[
|
|
2990
|
+
this[Wt] = this.listeners("data").length;
|
|
2991
|
+
if (this[Wt] === 0 && !this[_t] && !this[Ct].length) {
|
|
2992
|
+
this[kt] = false;
|
|
2744
2993
|
}
|
|
2745
2994
|
}
|
|
2746
2995
|
return s;
|
|
@@ -2748,49 +2997,49 @@ class Minipass extends p {
|
|
|
2748
2997
|
removeAllListeners(t) {
|
|
2749
2998
|
const e = super.removeAllListeners(t);
|
|
2750
2999
|
if (t === "data" || t === undefined) {
|
|
2751
|
-
this[
|
|
2752
|
-
if (!this[
|
|
2753
|
-
this[
|
|
3000
|
+
this[Wt] = 0;
|
|
3001
|
+
if (!this[_t] && !this[Ct].length) {
|
|
3002
|
+
this[kt] = false;
|
|
2754
3003
|
}
|
|
2755
3004
|
}
|
|
2756
3005
|
return e;
|
|
2757
3006
|
}
|
|
2758
3007
|
get emittedEnd() {
|
|
2759
|
-
return this[
|
|
3008
|
+
return this[ut];
|
|
2760
3009
|
}
|
|
2761
|
-
[
|
|
2762
|
-
if (!this[
|
|
2763
|
-
this[
|
|
3010
|
+
[ft]() {
|
|
3011
|
+
if (!this[dt] && !this[ut] && !this[Pt] && this[Et].length === 0 && this[ct]) {
|
|
3012
|
+
this[dt] = true;
|
|
2764
3013
|
this.emit("end");
|
|
2765
3014
|
this.emit("prefinish");
|
|
2766
3015
|
this.emit("finish");
|
|
2767
|
-
if (this[
|
|
2768
|
-
this[
|
|
3016
|
+
if (this[gt]) this.emit("close");
|
|
3017
|
+
this[dt] = false;
|
|
2769
3018
|
}
|
|
2770
3019
|
}
|
|
2771
3020
|
emit(t, ...e) {
|
|
2772
3021
|
const s = e[0];
|
|
2773
|
-
if (t !== "error" && t !== "close" && t !==
|
|
3022
|
+
if (t !== "error" && t !== "close" && t !== Pt && this[Pt]) {
|
|
2774
3023
|
return false;
|
|
2775
3024
|
} else if (t === "data") {
|
|
2776
|
-
return !this[
|
|
3025
|
+
return !this[Mt] && !s ? false : this[Dt] ? (defer((() => this[Rt](s))), true) : this[Rt](s);
|
|
2777
3026
|
} else if (t === "end") {
|
|
2778
|
-
return this[
|
|
3027
|
+
return this[Ot]();
|
|
2779
3028
|
} else if (t === "close") {
|
|
2780
|
-
this[
|
|
2781
|
-
if (!this[
|
|
3029
|
+
this[gt] = true;
|
|
3030
|
+
if (!this[ut] && !this[Pt]) return false;
|
|
2782
3031
|
const t = super.emit("close");
|
|
2783
3032
|
this.removeAllListeners("close");
|
|
2784
3033
|
return t;
|
|
2785
3034
|
} else if (t === "error") {
|
|
2786
|
-
this[
|
|
2787
|
-
super.emit(
|
|
2788
|
-
const t = !this[
|
|
2789
|
-
this[
|
|
3035
|
+
this[pt] = s;
|
|
3036
|
+
super.emit(Ft, s);
|
|
3037
|
+
const t = !this[It] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
3038
|
+
this[ft]();
|
|
2790
3039
|
return t;
|
|
2791
3040
|
} else if (t === "resume") {
|
|
2792
3041
|
const t = super.emit("resume");
|
|
2793
|
-
this[
|
|
3042
|
+
this[ft]();
|
|
2794
3043
|
return t;
|
|
2795
3044
|
} else if (t === "finish" || t === "prefinish") {
|
|
2796
3045
|
const e = super.emit(t);
|
|
@@ -2798,34 +3047,34 @@ class Minipass extends p {
|
|
|
2798
3047
|
return e;
|
|
2799
3048
|
}
|
|
2800
3049
|
const i = super.emit(t, ...e);
|
|
2801
|
-
this[
|
|
3050
|
+
this[ft]();
|
|
2802
3051
|
return i;
|
|
2803
3052
|
}
|
|
2804
|
-
[
|
|
2805
|
-
for (const e of this[
|
|
3053
|
+
[Rt](t) {
|
|
3054
|
+
for (const e of this[Ct]) {
|
|
2806
3055
|
if (e.dest.write(t) === false) this.pause();
|
|
2807
3056
|
}
|
|
2808
|
-
const e = this[
|
|
2809
|
-
this[
|
|
3057
|
+
const e = this[_t] ? false : super.emit("data", t);
|
|
3058
|
+
this[ft]();
|
|
2810
3059
|
return e;
|
|
2811
3060
|
}
|
|
2812
|
-
[
|
|
2813
|
-
if (this[
|
|
2814
|
-
this[
|
|
3061
|
+
[Ot]() {
|
|
3062
|
+
if (this[ut]) return false;
|
|
3063
|
+
this[ut] = true;
|
|
2815
3064
|
this.readable = false;
|
|
2816
|
-
return this[
|
|
3065
|
+
return this[Dt] ? (defer((() => this[zt]())), true) : this[zt]();
|
|
2817
3066
|
}
|
|
2818
|
-
[
|
|
2819
|
-
if (this[
|
|
2820
|
-
const t = this[
|
|
3067
|
+
[zt]() {
|
|
3068
|
+
if (this[St]) {
|
|
3069
|
+
const t = this[St].end();
|
|
2821
3070
|
if (t) {
|
|
2822
|
-
for (const e of this[
|
|
3071
|
+
for (const e of this[Ct]) {
|
|
2823
3072
|
e.dest.write(t);
|
|
2824
3073
|
}
|
|
2825
|
-
if (!this[
|
|
3074
|
+
if (!this[_t]) super.emit("data", t);
|
|
2826
3075
|
}
|
|
2827
3076
|
}
|
|
2828
|
-
for (const t of this[
|
|
3077
|
+
for (const t of this[Ct]) {
|
|
2829
3078
|
t.end();
|
|
2830
3079
|
}
|
|
2831
3080
|
const t = super.emit("end");
|
|
@@ -2836,33 +3085,33 @@ class Minipass extends p {
|
|
|
2836
3085
|
const t = Object.assign([], {
|
|
2837
3086
|
dataLength: 0
|
|
2838
3087
|
});
|
|
2839
|
-
if (!this[
|
|
3088
|
+
if (!this[Mt]) t.dataLength = 0;
|
|
2840
3089
|
const e = this.promise();
|
|
2841
3090
|
this.on("data", (e => {
|
|
2842
3091
|
t.push(e);
|
|
2843
|
-
if (!this[
|
|
3092
|
+
if (!this[Mt]) t.dataLength += e.length;
|
|
2844
3093
|
}));
|
|
2845
3094
|
await e;
|
|
2846
3095
|
return t;
|
|
2847
3096
|
}
|
|
2848
3097
|
async concat() {
|
|
2849
|
-
if (this[
|
|
3098
|
+
if (this[Mt]) {
|
|
2850
3099
|
throw new Error("cannot concat in objectMode");
|
|
2851
3100
|
}
|
|
2852
3101
|
const t = await this.collect();
|
|
2853
|
-
return this[
|
|
3102
|
+
return this[bt] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
2854
3103
|
}
|
|
2855
3104
|
async promise() {
|
|
2856
3105
|
return new Promise(((t, e) => {
|
|
2857
|
-
this.on(
|
|
3106
|
+
this.on(Pt, (() => e(new Error("stream destroyed"))));
|
|
2858
3107
|
this.on("error", (t => e(t)));
|
|
2859
3108
|
this.on("end", (() => t()));
|
|
2860
3109
|
}));
|
|
2861
3110
|
}
|
|
2862
3111
|
[Symbol.asyncIterator]() {
|
|
2863
|
-
this[
|
|
3112
|
+
this[_t] = false;
|
|
2864
3113
|
let t = false;
|
|
2865
|
-
const
|
|
3114
|
+
const stop = async () => {
|
|
2866
3115
|
this.pause();
|
|
2867
3116
|
t = true;
|
|
2868
3117
|
return {
|
|
@@ -2870,201 +3119,201 @@ class Minipass extends p {
|
|
|
2870
3119
|
done: true
|
|
2871
3120
|
};
|
|
2872
3121
|
};
|
|
2873
|
-
const
|
|
2874
|
-
if (t) return
|
|
2875
|
-
const
|
|
2876
|
-
if (
|
|
3122
|
+
const next = () => {
|
|
3123
|
+
if (t) return stop();
|
|
3124
|
+
const e = this.read();
|
|
3125
|
+
if (e !== null) return Promise.resolve({
|
|
2877
3126
|
done: false,
|
|
2878
|
-
value:
|
|
3127
|
+
value: e
|
|
2879
3128
|
});
|
|
2880
|
-
if (this[
|
|
3129
|
+
if (this[ct]) return stop();
|
|
3130
|
+
let s;
|
|
2881
3131
|
let i;
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
this.off("
|
|
2885
|
-
this.off(
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
n(t);
|
|
3132
|
+
const onerr = t => {
|
|
3133
|
+
this.off("data", ondata);
|
|
3134
|
+
this.off("end", onend);
|
|
3135
|
+
this.off(Pt, ondestroy);
|
|
3136
|
+
stop();
|
|
3137
|
+
i(t);
|
|
2889
3138
|
};
|
|
2890
|
-
const
|
|
2891
|
-
this.off("error",
|
|
2892
|
-
this.off("end",
|
|
2893
|
-
this.off(
|
|
3139
|
+
const ondata = t => {
|
|
3140
|
+
this.off("error", onerr);
|
|
3141
|
+
this.off("end", onend);
|
|
3142
|
+
this.off(Pt, ondestroy);
|
|
2894
3143
|
this.pause();
|
|
2895
|
-
|
|
3144
|
+
s({
|
|
2896
3145
|
value: t,
|
|
2897
|
-
done: !!this[
|
|
3146
|
+
done: !!this[ct]
|
|
2898
3147
|
});
|
|
2899
3148
|
};
|
|
2900
|
-
const
|
|
2901
|
-
this.off("error",
|
|
2902
|
-
this.off("data",
|
|
2903
|
-
this.off(
|
|
2904
|
-
|
|
2905
|
-
|
|
3149
|
+
const onend = () => {
|
|
3150
|
+
this.off("error", onerr);
|
|
3151
|
+
this.off("data", ondata);
|
|
3152
|
+
this.off(Pt, ondestroy);
|
|
3153
|
+
stop();
|
|
3154
|
+
s({
|
|
2906
3155
|
done: true,
|
|
2907
3156
|
value: undefined
|
|
2908
3157
|
});
|
|
2909
3158
|
};
|
|
2910
|
-
const
|
|
3159
|
+
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
2911
3160
|
return new Promise(((t, e) => {
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
this.once(
|
|
2915
|
-
this.once("error",
|
|
2916
|
-
this.once("end",
|
|
2917
|
-
this.once("data",
|
|
3161
|
+
i = e;
|
|
3162
|
+
s = t;
|
|
3163
|
+
this.once(Pt, ondestroy);
|
|
3164
|
+
this.once("error", onerr);
|
|
3165
|
+
this.once("end", onend);
|
|
3166
|
+
this.once("data", ondata);
|
|
2918
3167
|
}));
|
|
2919
3168
|
};
|
|
2920
3169
|
return {
|
|
2921
|
-
next
|
|
2922
|
-
throw:
|
|
2923
|
-
return:
|
|
3170
|
+
next,
|
|
3171
|
+
throw: stop,
|
|
3172
|
+
return: stop,
|
|
2924
3173
|
[Symbol.asyncIterator]() {
|
|
2925
3174
|
return this;
|
|
2926
3175
|
}
|
|
2927
3176
|
};
|
|
2928
3177
|
}
|
|
2929
3178
|
[Symbol.iterator]() {
|
|
2930
|
-
this[
|
|
3179
|
+
this[_t] = false;
|
|
2931
3180
|
let t = false;
|
|
2932
|
-
const
|
|
3181
|
+
const stop = () => {
|
|
2933
3182
|
this.pause();
|
|
2934
|
-
this.off(
|
|
2935
|
-
this.off(
|
|
2936
|
-
this.off("end",
|
|
3183
|
+
this.off(Ft, stop);
|
|
3184
|
+
this.off(Pt, stop);
|
|
3185
|
+
this.off("end", stop);
|
|
2937
3186
|
t = true;
|
|
2938
3187
|
return {
|
|
2939
3188
|
done: true,
|
|
2940
3189
|
value: undefined
|
|
2941
3190
|
};
|
|
2942
3191
|
};
|
|
2943
|
-
const
|
|
2944
|
-
if (t) return
|
|
2945
|
-
const
|
|
2946
|
-
return
|
|
3192
|
+
const next = () => {
|
|
3193
|
+
if (t) return stop();
|
|
3194
|
+
const e = this.read();
|
|
3195
|
+
return e === null ? stop() : {
|
|
2947
3196
|
done: false,
|
|
2948
|
-
value:
|
|
3197
|
+
value: e
|
|
2949
3198
|
};
|
|
2950
3199
|
};
|
|
2951
|
-
this.once("end",
|
|
2952
|
-
this.once(
|
|
2953
|
-
this.once(
|
|
3200
|
+
this.once("end", stop);
|
|
3201
|
+
this.once(Ft, stop);
|
|
3202
|
+
this.once(Pt, stop);
|
|
2954
3203
|
return {
|
|
2955
|
-
next
|
|
2956
|
-
throw:
|
|
2957
|
-
return:
|
|
3204
|
+
next,
|
|
3205
|
+
throw: stop,
|
|
3206
|
+
return: stop,
|
|
2958
3207
|
[Symbol.iterator]() {
|
|
2959
3208
|
return this;
|
|
2960
3209
|
}
|
|
2961
3210
|
};
|
|
2962
3211
|
}
|
|
2963
3212
|
destroy(t) {
|
|
2964
|
-
if (this[
|
|
2965
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3213
|
+
if (this[Pt]) {
|
|
3214
|
+
if (t) this.emit("error", t); else this.emit(Pt);
|
|
2966
3215
|
return this;
|
|
2967
3216
|
}
|
|
2968
|
-
this[
|
|
2969
|
-
this[
|
|
2970
|
-
this[
|
|
2971
|
-
this[
|
|
3217
|
+
this[Pt] = true;
|
|
3218
|
+
this[_t] = true;
|
|
3219
|
+
this[Et].length = 0;
|
|
3220
|
+
this[Tt] = 0;
|
|
2972
3221
|
const e = this;
|
|
2973
|
-
if (typeof e.close === "function" && !this[
|
|
2974
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3222
|
+
if (typeof e.close === "function" && !this[gt]) e.close();
|
|
3223
|
+
if (t) this.emit("error", t); else this.emit(Pt);
|
|
2975
3224
|
return this;
|
|
2976
3225
|
}
|
|
2977
3226
|
static get isStream() {
|
|
2978
|
-
return
|
|
3227
|
+
return isStream;
|
|
2979
3228
|
}
|
|
2980
3229
|
}
|
|
2981
3230
|
|
|
2982
|
-
const
|
|
3231
|
+
const jt = i.native;
|
|
2983
3232
|
|
|
2984
|
-
const
|
|
2985
|
-
lstatSync:
|
|
2986
|
-
readdir:
|
|
2987
|
-
readdirSync:
|
|
2988
|
-
readlinkSync:
|
|
2989
|
-
realpathSync:
|
|
3233
|
+
const $t = {
|
|
3234
|
+
lstatSync: h,
|
|
3235
|
+
readdir: o,
|
|
3236
|
+
readdirSync: r,
|
|
3237
|
+
readlinkSync: n,
|
|
3238
|
+
realpathSync: jt,
|
|
2990
3239
|
promises: {
|
|
2991
|
-
lstat:
|
|
2992
|
-
readdir:
|
|
2993
|
-
readlink:
|
|
2994
|
-
realpath:
|
|
3240
|
+
lstat: u,
|
|
3241
|
+
readdir: f,
|
|
3242
|
+
readlink: c,
|
|
3243
|
+
realpath: l
|
|
2995
3244
|
}
|
|
2996
3245
|
};
|
|
2997
3246
|
|
|
2998
|
-
const
|
|
2999
|
-
|
|
3247
|
+
const fsFromOption = t => !t || t === $t || t === a ? $t : {
|
|
3248
|
+
...$t,
|
|
3000
3249
|
...t,
|
|
3001
3250
|
promises: {
|
|
3002
|
-
|
|
3251
|
+
...$t.promises,
|
|
3003
3252
|
...t.promises || {}
|
|
3004
3253
|
}
|
|
3005
3254
|
};
|
|
3006
3255
|
|
|
3007
|
-
const
|
|
3256
|
+
const Gt = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
3008
3257
|
|
|
3009
|
-
const
|
|
3258
|
+
const uncToDrive = t => t.replace(/\//g, "\\").replace(Gt, "$1\\");
|
|
3010
3259
|
|
|
3011
|
-
const
|
|
3260
|
+
const Ut = /[\\\/]/;
|
|
3012
3261
|
|
|
3013
|
-
const
|
|
3262
|
+
const Ht = 0;
|
|
3014
3263
|
|
|
3015
|
-
const
|
|
3264
|
+
const Zt = 1;
|
|
3016
3265
|
|
|
3017
|
-
const
|
|
3266
|
+
const qt = 2;
|
|
3018
3267
|
|
|
3019
|
-
const
|
|
3268
|
+
const Vt = 4;
|
|
3020
3269
|
|
|
3021
|
-
const
|
|
3270
|
+
const Jt = 6;
|
|
3022
3271
|
|
|
3023
|
-
const
|
|
3272
|
+
const Kt = 8;
|
|
3024
3273
|
|
|
3025
|
-
const
|
|
3274
|
+
const Yt = 10;
|
|
3026
3275
|
|
|
3027
|
-
const
|
|
3276
|
+
const Xt = 12;
|
|
3028
3277
|
|
|
3029
|
-
const
|
|
3278
|
+
const Qt = 15;
|
|
3030
3279
|
|
|
3031
|
-
const
|
|
3280
|
+
const te = ~Qt;
|
|
3032
3281
|
|
|
3033
|
-
const
|
|
3282
|
+
const ee = 16;
|
|
3034
3283
|
|
|
3035
|
-
const
|
|
3284
|
+
const se = 32;
|
|
3036
3285
|
|
|
3037
|
-
const
|
|
3286
|
+
const ie = 64;
|
|
3038
3287
|
|
|
3039
|
-
const
|
|
3288
|
+
const ne = 128;
|
|
3040
3289
|
|
|
3041
|
-
const
|
|
3290
|
+
const re = 256;
|
|
3042
3291
|
|
|
3043
|
-
const
|
|
3292
|
+
const oe = 512;
|
|
3044
3293
|
|
|
3045
|
-
const
|
|
3294
|
+
const he = ie | ne | oe;
|
|
3046
3295
|
|
|
3047
|
-
const
|
|
3296
|
+
const ae = 1023;
|
|
3048
3297
|
|
|
3049
|
-
const
|
|
3298
|
+
const entToType = t => t.isFile() ? Kt : t.isDirectory() ? Vt : t.isSymbolicLink() ? Yt : t.isCharacterDevice() ? qt : t.isBlockDevice() ? Jt : t.isSocket() ? Xt : t.isFIFO() ? Zt : Ht;
|
|
3050
3299
|
|
|
3051
|
-
const
|
|
3300
|
+
const le = new Map;
|
|
3052
3301
|
|
|
3053
|
-
const
|
|
3054
|
-
const e =
|
|
3302
|
+
const normalize = t => {
|
|
3303
|
+
const e = le.get(t);
|
|
3055
3304
|
if (e) return e;
|
|
3056
3305
|
const s = t.normalize("NFKD");
|
|
3057
|
-
|
|
3306
|
+
le.set(t, s);
|
|
3058
3307
|
return s;
|
|
3059
3308
|
};
|
|
3060
3309
|
|
|
3061
|
-
const
|
|
3310
|
+
const ce = new Map;
|
|
3062
3311
|
|
|
3063
|
-
const
|
|
3064
|
-
const e =
|
|
3312
|
+
const normalizeNocase = t => {
|
|
3313
|
+
const e = ce.get(t);
|
|
3065
3314
|
if (e) return e;
|
|
3066
|
-
const s =
|
|
3067
|
-
|
|
3315
|
+
const s = normalize(t.toLowerCase());
|
|
3316
|
+
ce.set(t, s);
|
|
3068
3317
|
return s;
|
|
3069
3318
|
};
|
|
3070
3319
|
|
|
@@ -3085,7 +3334,7 @@ class ChildrenCache extends LRUCache {
|
|
|
3085
3334
|
}
|
|
3086
3335
|
}
|
|
3087
3336
|
|
|
3088
|
-
const
|
|
3337
|
+
const fe = Symbol("PathScurry setAsCwd");
|
|
3089
3338
|
|
|
3090
3339
|
class PathBase {
|
|
3091
3340
|
name;
|
|
@@ -3127,9 +3376,9 @@ class PathBase {
|
|
|
3127
3376
|
get ino() {
|
|
3128
3377
|
return this.#pt;
|
|
3129
3378
|
}
|
|
3130
|
-
#
|
|
3379
|
+
#v;
|
|
3131
3380
|
get size() {
|
|
3132
|
-
return this.#
|
|
3381
|
+
return this.#v;
|
|
3133
3382
|
}
|
|
3134
3383
|
#gt;
|
|
3135
3384
|
get blocks() {
|
|
@@ -3139,13 +3388,13 @@ class PathBase {
|
|
|
3139
3388
|
get atimeMs() {
|
|
3140
3389
|
return this.#mt;
|
|
3141
3390
|
}
|
|
3142
|
-
#
|
|
3391
|
+
#yt;
|
|
3143
3392
|
get mtimeMs() {
|
|
3144
|
-
return this.#
|
|
3393
|
+
return this.#yt;
|
|
3145
3394
|
}
|
|
3146
|
-
#
|
|
3395
|
+
#wt;
|
|
3147
3396
|
get ctimeMs() {
|
|
3148
|
-
return this.#
|
|
3397
|
+
return this.#wt;
|
|
3149
3398
|
}
|
|
3150
3399
|
#bt;
|
|
3151
3400
|
get birthtimeMs() {
|
|
@@ -3159,46 +3408,46 @@ class PathBase {
|
|
|
3159
3408
|
get mtime() {
|
|
3160
3409
|
return this.#kt;
|
|
3161
3410
|
}
|
|
3162
|
-
#
|
|
3411
|
+
#xt;
|
|
3163
3412
|
get ctime() {
|
|
3164
|
-
return this.#
|
|
3413
|
+
return this.#xt;
|
|
3165
3414
|
}
|
|
3166
|
-
#
|
|
3415
|
+
#vt;
|
|
3167
3416
|
get birthtime() {
|
|
3168
|
-
return this.#
|
|
3417
|
+
return this.#vt;
|
|
3169
3418
|
}
|
|
3170
3419
|
#Et;
|
|
3171
3420
|
#Ct;
|
|
3172
3421
|
#Tt;
|
|
3173
|
-
#Lt;
|
|
3174
3422
|
#At;
|
|
3423
|
+
#Lt;
|
|
3175
3424
|
#Mt;
|
|
3176
3425
|
#Pt;
|
|
3177
3426
|
#Ft;
|
|
3178
3427
|
#Rt;
|
|
3179
|
-
#
|
|
3428
|
+
#Ot;
|
|
3180
3429
|
get parentPath() {
|
|
3181
3430
|
return (this.parent || this).fullpath();
|
|
3182
3431
|
}
|
|
3183
3432
|
get path() {
|
|
3184
3433
|
return this.parentPath;
|
|
3185
3434
|
}
|
|
3186
|
-
constructor(t, e =
|
|
3435
|
+
constructor(t, e = Ht, s, i, n, r, o) {
|
|
3187
3436
|
this.name = t;
|
|
3188
|
-
this.#Et = n ?
|
|
3189
|
-
this.#Pt = e &
|
|
3437
|
+
this.#Et = n ? normalizeNocase(t) : normalize(t);
|
|
3438
|
+
this.#Pt = e & ae;
|
|
3190
3439
|
this.nocase = n;
|
|
3191
3440
|
this.roots = i;
|
|
3192
3441
|
this.root = s || this;
|
|
3193
3442
|
this.#Ft = r;
|
|
3194
3443
|
this.#Tt = o.fullpath;
|
|
3195
|
-
this.#
|
|
3444
|
+
this.#Lt = o.relative;
|
|
3196
3445
|
this.#Mt = o.relativePosix;
|
|
3197
3446
|
this.parent = o.parent;
|
|
3198
3447
|
if (this.parent) {
|
|
3199
3448
|
this.#ot = this.parent.#ot;
|
|
3200
3449
|
} else {
|
|
3201
|
-
this.#ot =
|
|
3450
|
+
this.#ot = fsFromOption(o.fs);
|
|
3202
3451
|
}
|
|
3203
3452
|
}
|
|
3204
3453
|
depth() {
|
|
@@ -3216,10 +3465,10 @@ class PathBase {
|
|
|
3216
3465
|
const e = this.getRootString(t);
|
|
3217
3466
|
const s = t.substring(e.length);
|
|
3218
3467
|
const i = s.split(this.splitSep);
|
|
3219
|
-
const n = e ? this.getRoot(e).#
|
|
3468
|
+
const n = e ? this.getRoot(e).#zt(i) : this.#zt(i);
|
|
3220
3469
|
return n;
|
|
3221
3470
|
}
|
|
3222
|
-
#
|
|
3471
|
+
#zt(t) {
|
|
3223
3472
|
let e = this;
|
|
3224
3473
|
for (const s of t) {
|
|
3225
3474
|
e = e.child(s);
|
|
@@ -3235,7 +3484,7 @@ class PathBase {
|
|
|
3235
3484
|
provisional: 0
|
|
3236
3485
|
});
|
|
3237
3486
|
this.#Ft.set(this, e);
|
|
3238
|
-
this.#Pt &= ~
|
|
3487
|
+
this.#Pt &= ~ee;
|
|
3239
3488
|
return e;
|
|
3240
3489
|
}
|
|
3241
3490
|
child(t, e) {
|
|
@@ -3246,7 +3495,7 @@ class PathBase {
|
|
|
3246
3495
|
return this.parent || this;
|
|
3247
3496
|
}
|
|
3248
3497
|
const s = this.children();
|
|
3249
|
-
const i = this.nocase ?
|
|
3498
|
+
const i = this.nocase ? normalizeNocase(t) : normalize(t);
|
|
3250
3499
|
for (const t of s) {
|
|
3251
3500
|
if (t.#Et === i) {
|
|
3252
3501
|
return t;
|
|
@@ -3254,26 +3503,26 @@ class PathBase {
|
|
|
3254
3503
|
}
|
|
3255
3504
|
const n = this.parent ? this.sep : "";
|
|
3256
3505
|
const r = this.#Tt ? this.#Tt + n + t : undefined;
|
|
3257
|
-
const o = this.newChild(t,
|
|
3506
|
+
const o = this.newChild(t, Ht, {
|
|
3258
3507
|
...e,
|
|
3259
3508
|
parent: this,
|
|
3260
3509
|
fullpath: r
|
|
3261
3510
|
});
|
|
3262
3511
|
if (!this.canReaddir()) {
|
|
3263
|
-
o.#Pt |=
|
|
3512
|
+
o.#Pt |= ne;
|
|
3264
3513
|
}
|
|
3265
3514
|
s.push(o);
|
|
3266
3515
|
return o;
|
|
3267
3516
|
}
|
|
3268
3517
|
relative() {
|
|
3269
3518
|
if (this.isCWD) return "";
|
|
3270
|
-
if (this.#
|
|
3271
|
-
return this.#
|
|
3519
|
+
if (this.#Lt !== undefined) {
|
|
3520
|
+
return this.#Lt;
|
|
3272
3521
|
}
|
|
3273
3522
|
const t = this.name;
|
|
3274
3523
|
const e = this.parent;
|
|
3275
3524
|
if (!e) {
|
|
3276
|
-
return this.#
|
|
3525
|
+
return this.#Lt = this.name;
|
|
3277
3526
|
}
|
|
3278
3527
|
const s = e.relative();
|
|
3279
3528
|
return s + (!s || !e.parent ? "" : this.sep) + t;
|
|
@@ -3304,23 +3553,23 @@ class PathBase {
|
|
|
3304
3553
|
return this.#Tt = i;
|
|
3305
3554
|
}
|
|
3306
3555
|
fullpathPosix() {
|
|
3307
|
-
if (this.#
|
|
3308
|
-
if (this.sep === "/") return this.#
|
|
3556
|
+
if (this.#At !== undefined) return this.#At;
|
|
3557
|
+
if (this.sep === "/") return this.#At = this.fullpath();
|
|
3309
3558
|
if (!this.parent) {
|
|
3310
3559
|
const t = this.fullpath().replace(/\\/g, "/");
|
|
3311
3560
|
if (/^[a-z]:\//i.test(t)) {
|
|
3312
|
-
return this.#
|
|
3561
|
+
return this.#At = `//?/${t}`;
|
|
3313
3562
|
} else {
|
|
3314
|
-
return this.#
|
|
3563
|
+
return this.#At = t;
|
|
3315
3564
|
}
|
|
3316
3565
|
}
|
|
3317
3566
|
const t = this.parent;
|
|
3318
3567
|
const e = t.fullpathPosix();
|
|
3319
3568
|
const s = e + (!e || !t.parent ? "" : "/") + this.name;
|
|
3320
|
-
return this.#
|
|
3569
|
+
return this.#At = s;
|
|
3321
3570
|
}
|
|
3322
3571
|
isUnknown() {
|
|
3323
|
-
return (this.#Pt &
|
|
3572
|
+
return (this.#Pt & Qt) === Ht;
|
|
3324
3573
|
}
|
|
3325
3574
|
isType(t) {
|
|
3326
3575
|
return this[`is${t}`]();
|
|
@@ -3329,34 +3578,34 @@ class PathBase {
|
|
|
3329
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";
|
|
3330
3579
|
}
|
|
3331
3580
|
isFile() {
|
|
3332
|
-
return (this.#Pt &
|
|
3581
|
+
return (this.#Pt & Qt) === Kt;
|
|
3333
3582
|
}
|
|
3334
3583
|
isDirectory() {
|
|
3335
|
-
return (this.#Pt &
|
|
3584
|
+
return (this.#Pt & Qt) === Vt;
|
|
3336
3585
|
}
|
|
3337
3586
|
isCharacterDevice() {
|
|
3338
|
-
return (this.#Pt &
|
|
3587
|
+
return (this.#Pt & Qt) === qt;
|
|
3339
3588
|
}
|
|
3340
3589
|
isBlockDevice() {
|
|
3341
|
-
return (this.#Pt &
|
|
3590
|
+
return (this.#Pt & Qt) === Jt;
|
|
3342
3591
|
}
|
|
3343
3592
|
isFIFO() {
|
|
3344
|
-
return (this.#Pt &
|
|
3593
|
+
return (this.#Pt & Qt) === Zt;
|
|
3345
3594
|
}
|
|
3346
3595
|
isSocket() {
|
|
3347
|
-
return (this.#Pt &
|
|
3596
|
+
return (this.#Pt & Qt) === Xt;
|
|
3348
3597
|
}
|
|
3349
3598
|
isSymbolicLink() {
|
|
3350
|
-
return (this.#Pt &
|
|
3599
|
+
return (this.#Pt & Yt) === Yt;
|
|
3351
3600
|
}
|
|
3352
3601
|
lstatCached() {
|
|
3353
|
-
return this.#Pt &
|
|
3602
|
+
return this.#Pt & se ? this : undefined;
|
|
3354
3603
|
}
|
|
3355
3604
|
readlinkCached() {
|
|
3356
3605
|
return this.#Rt;
|
|
3357
3606
|
}
|
|
3358
3607
|
realpathCached() {
|
|
3359
|
-
return this.#
|
|
3608
|
+
return this.#Ot;
|
|
3360
3609
|
}
|
|
3361
3610
|
readdirCached() {
|
|
3362
3611
|
const t = this.children();
|
|
@@ -3365,17 +3614,17 @@ class PathBase {
|
|
|
3365
3614
|
canReadlink() {
|
|
3366
3615
|
if (this.#Rt) return true;
|
|
3367
3616
|
if (!this.parent) return false;
|
|
3368
|
-
const t = this.#Pt &
|
|
3369
|
-
return !(t !==
|
|
3617
|
+
const t = this.#Pt & Qt;
|
|
3618
|
+
return !(t !== Ht && t !== Yt || this.#Pt & re || this.#Pt & ne);
|
|
3370
3619
|
}
|
|
3371
3620
|
calledReaddir() {
|
|
3372
|
-
return !!(this.#Pt &
|
|
3621
|
+
return !!(this.#Pt & ee);
|
|
3373
3622
|
}
|
|
3374
3623
|
isENOENT() {
|
|
3375
|
-
return !!(this.#Pt &
|
|
3624
|
+
return !!(this.#Pt & ne);
|
|
3376
3625
|
}
|
|
3377
3626
|
isNamed(t) {
|
|
3378
|
-
return !this.nocase ? this.#Et ===
|
|
3627
|
+
return !this.nocase ? this.#Et === normalize(t) : this.#Et === normalizeNocase(t);
|
|
3379
3628
|
}
|
|
3380
3629
|
async readlink() {
|
|
3381
3630
|
const t = this.#Rt;
|
|
@@ -3421,59 +3670,59 @@ class PathBase {
|
|
|
3421
3670
|
return undefined;
|
|
3422
3671
|
}
|
|
3423
3672
|
}
|
|
3424
|
-
#
|
|
3425
|
-
this.#Pt |=
|
|
3673
|
+
#Bt(t) {
|
|
3674
|
+
this.#Pt |= ee;
|
|
3426
3675
|
for (let e = t.provisional; e < t.length; e++) {
|
|
3427
3676
|
const s = t[e];
|
|
3428
|
-
if (s) s.#
|
|
3677
|
+
if (s) s.#Nt();
|
|
3429
3678
|
}
|
|
3430
3679
|
}
|
|
3431
|
-
#
|
|
3432
|
-
if (this.#Pt &
|
|
3433
|
-
this.#Pt = (this.#Pt |
|
|
3434
|
-
this.#
|
|
3680
|
+
#Nt() {
|
|
3681
|
+
if (this.#Pt & ne) return;
|
|
3682
|
+
this.#Pt = (this.#Pt | ne) & te;
|
|
3683
|
+
this.#It();
|
|
3435
3684
|
}
|
|
3436
|
-
#
|
|
3685
|
+
#It() {
|
|
3437
3686
|
const t = this.children();
|
|
3438
3687
|
t.provisional = 0;
|
|
3439
3688
|
for (const e of t) {
|
|
3440
|
-
e.#
|
|
3689
|
+
e.#Nt();
|
|
3441
3690
|
}
|
|
3442
3691
|
}
|
|
3443
|
-
#
|
|
3444
|
-
this.#Pt |=
|
|
3692
|
+
#Wt() {
|
|
3693
|
+
this.#Pt |= oe;
|
|
3445
3694
|
this.#_t();
|
|
3446
3695
|
}
|
|
3447
3696
|
#_t() {
|
|
3448
|
-
if (this.#Pt &
|
|
3697
|
+
if (this.#Pt & ie) return;
|
|
3449
3698
|
let t = this.#Pt;
|
|
3450
|
-
if ((t &
|
|
3451
|
-
this.#Pt = t |
|
|
3452
|
-
this.#
|
|
3699
|
+
if ((t & Qt) === Vt) t &= te;
|
|
3700
|
+
this.#Pt = t | ie;
|
|
3701
|
+
this.#It();
|
|
3453
3702
|
}
|
|
3454
3703
|
#jt(t = "") {
|
|
3455
3704
|
if (t === "ENOTDIR" || t === "EPERM") {
|
|
3456
3705
|
this.#_t();
|
|
3457
3706
|
} else if (t === "ENOENT") {
|
|
3458
|
-
this.#
|
|
3707
|
+
this.#Nt();
|
|
3459
3708
|
} else {
|
|
3460
3709
|
this.children().provisional = 0;
|
|
3461
3710
|
}
|
|
3462
3711
|
}
|
|
3463
|
-
|
|
3712
|
+
#$t(t = "") {
|
|
3464
3713
|
if (t === "ENOTDIR") {
|
|
3465
3714
|
const t = this.parent;
|
|
3466
3715
|
t.#_t();
|
|
3467
3716
|
} else if (t === "ENOENT") {
|
|
3468
|
-
this.#
|
|
3717
|
+
this.#Nt();
|
|
3469
3718
|
}
|
|
3470
3719
|
}
|
|
3471
3720
|
#Dt(t = "") {
|
|
3472
3721
|
let e = this.#Pt;
|
|
3473
|
-
e |=
|
|
3474
|
-
if (t === "ENOENT") e |=
|
|
3722
|
+
e |= re;
|
|
3723
|
+
if (t === "ENOENT") e |= ne;
|
|
3475
3724
|
if (t === "EINVAL" || t === "UNKNOWN") {
|
|
3476
|
-
e &=
|
|
3725
|
+
e &= te;
|
|
3477
3726
|
}
|
|
3478
3727
|
this.#Pt = e;
|
|
3479
3728
|
if (t === "ENOTDIR" && this.parent) {
|
|
@@ -3481,34 +3730,34 @@ class PathBase {
|
|
|
3481
3730
|
}
|
|
3482
3731
|
}
|
|
3483
3732
|
#Gt(t, e) {
|
|
3484
|
-
return this
|
|
3733
|
+
return this.#Ut(t, e) || this.#Ht(t, e);
|
|
3485
3734
|
}
|
|
3486
3735
|
#Ht(t, e) {
|
|
3487
|
-
const s =
|
|
3736
|
+
const s = entToType(t);
|
|
3488
3737
|
const i = this.newChild(t.name, s, {
|
|
3489
3738
|
parent: this
|
|
3490
3739
|
});
|
|
3491
|
-
const n = i.#Pt &
|
|
3492
|
-
if (n !==
|
|
3493
|
-
i.#Pt |=
|
|
3740
|
+
const n = i.#Pt & Qt;
|
|
3741
|
+
if (n !== Vt && n !== Yt && n !== Ht) {
|
|
3742
|
+
i.#Pt |= ie;
|
|
3494
3743
|
}
|
|
3495
3744
|
e.unshift(i);
|
|
3496
3745
|
e.provisional++;
|
|
3497
3746
|
return i;
|
|
3498
3747
|
}
|
|
3499
|
-
|
|
3748
|
+
#Ut(t, e) {
|
|
3500
3749
|
for (let s = e.provisional; s < e.length; s++) {
|
|
3501
3750
|
const i = e[s];
|
|
3502
|
-
const n = this.nocase ?
|
|
3751
|
+
const n = this.nocase ? normalizeNocase(t.name) : normalize(t.name);
|
|
3503
3752
|
if (n !== i.#Et) {
|
|
3504
3753
|
continue;
|
|
3505
3754
|
}
|
|
3506
|
-
return this.#
|
|
3755
|
+
return this.#Zt(t, i, s, e);
|
|
3507
3756
|
}
|
|
3508
3757
|
}
|
|
3509
|
-
#
|
|
3758
|
+
#Zt(t, e, s, i) {
|
|
3510
3759
|
const n = e.name;
|
|
3511
|
-
e.#Pt = e.#Pt &
|
|
3760
|
+
e.#Pt = e.#Pt & te | entToType(t);
|
|
3512
3761
|
if (n !== t.name) e.name = t.name;
|
|
3513
3762
|
if (s !== i.provisional) {
|
|
3514
3763
|
if (s === i.length - 1) i.pop(); else i.splice(s, 1);
|
|
@@ -3518,49 +3767,49 @@ class PathBase {
|
|
|
3518
3767
|
return e;
|
|
3519
3768
|
}
|
|
3520
3769
|
async lstat() {
|
|
3521
|
-
if ((this.#Pt &
|
|
3770
|
+
if ((this.#Pt & ne) === 0) {
|
|
3522
3771
|
try {
|
|
3523
|
-
this.#
|
|
3772
|
+
this.#qt(await this.#ot.promises.lstat(this.fullpath()));
|
|
3524
3773
|
return this;
|
|
3525
3774
|
} catch (t) {
|
|
3526
|
-
this
|
|
3775
|
+
this.#$t(t.code);
|
|
3527
3776
|
}
|
|
3528
3777
|
}
|
|
3529
3778
|
}
|
|
3530
3779
|
lstatSync() {
|
|
3531
|
-
if ((this.#Pt &
|
|
3780
|
+
if ((this.#Pt & ne) === 0) {
|
|
3532
3781
|
try {
|
|
3533
|
-
this.#
|
|
3782
|
+
this.#qt(this.#ot.lstatSync(this.fullpath()));
|
|
3534
3783
|
return this;
|
|
3535
3784
|
} catch (t) {
|
|
3536
|
-
this
|
|
3785
|
+
this.#$t(t.code);
|
|
3537
3786
|
}
|
|
3538
3787
|
}
|
|
3539
3788
|
}
|
|
3540
|
-
#
|
|
3541
|
-
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:
|
|
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: y, size: w, uid: b} = t;
|
|
3542
3791
|
this.#St = e;
|
|
3543
3792
|
this.#mt = s;
|
|
3544
|
-
this.#
|
|
3793
|
+
this.#vt = i;
|
|
3545
3794
|
this.#bt = n;
|
|
3546
3795
|
this.#dt = r;
|
|
3547
3796
|
this.#gt = o;
|
|
3548
|
-
this.#
|
|
3549
|
-
this.#
|
|
3797
|
+
this.#xt = h;
|
|
3798
|
+
this.#wt = a;
|
|
3550
3799
|
this.#ht = l;
|
|
3551
3800
|
this.#ft = c;
|
|
3552
3801
|
this.#pt = f;
|
|
3553
3802
|
this.#at = u;
|
|
3554
3803
|
this.#kt = d;
|
|
3555
|
-
this.#
|
|
3804
|
+
this.#yt = p;
|
|
3556
3805
|
this.#lt = g;
|
|
3557
|
-
this.#ut =
|
|
3558
|
-
this.#
|
|
3559
|
-
this.#ct =
|
|
3560
|
-
const
|
|
3561
|
-
this.#Pt = this.#Pt &
|
|
3562
|
-
if (
|
|
3563
|
-
this.#Pt |=
|
|
3806
|
+
this.#ut = y;
|
|
3807
|
+
this.#v = w;
|
|
3808
|
+
this.#ct = b;
|
|
3809
|
+
const S = entToType(t);
|
|
3810
|
+
this.#Pt = this.#Pt & te | S | se;
|
|
3811
|
+
if (S !== Ht && S !== Vt && S !== Yt) {
|
|
3812
|
+
this.#Pt |= ie;
|
|
3564
3813
|
}
|
|
3565
3814
|
}
|
|
3566
3815
|
#Vt=[];
|
|
@@ -3598,7 +3847,7 @@ class PathBase {
|
|
|
3598
3847
|
for (const t of e) {
|
|
3599
3848
|
this.#Gt(t, s);
|
|
3600
3849
|
}
|
|
3601
|
-
this.#
|
|
3850
|
+
this.#Bt(s);
|
|
3602
3851
|
}
|
|
3603
3852
|
this.#Kt(s.slice(0, s.provisional));
|
|
3604
3853
|
return;
|
|
@@ -3617,21 +3866,21 @@ class PathBase {
|
|
|
3617
3866
|
if (this.#Yt) {
|
|
3618
3867
|
await this.#Yt;
|
|
3619
3868
|
} else {
|
|
3620
|
-
let
|
|
3621
|
-
this.#Yt = new Promise((t =>
|
|
3869
|
+
let resolve = () => {};
|
|
3870
|
+
this.#Yt = new Promise((t => resolve = t));
|
|
3622
3871
|
try {
|
|
3623
3872
|
for (const s of await this.#ot.promises.readdir(e, {
|
|
3624
3873
|
withFileTypes: true
|
|
3625
3874
|
})) {
|
|
3626
3875
|
this.#Gt(s, t);
|
|
3627
3876
|
}
|
|
3628
|
-
this.#
|
|
3877
|
+
this.#Bt(t);
|
|
3629
3878
|
} catch (e) {
|
|
3630
3879
|
this.#jt(e.code);
|
|
3631
3880
|
t.provisional = 0;
|
|
3632
3881
|
}
|
|
3633
3882
|
this.#Yt = undefined;
|
|
3634
|
-
|
|
3883
|
+
resolve();
|
|
3635
3884
|
}
|
|
3636
3885
|
return t.slice(0, t.provisional);
|
|
3637
3886
|
}
|
|
@@ -3650,7 +3899,7 @@ class PathBase {
|
|
|
3650
3899
|
})) {
|
|
3651
3900
|
this.#Gt(s, t);
|
|
3652
3901
|
}
|
|
3653
|
-
this.#
|
|
3902
|
+
this.#Bt(t);
|
|
3654
3903
|
} catch (e) {
|
|
3655
3904
|
this.#jt(e.code);
|
|
3656
3905
|
t.provisional = 0;
|
|
@@ -3658,37 +3907,37 @@ class PathBase {
|
|
|
3658
3907
|
return t.slice(0, t.provisional);
|
|
3659
3908
|
}
|
|
3660
3909
|
canReaddir() {
|
|
3661
|
-
if (this.#Pt &
|
|
3662
|
-
const t =
|
|
3663
|
-
if (!(t ===
|
|
3910
|
+
if (this.#Pt & he) return false;
|
|
3911
|
+
const t = Qt & this.#Pt;
|
|
3912
|
+
if (!(t === Ht || t === Vt || t === Yt)) {
|
|
3664
3913
|
return false;
|
|
3665
3914
|
}
|
|
3666
3915
|
return true;
|
|
3667
3916
|
}
|
|
3668
3917
|
shouldWalk(t, e) {
|
|
3669
|
-
return (this.#Pt &
|
|
3918
|
+
return (this.#Pt & Vt) === Vt && !(this.#Pt & he) && !t.has(this) && (!e || e(this));
|
|
3670
3919
|
}
|
|
3671
3920
|
async realpath() {
|
|
3672
|
-
if (this.#
|
|
3673
|
-
if ((
|
|
3921
|
+
if (this.#Ot) return this.#Ot;
|
|
3922
|
+
if ((oe | re | ne) & this.#Pt) return undefined;
|
|
3674
3923
|
try {
|
|
3675
3924
|
const t = await this.#ot.promises.realpath(this.fullpath());
|
|
3676
|
-
return this.#
|
|
3925
|
+
return this.#Ot = this.resolve(t);
|
|
3677
3926
|
} catch (t) {
|
|
3678
|
-
this.#
|
|
3927
|
+
this.#Wt();
|
|
3679
3928
|
}
|
|
3680
3929
|
}
|
|
3681
3930
|
realpathSync() {
|
|
3682
|
-
if (this.#
|
|
3683
|
-
if ((
|
|
3931
|
+
if (this.#Ot) return this.#Ot;
|
|
3932
|
+
if ((oe | re | ne) & this.#Pt) return undefined;
|
|
3684
3933
|
try {
|
|
3685
3934
|
const t = this.#ot.realpathSync(this.fullpath());
|
|
3686
|
-
return this.#
|
|
3935
|
+
return this.#Ot = this.resolve(t);
|
|
3687
3936
|
} catch (t) {
|
|
3688
|
-
this.#
|
|
3937
|
+
this.#Wt();
|
|
3689
3938
|
}
|
|
3690
3939
|
}
|
|
3691
|
-
[
|
|
3940
|
+
[fe](t) {
|
|
3692
3941
|
if (t === this) return;
|
|
3693
3942
|
t.isCWD = false;
|
|
3694
3943
|
this.isCWD = true;
|
|
@@ -3697,14 +3946,14 @@ class PathBase {
|
|
|
3697
3946
|
let i = this;
|
|
3698
3947
|
while (i && i.parent) {
|
|
3699
3948
|
e.add(i);
|
|
3700
|
-
i.#
|
|
3949
|
+
i.#Lt = s.join(this.sep);
|
|
3701
3950
|
i.#Mt = s.join("/");
|
|
3702
3951
|
i = i.parent;
|
|
3703
3952
|
s.push("..");
|
|
3704
3953
|
}
|
|
3705
3954
|
i = t;
|
|
3706
3955
|
while (i && i.parent && !e.has(i)) {
|
|
3707
|
-
i.#
|
|
3956
|
+
i.#Lt = undefined;
|
|
3708
3957
|
i.#Mt = undefined;
|
|
3709
3958
|
i = i.parent;
|
|
3710
3959
|
}
|
|
@@ -3713,18 +3962,18 @@ class PathBase {
|
|
|
3713
3962
|
|
|
3714
3963
|
class PathWin32 extends PathBase {
|
|
3715
3964
|
sep="\\";
|
|
3716
|
-
splitSep=
|
|
3717
|
-
constructor(t, e =
|
|
3965
|
+
splitSep=Ut;
|
|
3966
|
+
constructor(t, e = Ht, s, i, n, r, o) {
|
|
3718
3967
|
super(t, e, s, i, n, r, o);
|
|
3719
3968
|
}
|
|
3720
|
-
newChild(t, e =
|
|
3969
|
+
newChild(t, e = Ht, s = {}) {
|
|
3721
3970
|
return new PathWin32(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
3722
3971
|
}
|
|
3723
3972
|
getRootString(t) {
|
|
3724
|
-
return
|
|
3973
|
+
return e.parse(t).root;
|
|
3725
3974
|
}
|
|
3726
3975
|
getRoot(t) {
|
|
3727
|
-
t =
|
|
3976
|
+
t = uncToDrive(t.toUpperCase());
|
|
3728
3977
|
if (t === this.root.name) {
|
|
3729
3978
|
return this.root;
|
|
3730
3979
|
}
|
|
@@ -3736,7 +3985,7 @@ class PathWin32 extends PathBase {
|
|
|
3736
3985
|
return this.roots[t] = new PathScurryWin32(t, this).root;
|
|
3737
3986
|
}
|
|
3738
3987
|
sameRoot(t, e = this.root.name) {
|
|
3739
|
-
t = t.toUpperCase().replace(/\//g, "\\").replace(
|
|
3988
|
+
t = t.toUpperCase().replace(/\//g, "\\").replace(Gt, "$1\\");
|
|
3740
3989
|
return t === e;
|
|
3741
3990
|
}
|
|
3742
3991
|
}
|
|
@@ -3744,7 +3993,7 @@ class PathWin32 extends PathBase {
|
|
|
3744
3993
|
class PathPosix extends PathBase {
|
|
3745
3994
|
splitSep="/";
|
|
3746
3995
|
sep="/";
|
|
3747
|
-
constructor(t, e =
|
|
3996
|
+
constructor(t, e = Ht, s, i, n, r, o) {
|
|
3748
3997
|
super(t, e, s, i, n, r, o);
|
|
3749
3998
|
}
|
|
3750
3999
|
getRootString(t) {
|
|
@@ -3753,7 +4002,7 @@ class PathPosix extends PathBase {
|
|
|
3753
4002
|
getRoot(t) {
|
|
3754
4003
|
return this.root;
|
|
3755
4004
|
}
|
|
3756
|
-
newChild(t, e =
|
|
4005
|
+
newChild(t, e = Ht, s = {}) {
|
|
3757
4006
|
return new PathPosix(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
3758
4007
|
}
|
|
3759
4008
|
}
|
|
@@ -3768,12 +4017,12 @@ class PathScurryBase {
|
|
|
3768
4017
|
#Ft;
|
|
3769
4018
|
nocase;
|
|
3770
4019
|
#ot;
|
|
3771
|
-
constructor(
|
|
3772
|
-
this.#ot =
|
|
3773
|
-
if (
|
|
3774
|
-
|
|
4020
|
+
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o = $t} = {}) {
|
|
4021
|
+
this.#ot = fsFromOption(o);
|
|
4022
|
+
if (e instanceof URL || e.startsWith("file://")) {
|
|
4023
|
+
e = t(e);
|
|
3775
4024
|
}
|
|
3776
|
-
const h = s.resolve(
|
|
4025
|
+
const h = s.resolve(e);
|
|
3777
4026
|
this.roots = Object.create(null);
|
|
3778
4027
|
this.rootPath = this.parseRootPath(h);
|
|
3779
4028
|
this.#Xt = new ResolveCache;
|
|
@@ -3982,38 +4231,38 @@ class PathScurryBase {
|
|
|
3982
4231
|
o.push(s ? t : t.fullpath());
|
|
3983
4232
|
}
|
|
3984
4233
|
const h = new Set;
|
|
3985
|
-
const
|
|
4234
|
+
const walk = (t, e) => {
|
|
3986
4235
|
h.add(t);
|
|
3987
|
-
t.readdirCB(((t,
|
|
4236
|
+
t.readdirCB(((t, a) => {
|
|
3988
4237
|
if (t) {
|
|
3989
4238
|
return e(t);
|
|
3990
4239
|
}
|
|
3991
|
-
let
|
|
3992
|
-
if (!
|
|
3993
|
-
const
|
|
3994
|
-
if (--
|
|
4240
|
+
let l = a.length;
|
|
4241
|
+
if (!l) return e();
|
|
4242
|
+
const next = () => {
|
|
4243
|
+
if (--l === 0) {
|
|
3995
4244
|
e();
|
|
3996
4245
|
}
|
|
3997
4246
|
};
|
|
3998
|
-
for (const t of
|
|
4247
|
+
for (const t of a) {
|
|
3999
4248
|
if (!n || n(t)) {
|
|
4000
4249
|
o.push(s ? t : t.fullpath());
|
|
4001
4250
|
}
|
|
4002
4251
|
if (i && t.isSymbolicLink()) {
|
|
4003
|
-
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) ? walk(t, next) : next()));
|
|
4004
4253
|
} else {
|
|
4005
4254
|
if (t.shouldWalk(h, r)) {
|
|
4006
|
-
|
|
4255
|
+
walk(t, next);
|
|
4007
4256
|
} else {
|
|
4008
|
-
|
|
4257
|
+
next();
|
|
4009
4258
|
}
|
|
4010
4259
|
}
|
|
4011
4260
|
}
|
|
4012
4261
|
}), true);
|
|
4013
4262
|
};
|
|
4014
|
-
const
|
|
4263
|
+
const a = t;
|
|
4015
4264
|
return new Promise(((t, e) => {
|
|
4016
|
-
a
|
|
4265
|
+
walk(a, (s => {
|
|
4017
4266
|
if (s) return e(s);
|
|
4018
4267
|
t(o);
|
|
4019
4268
|
}));
|
|
@@ -4111,7 +4360,7 @@ class PathScurryBase {
|
|
|
4111
4360
|
const h = new Set;
|
|
4112
4361
|
const a = [ t ];
|
|
4113
4362
|
let l = 0;
|
|
4114
|
-
const
|
|
4363
|
+
const process = () => {
|
|
4115
4364
|
let t = false;
|
|
4116
4365
|
while (!t) {
|
|
4117
4366
|
const e = a.shift();
|
|
@@ -4121,21 +4370,21 @@ class PathScurryBase {
|
|
|
4121
4370
|
}
|
|
4122
4371
|
l++;
|
|
4123
4372
|
h.add(e);
|
|
4124
|
-
const
|
|
4373
|
+
const onReaddir = (e, f, u = false) => {
|
|
4125
4374
|
if (e) return o.emit("error", e);
|
|
4126
|
-
if (i && !
|
|
4375
|
+
if (i && !u) {
|
|
4127
4376
|
const t = [];
|
|
4128
|
-
for (const e of
|
|
4377
|
+
for (const e of f) {
|
|
4129
4378
|
if (e.isSymbolicLink()) {
|
|
4130
4379
|
t.push(e.realpath().then((t => t?.isUnknown() ? t.lstat() : t)));
|
|
4131
4380
|
}
|
|
4132
4381
|
}
|
|
4133
4382
|
if (t.length) {
|
|
4134
|
-
Promise.all(t).then((() =>
|
|
4383
|
+
Promise.all(t).then((() => onReaddir(null, f, true)));
|
|
4135
4384
|
return;
|
|
4136
4385
|
}
|
|
4137
4386
|
}
|
|
4138
|
-
for (const e of
|
|
4387
|
+
for (const e of f) {
|
|
4139
4388
|
if (e && (!n || n(e))) {
|
|
4140
4389
|
if (!o.write(s ? e : e.fullpath())) {
|
|
4141
4390
|
t = true;
|
|
@@ -4143,24 +4392,24 @@ class PathScurryBase {
|
|
|
4143
4392
|
}
|
|
4144
4393
|
}
|
|
4145
4394
|
l--;
|
|
4146
|
-
for (const t of
|
|
4395
|
+
for (const t of f) {
|
|
4147
4396
|
const e = t.realpathCached() || t;
|
|
4148
4397
|
if (e.shouldWalk(h, r)) {
|
|
4149
4398
|
a.push(e);
|
|
4150
4399
|
}
|
|
4151
4400
|
}
|
|
4152
4401
|
if (t && !o.flowing) {
|
|
4153
|
-
o.once("drain",
|
|
4154
|
-
} else if (!
|
|
4155
|
-
|
|
4402
|
+
o.once("drain", process);
|
|
4403
|
+
} else if (!c) {
|
|
4404
|
+
process();
|
|
4156
4405
|
}
|
|
4157
4406
|
};
|
|
4158
|
-
let
|
|
4159
|
-
e.readdirCB(
|
|
4160
|
-
|
|
4407
|
+
let c = true;
|
|
4408
|
+
e.readdirCB(onReaddir, true);
|
|
4409
|
+
c = false;
|
|
4161
4410
|
}
|
|
4162
4411
|
};
|
|
4163
|
-
|
|
4412
|
+
process();
|
|
4164
4413
|
return o;
|
|
4165
4414
|
}
|
|
4166
4415
|
streamSync(t = this.cwd, e = {}) {
|
|
@@ -4180,7 +4429,7 @@ class PathScurryBase {
|
|
|
4180
4429
|
}
|
|
4181
4430
|
const a = [ t ];
|
|
4182
4431
|
let l = 0;
|
|
4183
|
-
const
|
|
4432
|
+
const process = () => {
|
|
4184
4433
|
let t = false;
|
|
4185
4434
|
while (!t) {
|
|
4186
4435
|
const e = a.shift();
|
|
@@ -4210,24 +4459,24 @@ class PathScurryBase {
|
|
|
4210
4459
|
}
|
|
4211
4460
|
}
|
|
4212
4461
|
}
|
|
4213
|
-
if (t && !o.flowing) o.once("drain",
|
|
4462
|
+
if (t && !o.flowing) o.once("drain", process);
|
|
4214
4463
|
};
|
|
4215
|
-
|
|
4464
|
+
process();
|
|
4216
4465
|
return o;
|
|
4217
4466
|
}
|
|
4218
4467
|
chdir(t = this.cwd) {
|
|
4219
4468
|
const e = this.cwd;
|
|
4220
4469
|
this.cwd = typeof t === "string" ? this.cwd.resolve(t) : t;
|
|
4221
|
-
this.cwd[
|
|
4470
|
+
this.cwd[fe](e);
|
|
4222
4471
|
}
|
|
4223
4472
|
}
|
|
4224
4473
|
|
|
4225
4474
|
class PathScurryWin32 extends PathScurryBase {
|
|
4226
4475
|
sep="\\";
|
|
4227
|
-
constructor(t = process.cwd(),
|
|
4228
|
-
const {nocase: i = true} =
|
|
4229
|
-
super(t,
|
|
4230
|
-
...
|
|
4476
|
+
constructor(t = process.cwd(), s = {}) {
|
|
4477
|
+
const {nocase: i = true} = s;
|
|
4478
|
+
super(t, e, "\\", {
|
|
4479
|
+
...s,
|
|
4231
4480
|
nocase: i
|
|
4232
4481
|
});
|
|
4233
4482
|
this.nocase = i;
|
|
@@ -4236,10 +4485,10 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4236
4485
|
}
|
|
4237
4486
|
}
|
|
4238
4487
|
parseRootPath(t) {
|
|
4239
|
-
return
|
|
4488
|
+
return e.parse(t).root.toUpperCase();
|
|
4240
4489
|
}
|
|
4241
4490
|
newRoot(t) {
|
|
4242
|
-
return new PathWin32(this.rootPath,
|
|
4491
|
+
return new PathWin32(this.rootPath, Vt, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4243
4492
|
fs: t
|
|
4244
4493
|
});
|
|
4245
4494
|
}
|
|
@@ -4251,18 +4500,18 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4251
4500
|
class PathScurryPosix extends PathScurryBase {
|
|
4252
4501
|
sep="/";
|
|
4253
4502
|
constructor(t = process.cwd(), e = {}) {
|
|
4254
|
-
const {nocase:
|
|
4255
|
-
super(t,
|
|
4503
|
+
const {nocase: i = false} = e;
|
|
4504
|
+
super(t, s, "/", {
|
|
4256
4505
|
...e,
|
|
4257
|
-
nocase:
|
|
4506
|
+
nocase: i
|
|
4258
4507
|
});
|
|
4259
|
-
this.nocase =
|
|
4508
|
+
this.nocase = i;
|
|
4260
4509
|
}
|
|
4261
4510
|
parseRootPath(t) {
|
|
4262
4511
|
return "/";
|
|
4263
4512
|
}
|
|
4264
4513
|
newRoot(t) {
|
|
4265
|
-
return new PathPosix(this.rootPath,
|
|
4514
|
+
return new PathPosix(this.rootPath, Vt, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4266
4515
|
fs: t
|
|
4267
4516
|
});
|
|
4268
4517
|
}
|
|
@@ -4281,13 +4530,13 @@ class PathScurryDarwin extends PathScurryPosix {
|
|
|
4281
4530
|
}
|
|
4282
4531
|
}
|
|
4283
4532
|
|
|
4284
|
-
const
|
|
4533
|
+
const ue = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
4285
4534
|
|
|
4286
|
-
const
|
|
4535
|
+
const de = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
4287
4536
|
|
|
4288
|
-
const
|
|
4537
|
+
const isPatternList = t => t.length >= 1;
|
|
4289
4538
|
|
|
4290
|
-
const
|
|
4539
|
+
const isGlobList = t => t.length >= 1;
|
|
4291
4540
|
|
|
4292
4541
|
class Pattern {
|
|
4293
4542
|
#te;
|
|
@@ -4302,10 +4551,10 @@ class Pattern {
|
|
|
4302
4551
|
#ae;
|
|
4303
4552
|
#le=true;
|
|
4304
4553
|
constructor(t, e, s, i) {
|
|
4305
|
-
if (!
|
|
4554
|
+
if (!isPatternList(t)) {
|
|
4306
4555
|
throw new TypeError("empty pattern list");
|
|
4307
4556
|
}
|
|
4308
|
-
if (!
|
|
4557
|
+
if (!isGlobList(e)) {
|
|
4309
4558
|
throw new TypeError("empty glob list");
|
|
4310
4559
|
}
|
|
4311
4560
|
if (e.length !== t.length) {
|
|
@@ -4354,7 +4603,7 @@ class Pattern {
|
|
|
4354
4603
|
return typeof this.#te[this.#se] === "string";
|
|
4355
4604
|
}
|
|
4356
4605
|
isGlobstar() {
|
|
4357
|
-
return this.#te[this.#se] ===
|
|
4606
|
+
return this.#te[this.#se] === Y;
|
|
4358
4607
|
}
|
|
4359
4608
|
isRegExp() {
|
|
4360
4609
|
return this.#te[this.#se] instanceof RegExp;
|
|
@@ -4400,7 +4649,7 @@ class Pattern {
|
|
|
4400
4649
|
}
|
|
4401
4650
|
}
|
|
4402
4651
|
|
|
4403
|
-
const
|
|
4652
|
+
const pe = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
4404
4653
|
|
|
4405
4654
|
class Ignore {
|
|
4406
4655
|
relative;
|
|
@@ -4409,7 +4658,7 @@ class Ignore {
|
|
|
4409
4658
|
absoluteChildren;
|
|
4410
4659
|
platform;
|
|
4411
4660
|
mmopts;
|
|
4412
|
-
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 = pe}) {
|
|
4413
4662
|
this.relative = [];
|
|
4414
4663
|
this.absolute = [];
|
|
4415
4664
|
this.relativeChildren = [];
|
|
@@ -4585,7 +4834,7 @@ class Processor {
|
|
|
4585
4834
|
const e = n === ".." || n === "" || n === ".";
|
|
4586
4835
|
this.matches.add(t.resolve(n), i, e);
|
|
4587
4836
|
continue;
|
|
4588
|
-
} else if (n ===
|
|
4837
|
+
} else if (n === Y) {
|
|
4589
4838
|
if (!t.isSymbolicLink() || this.follow || e.checkFollowGlobstar()) {
|
|
4590
4839
|
this.subwalks.add(t, e);
|
|
4591
4840
|
}
|
|
@@ -4621,7 +4870,7 @@ class Processor {
|
|
|
4621
4870
|
const s = e.isAbsolute();
|
|
4622
4871
|
const n = e.pattern();
|
|
4623
4872
|
const r = e.rest();
|
|
4624
|
-
if (n ===
|
|
4873
|
+
if (n === Y) {
|
|
4625
4874
|
i.testGlobstar(t, e, r, s);
|
|
4626
4875
|
} else if (n instanceof RegExp) {
|
|
4627
4876
|
i.testRegExp(t, n, r, s);
|
|
@@ -4679,7 +4928,7 @@ class Processor {
|
|
|
4679
4928
|
}
|
|
4680
4929
|
}
|
|
4681
4930
|
|
|
4682
|
-
const
|
|
4931
|
+
const makeIgnore = (t, e) => typeof t === "string" ? new Ignore([ t ], e) : Array.isArray(t) ? new Ignore(t, e) : t;
|
|
4683
4932
|
|
|
4684
4933
|
class GlobUtil {
|
|
4685
4934
|
path;
|
|
@@ -4701,7 +4950,7 @@ class GlobUtil {
|
|
|
4701
4950
|
this.#ue = !s.posix && s.platform === "win32" ? "\\" : "/";
|
|
4702
4951
|
this.includeChildMatches = s.includeChildMatches !== false;
|
|
4703
4952
|
if (s.ignore || !this.includeChildMatches) {
|
|
4704
|
-
this.#fe =
|
|
4953
|
+
this.#fe = makeIgnore(s.ignore ?? [], s);
|
|
4705
4954
|
if (!this.includeChildMatches && typeof this.#fe.add !== "function") {
|
|
4706
4955
|
const t = "cannot ignore child matches, ignore lacks add() method.";
|
|
4707
4956
|
throw new Error(t);
|
|
@@ -4820,13 +5069,13 @@ class GlobUtil {
|
|
|
4820
5069
|
}
|
|
4821
5070
|
s.processPatterns(t, e);
|
|
4822
5071
|
let n = 1;
|
|
4823
|
-
const
|
|
5072
|
+
const next = () => {
|
|
4824
5073
|
if (--n === 0) i();
|
|
4825
5074
|
};
|
|
4826
5075
|
for (const [t, e, i] of s.matches.entries()) {
|
|
4827
5076
|
if (this.#de(t)) continue;
|
|
4828
5077
|
n++;
|
|
4829
|
-
this.match(t, e, i).then((() =>
|
|
5078
|
+
this.match(t, e, i).then((() => next()));
|
|
4830
5079
|
}
|
|
4831
5080
|
for (const t of s.subwalkTargets()) {
|
|
4832
5081
|
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
|
@@ -4834,28 +5083,28 @@ class GlobUtil {
|
|
|
4834
5083
|
}
|
|
4835
5084
|
n++;
|
|
4836
5085
|
const e = t.readdirCached();
|
|
4837
|
-
if (t.calledReaddir()) this.walkCB3(t, e, s,
|
|
4838
|
-
t.readdirCB(((e, i) => this.walkCB3(t, i, s,
|
|
5086
|
+
if (t.calledReaddir()) this.walkCB3(t, e, s, next); else {
|
|
5087
|
+
t.readdirCB(((e, i) => this.walkCB3(t, i, s, next)), true);
|
|
4839
5088
|
}
|
|
4840
5089
|
}
|
|
4841
|
-
|
|
5090
|
+
next();
|
|
4842
5091
|
}
|
|
4843
5092
|
walkCB3(t, e, s, i) {
|
|
4844
5093
|
s = s.filterEntries(t, e);
|
|
4845
5094
|
let n = 1;
|
|
4846
|
-
const
|
|
5095
|
+
const next = () => {
|
|
4847
5096
|
if (--n === 0) i();
|
|
4848
5097
|
};
|
|
4849
5098
|
for (const [t, e, i] of s.matches.entries()) {
|
|
4850
5099
|
if (this.#de(t)) continue;
|
|
4851
5100
|
n++;
|
|
4852
|
-
this.match(t, e, i).then((() =>
|
|
5101
|
+
this.match(t, e, i).then((() => next()));
|
|
4853
5102
|
}
|
|
4854
5103
|
for (const [t, e] of s.subwalks.entries()) {
|
|
4855
5104
|
n++;
|
|
4856
|
-
this.walkCB2(t, e, s.child(),
|
|
5105
|
+
this.walkCB2(t, e, s.child(), next);
|
|
4857
5106
|
}
|
|
4858
|
-
|
|
5107
|
+
next();
|
|
4859
5108
|
}
|
|
4860
5109
|
walkCBSync(t, e, s) {
|
|
4861
5110
|
if (this.signal?.aborted) s();
|
|
@@ -4870,7 +5119,7 @@ class GlobUtil {
|
|
|
4870
5119
|
}
|
|
4871
5120
|
s.processPatterns(t, e);
|
|
4872
5121
|
let n = 1;
|
|
4873
|
-
const
|
|
5122
|
+
const next = () => {
|
|
4874
5123
|
if (--n === 0) i();
|
|
4875
5124
|
};
|
|
4876
5125
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -4883,14 +5132,14 @@ class GlobUtil {
|
|
|
4883
5132
|
}
|
|
4884
5133
|
n++;
|
|
4885
5134
|
const e = t.readdirSync();
|
|
4886
|
-
this.walkCB3Sync(t, e, s,
|
|
5135
|
+
this.walkCB3Sync(t, e, s, next);
|
|
4887
5136
|
}
|
|
4888
|
-
|
|
5137
|
+
next();
|
|
4889
5138
|
}
|
|
4890
5139
|
walkCB3Sync(t, e, s, i) {
|
|
4891
5140
|
s = s.filterEntries(t, e);
|
|
4892
5141
|
let n = 1;
|
|
4893
|
-
const
|
|
5142
|
+
const next = () => {
|
|
4894
5143
|
if (--n === 0) i();
|
|
4895
5144
|
};
|
|
4896
5145
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -4899,9 +5148,9 @@ class GlobUtil {
|
|
|
4899
5148
|
}
|
|
4900
5149
|
for (const [t, e] of s.subwalks.entries()) {
|
|
4901
5150
|
n++;
|
|
4902
|
-
this.walkCB2Sync(t, e, s.child(),
|
|
5151
|
+
this.walkCB2Sync(t, e, s.child(), next);
|
|
4903
5152
|
}
|
|
4904
|
-
|
|
5153
|
+
next();
|
|
4905
5154
|
}
|
|
4906
5155
|
}
|
|
4907
5156
|
|
|
@@ -4976,9 +5225,9 @@ class GlobStream extends GlobUtil {
|
|
|
4976
5225
|
}
|
|
4977
5226
|
}
|
|
4978
5227
|
|
|
4979
|
-
const
|
|
5228
|
+
const ge = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
4980
5229
|
|
|
4981
|
-
let
|
|
5230
|
+
let me = class Glob {
|
|
4982
5231
|
absolute;
|
|
4983
5232
|
cwd;
|
|
4984
5233
|
root;
|
|
@@ -5006,7 +5255,7 @@ let es = class Glob {
|
|
|
5006
5255
|
includeChildMatches;
|
|
5007
5256
|
opts;
|
|
5008
5257
|
patterns;
|
|
5009
|
-
constructor(
|
|
5258
|
+
constructor(e, s) {
|
|
5010
5259
|
if (!s) throw new TypeError("glob options required");
|
|
5011
5260
|
this.withFileTypes = !!s.withFileTypes;
|
|
5012
5261
|
this.signal = s.signal;
|
|
@@ -5018,7 +5267,7 @@ let es = class Glob {
|
|
|
5018
5267
|
if (!s.cwd) {
|
|
5019
5268
|
this.cwd = "";
|
|
5020
5269
|
} else if (s.cwd instanceof URL || s.cwd.startsWith("file://")) {
|
|
5021
|
-
s.cwd =
|
|
5270
|
+
s.cwd = t(s.cwd);
|
|
5022
5271
|
}
|
|
5023
5272
|
this.cwd = s.cwd || "";
|
|
5024
5273
|
this.root = s.root;
|
|
@@ -5036,21 +5285,21 @@ let es = class Glob {
|
|
|
5036
5285
|
if (this.withFileTypes && this.absolute !== undefined) {
|
|
5037
5286
|
throw new Error("cannot set absolute and withFileTypes:true");
|
|
5038
5287
|
}
|
|
5039
|
-
if (typeof
|
|
5040
|
-
|
|
5288
|
+
if (typeof e === "string") {
|
|
5289
|
+
e = [ e ];
|
|
5041
5290
|
}
|
|
5042
5291
|
this.windowsPathsNoEscape = !!s.windowsPathsNoEscape || s.allowWindowsEscape === false;
|
|
5043
5292
|
if (this.windowsPathsNoEscape) {
|
|
5044
|
-
|
|
5293
|
+
e = e.map((t => t.replace(/\\/g, "/")));
|
|
5045
5294
|
}
|
|
5046
5295
|
if (this.matchBase) {
|
|
5047
5296
|
if (s.noglobstar) {
|
|
5048
5297
|
throw new TypeError("base matching requires globstar");
|
|
5049
5298
|
}
|
|
5050
|
-
|
|
5299
|
+
e = e.map((t => t.includes("/") ? t : `./**/${t}`));
|
|
5051
5300
|
}
|
|
5052
|
-
this.pattern =
|
|
5053
|
-
this.platform = s.platform ||
|
|
5301
|
+
this.pattern = e;
|
|
5302
|
+
this.platform = s.platform || ge;
|
|
5054
5303
|
this.opts = {
|
|
5055
5304
|
...s,
|
|
5056
5305
|
platform: this.platform
|
|
@@ -5061,7 +5310,7 @@ let es = class Glob {
|
|
|
5061
5310
|
throw new Error("nocase option contradicts provided scurry option");
|
|
5062
5311
|
}
|
|
5063
5312
|
} else {
|
|
5064
|
-
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 : de;
|
|
5065
5314
|
this.scurry = new t(this.cwd, {
|
|
5066
5315
|
nocase: s.nocase,
|
|
5067
5316
|
fs: s.fs
|
|
@@ -5146,7 +5395,7 @@ let es = class Glob {
|
|
|
5146
5395
|
}
|
|
5147
5396
|
};
|
|
5148
5397
|
|
|
5149
|
-
const
|
|
5398
|
+
const hasMagic = (t, e = {}) => {
|
|
5150
5399
|
if (!Array.isArray(t)) {
|
|
5151
5400
|
t = [ t ];
|
|
5152
5401
|
}
|
|
@@ -5156,69 +5405,69 @@ const ss = (t, e = {}) => {
|
|
|
5156
5405
|
return false;
|
|
5157
5406
|
};
|
|
5158
5407
|
|
|
5159
|
-
function
|
|
5160
|
-
return new
|
|
5408
|
+
function globStreamSync(t, e = {}) {
|
|
5409
|
+
return new me(t, e).streamSync();
|
|
5161
5410
|
}
|
|
5162
5411
|
|
|
5163
|
-
function
|
|
5164
|
-
return new
|
|
5412
|
+
function globStream(t, e = {}) {
|
|
5413
|
+
return new me(t, e).stream();
|
|
5165
5414
|
}
|
|
5166
5415
|
|
|
5167
|
-
function
|
|
5168
|
-
return new
|
|
5416
|
+
function globSync(t, e = {}) {
|
|
5417
|
+
return new me(t, e).walkSync();
|
|
5169
5418
|
}
|
|
5170
5419
|
|
|
5171
|
-
async function
|
|
5172
|
-
return new
|
|
5420
|
+
async function glob_(t, e = {}) {
|
|
5421
|
+
return new me(t, e).walk();
|
|
5173
5422
|
}
|
|
5174
5423
|
|
|
5175
|
-
function
|
|
5176
|
-
return new
|
|
5424
|
+
function globIterateSync(t, e = {}) {
|
|
5425
|
+
return new me(t, e).iterateSync();
|
|
5177
5426
|
}
|
|
5178
5427
|
|
|
5179
|
-
function
|
|
5180
|
-
return new
|
|
5428
|
+
function globIterate(t, e = {}) {
|
|
5429
|
+
return new me(t, e).iterate();
|
|
5181
5430
|
}
|
|
5182
5431
|
|
|
5183
|
-
const
|
|
5432
|
+
const ye = globStreamSync;
|
|
5184
5433
|
|
|
5185
|
-
const
|
|
5186
|
-
sync:
|
|
5434
|
+
const we = Object.assign(globStream, {
|
|
5435
|
+
sync: globStreamSync
|
|
5187
5436
|
});
|
|
5188
5437
|
|
|
5189
|
-
const
|
|
5438
|
+
const be = globIterateSync;
|
|
5190
5439
|
|
|
5191
|
-
const
|
|
5192
|
-
sync:
|
|
5440
|
+
const Se = Object.assign(globIterate, {
|
|
5441
|
+
sync: globIterateSync
|
|
5193
5442
|
});
|
|
5194
5443
|
|
|
5195
|
-
const
|
|
5196
|
-
stream:
|
|
5197
|
-
iterate:
|
|
5444
|
+
const ke = Object.assign(globSync, {
|
|
5445
|
+
stream: globStreamSync,
|
|
5446
|
+
iterate: globIterateSync
|
|
5198
5447
|
});
|
|
5199
5448
|
|
|
5200
|
-
const
|
|
5201
|
-
glob:
|
|
5202
|
-
globSync
|
|
5203
|
-
sync:
|
|
5204
|
-
globStream
|
|
5205
|
-
stream:
|
|
5206
|
-
globStreamSync
|
|
5207
|
-
streamSync:
|
|
5208
|
-
globIterate
|
|
5209
|
-
iterate:
|
|
5210
|
-
globIterateSync
|
|
5211
|
-
iterateSync:
|
|
5212
|
-
Glob:
|
|
5213
|
-
hasMagic
|
|
5214
|
-
escape
|
|
5215
|
-
unescape
|
|
5449
|
+
const xe = Object.assign(glob_, {
|
|
5450
|
+
glob: glob_,
|
|
5451
|
+
globSync,
|
|
5452
|
+
sync: ke,
|
|
5453
|
+
globStream,
|
|
5454
|
+
stream: we,
|
|
5455
|
+
globStreamSync,
|
|
5456
|
+
streamSync: ye,
|
|
5457
|
+
globIterate,
|
|
5458
|
+
iterate: Se,
|
|
5459
|
+
globIterateSync,
|
|
5460
|
+
iterateSync: be,
|
|
5461
|
+
Glob: me,
|
|
5462
|
+
hasMagic,
|
|
5463
|
+
escape,
|
|
5464
|
+
unescape
|
|
5216
5465
|
});
|
|
5217
5466
|
|
|
5218
|
-
|
|
5467
|
+
xe.glob = xe;
|
|
5219
5468
|
|
|
5220
|
-
async function
|
|
5221
|
-
return e ? await
|
|
5469
|
+
async function Glob(t, e) {
|
|
5470
|
+
return e ? await xe(t, e) : await xe(t);
|
|
5222
5471
|
}
|
|
5223
5472
|
|
|
5224
|
-
export {
|
|
5473
|
+
export { Glob };
|