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.cjs
CHANGED
|
@@ -4,31 +4,27 @@ Object.defineProperty(exports, Symbol.toStringTag, {
|
|
|
4
4
|
value: "Module"
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
const t = require("
|
|
7
|
+
const t = require("node:url");
|
|
8
8
|
|
|
9
|
-
const e = require("node:
|
|
9
|
+
const e = require("node:path");
|
|
10
10
|
|
|
11
|
-
const s = require("
|
|
11
|
+
const s = require("fs");
|
|
12
12
|
|
|
13
|
-
const i = require("fs");
|
|
13
|
+
const i = require("node:fs");
|
|
14
14
|
|
|
15
|
-
const n = require("node:fs");
|
|
15
|
+
const n = require("node:fs/promises");
|
|
16
16
|
|
|
17
|
-
const r = require("node:
|
|
17
|
+
const r = require("node:events");
|
|
18
18
|
|
|
19
|
-
const o = require("node:
|
|
19
|
+
const o = require("node:stream");
|
|
20
20
|
|
|
21
|
-
const h = require("node:
|
|
21
|
+
const h = require("node:string_decoder");
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
require("../../../vendor/Package.5.cjs");
|
|
26
|
-
|
|
27
|
-
const l = t => t && t.__esModule ? t : {
|
|
23
|
+
const _interopDefault = t => t && t.__esModule ? t : {
|
|
28
24
|
default: t
|
|
29
25
|
};
|
|
30
26
|
|
|
31
|
-
function
|
|
27
|
+
function _interopNamespace(t) {
|
|
32
28
|
if (t && t.__esModule) return t;
|
|
33
29
|
const e = Object.create(null, {
|
|
34
30
|
[Symbol.toStringTag]: {
|
|
@@ -50,22 +46,254 @@ function c(t) {
|
|
|
50
46
|
return Object.freeze(e);
|
|
51
47
|
}
|
|
52
48
|
|
|
53
|
-
const
|
|
49
|
+
const a = _interopNamespace(i);
|
|
50
|
+
|
|
51
|
+
const l = _interopDefault(o);
|
|
52
|
+
|
|
53
|
+
const balanced = (t, e, s) => {
|
|
54
|
+
const i = t instanceof RegExp ? maybeMatch(t, s) : t;
|
|
55
|
+
const n = e instanceof RegExp ? maybeMatch(e, s) : e;
|
|
56
|
+
const r = i !== null && n != null && range(i, n, s);
|
|
57
|
+
return r && {
|
|
58
|
+
start: r[0],
|
|
59
|
+
end: r[1],
|
|
60
|
+
pre: s.slice(0, r[0]),
|
|
61
|
+
body: s.slice(r[0] + i.length, r[1]),
|
|
62
|
+
post: s.slice(r[1] + n.length)
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const maybeMatch = (t, e) => {
|
|
67
|
+
const s = e.match(t);
|
|
68
|
+
return s ? s[0] : null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const range = (t, e, s) => {
|
|
72
|
+
let i, n, r, o = undefined, h;
|
|
73
|
+
let a = s.indexOf(t);
|
|
74
|
+
let l = s.indexOf(e, a + 1);
|
|
75
|
+
let c = a;
|
|
76
|
+
if (a >= 0 && l > 0) {
|
|
77
|
+
if (t === e) {
|
|
78
|
+
return [ a, l ];
|
|
79
|
+
}
|
|
80
|
+
i = [];
|
|
81
|
+
r = s.length;
|
|
82
|
+
while (c >= 0 && !h) {
|
|
83
|
+
if (c === a) {
|
|
84
|
+
i.push(c);
|
|
85
|
+
a = s.indexOf(t, c + 1);
|
|
86
|
+
} else if (i.length === 1) {
|
|
87
|
+
const t = i.pop();
|
|
88
|
+
if (t !== undefined) h = [ t, l ];
|
|
89
|
+
} else {
|
|
90
|
+
n = i.pop();
|
|
91
|
+
if (n !== undefined && n < r) {
|
|
92
|
+
r = n;
|
|
93
|
+
o = l;
|
|
94
|
+
}
|
|
95
|
+
l = s.indexOf(e, c + 1);
|
|
96
|
+
}
|
|
97
|
+
c = a < l && a >= 0 ? a : l;
|
|
98
|
+
}
|
|
99
|
+
if (i.length && o !== undefined) {
|
|
100
|
+
h = [ r, o ];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return h;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const c = "\0SLASH" + Math.random() + "\0";
|
|
107
|
+
|
|
108
|
+
const f = "\0OPEN" + Math.random() + "\0";
|
|
109
|
+
|
|
110
|
+
const u = "\0CLOSE" + Math.random() + "\0";
|
|
111
|
+
|
|
112
|
+
const d = "\0COMMA" + Math.random() + "\0";
|
|
113
|
+
|
|
114
|
+
const p = "\0PERIOD" + Math.random() + "\0";
|
|
115
|
+
|
|
116
|
+
const g = new RegExp(c, "g");
|
|
117
|
+
|
|
118
|
+
const y = new RegExp(f, "g");
|
|
119
|
+
|
|
120
|
+
const w = new RegExp(u, "g");
|
|
121
|
+
|
|
122
|
+
const b = new RegExp(d, "g");
|
|
123
|
+
|
|
124
|
+
const S = new RegExp(p, "g");
|
|
125
|
+
|
|
126
|
+
const k = /\\\\/g;
|
|
127
|
+
|
|
128
|
+
const x = /\\{/g;
|
|
129
|
+
|
|
130
|
+
const v = /\\}/g;
|
|
131
|
+
|
|
132
|
+
const E = /\\,/g;
|
|
133
|
+
|
|
134
|
+
const C = /\\./g;
|
|
135
|
+
|
|
136
|
+
function numeric(t) {
|
|
137
|
+
return !isNaN(t) ? parseInt(t, 10) : t.charCodeAt(0);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function escapeBraces(t) {
|
|
141
|
+
return t.replace(k, c).replace(x, f).replace(v, u).replace(E, d).replace(C, p);
|
|
142
|
+
}
|
|
54
143
|
|
|
55
|
-
|
|
144
|
+
function unescapeBraces(t) {
|
|
145
|
+
return t.replace(g, "\\").replace(y, "{").replace(w, "}").replace(b, ",").replace(S, ".");
|
|
146
|
+
}
|
|
56
147
|
|
|
57
|
-
|
|
148
|
+
function parseCommaParts(t) {
|
|
149
|
+
if (!t) {
|
|
150
|
+
return [ "" ];
|
|
151
|
+
}
|
|
152
|
+
const e = [];
|
|
153
|
+
const s = balanced("{", "}", t);
|
|
154
|
+
if (!s) {
|
|
155
|
+
return t.split(",");
|
|
156
|
+
}
|
|
157
|
+
const {pre: i, body: n, post: r} = s;
|
|
158
|
+
const o = i.split(",");
|
|
159
|
+
o[o.length - 1] += "{" + n + "}";
|
|
160
|
+
const h = parseCommaParts(r);
|
|
161
|
+
if (r.length) {
|
|
162
|
+
o[o.length - 1] += h.shift();
|
|
163
|
+
o.push.apply(o, h);
|
|
164
|
+
}
|
|
165
|
+
e.push.apply(e, o);
|
|
166
|
+
return e;
|
|
167
|
+
}
|
|
58
168
|
|
|
59
|
-
|
|
169
|
+
function expand(t) {
|
|
170
|
+
if (!t) {
|
|
171
|
+
return [];
|
|
172
|
+
}
|
|
173
|
+
if (t.slice(0, 2) === "{}") {
|
|
174
|
+
t = "\\{\\}" + t.slice(2);
|
|
175
|
+
}
|
|
176
|
+
return expand_(escapeBraces(t), true).map(unescapeBraces);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function embrace(t) {
|
|
180
|
+
return "{" + t + "}";
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function isPadded(t) {
|
|
184
|
+
return /^-?0\d/.test(t);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function lte(t, e) {
|
|
188
|
+
return t <= e;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function gte(t, e) {
|
|
192
|
+
return t >= e;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function expand_(t, e) {
|
|
196
|
+
const s = [];
|
|
197
|
+
const i = balanced("{", "}", t);
|
|
198
|
+
if (!i) return [ t ];
|
|
199
|
+
const n = i.pre;
|
|
200
|
+
const r = i.post.length ? expand_(i.post, false) : [ "" ];
|
|
201
|
+
if (/\$$/.test(i.pre)) {
|
|
202
|
+
for (let t = 0; t < r.length; t++) {
|
|
203
|
+
const e = n + "{" + i.body + "}" + r[t];
|
|
204
|
+
s.push(e);
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
const o = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body);
|
|
208
|
+
const h = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body);
|
|
209
|
+
const a = o || h;
|
|
210
|
+
const l = i.body.indexOf(",") >= 0;
|
|
211
|
+
if (!a && !l) {
|
|
212
|
+
if (i.post.match(/,(?!,).*\}/)) {
|
|
213
|
+
t = i.pre + "{" + i.body + u + i.post;
|
|
214
|
+
return expand_(t);
|
|
215
|
+
}
|
|
216
|
+
return [ t ];
|
|
217
|
+
}
|
|
218
|
+
let c;
|
|
219
|
+
if (a) {
|
|
220
|
+
c = i.body.split(/\.\./);
|
|
221
|
+
} else {
|
|
222
|
+
c = parseCommaParts(i.body);
|
|
223
|
+
if (c.length === 1 && c[0] !== undefined) {
|
|
224
|
+
c = expand_(c[0], false).map(embrace);
|
|
225
|
+
if (c.length === 1) {
|
|
226
|
+
return r.map((t => i.pre + c[0] + t));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
let f;
|
|
231
|
+
if (a && c[0] !== undefined && c[1] !== undefined) {
|
|
232
|
+
const t = numeric(c[0]);
|
|
233
|
+
const e = numeric(c[1]);
|
|
234
|
+
const s = Math.max(c[0].length, c[1].length);
|
|
235
|
+
let i = c.length === 3 && c[2] !== undefined ? Math.abs(numeric(c[2])) : 1;
|
|
236
|
+
let n = lte;
|
|
237
|
+
const r = e < t;
|
|
238
|
+
if (r) {
|
|
239
|
+
i *= -1;
|
|
240
|
+
n = gte;
|
|
241
|
+
}
|
|
242
|
+
const o = c.some(isPadded);
|
|
243
|
+
f = [];
|
|
244
|
+
for (let r = t; n(r, e); r += i) {
|
|
245
|
+
let t;
|
|
246
|
+
if (h) {
|
|
247
|
+
t = String.fromCharCode(r);
|
|
248
|
+
if (t === "\\") {
|
|
249
|
+
t = "";
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
t = String(r);
|
|
253
|
+
if (o) {
|
|
254
|
+
const e = s - t.length;
|
|
255
|
+
if (e > 0) {
|
|
256
|
+
const s = new Array(e + 1).join("0");
|
|
257
|
+
if (r < 0) {
|
|
258
|
+
t = "-" + s + t.slice(1);
|
|
259
|
+
} else {
|
|
260
|
+
t = s + t;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
f.push(t);
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
f = [];
|
|
269
|
+
for (let t = 0; t < c.length; t++) {
|
|
270
|
+
f.push.apply(f, expand_(c[t], false));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
for (let t = 0; t < f.length; t++) {
|
|
274
|
+
for (let i = 0; i < r.length; i++) {
|
|
275
|
+
const o = n + f[t] + r[i];
|
|
276
|
+
if (!e || a || o) {
|
|
277
|
+
s.push(o);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return s;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const T = 1024 * 64;
|
|
286
|
+
|
|
287
|
+
const assertValidPattern = t => {
|
|
60
288
|
if (typeof t !== "string") {
|
|
61
289
|
throw new TypeError("invalid pattern");
|
|
62
290
|
}
|
|
63
|
-
if (t.length >
|
|
291
|
+
if (t.length > T) {
|
|
64
292
|
throw new TypeError("pattern is too long");
|
|
65
293
|
}
|
|
66
294
|
};
|
|
67
295
|
|
|
68
|
-
const
|
|
296
|
+
const L = {
|
|
69
297
|
"[:alnum:]": [ "\\p{L}\\p{Nl}\\p{Nd}", true ],
|
|
70
298
|
"[:alpha:]": [ "\\p{L}\\p{Nl}", true ],
|
|
71
299
|
"[:ascii:]": [ "\\x" + "00-\\x" + "7f", false ],
|
|
@@ -82,13 +310,13 @@ const g = {
|
|
|
82
310
|
"[:xdigit:]": [ "A-Fa-f0-9", false ]
|
|
83
311
|
};
|
|
84
312
|
|
|
85
|
-
const
|
|
313
|
+
const braceEscape = t => t.replace(/[[\]\\-]/g, "\\$&");
|
|
86
314
|
|
|
87
|
-
const
|
|
315
|
+
const regexpEscape = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
88
316
|
|
|
89
|
-
const
|
|
317
|
+
const rangesToString = t => t.join("");
|
|
90
318
|
|
|
91
|
-
const
|
|
319
|
+
const parseClass = (t, e) => {
|
|
92
320
|
const s = e;
|
|
93
321
|
if (t.charAt(s) !== "[") {
|
|
94
322
|
throw new Error("not in a brace expression");
|
|
@@ -122,7 +350,7 @@ const b = (t, e) => {
|
|
|
122
350
|
}
|
|
123
351
|
}
|
|
124
352
|
if (e === "[" && !a) {
|
|
125
|
-
for (const [e, [o, a, l]] of Object.entries(
|
|
353
|
+
for (const [e, [o, a, l]] of Object.entries(L)) {
|
|
126
354
|
if (t.startsWith(e, r)) {
|
|
127
355
|
if (f) {
|
|
128
356
|
return [ "$.", false, t.length - s, true ];
|
|
@@ -137,16 +365,16 @@ const b = (t, e) => {
|
|
|
137
365
|
a = false;
|
|
138
366
|
if (f) {
|
|
139
367
|
if (e > f) {
|
|
140
|
-
i.push(
|
|
368
|
+
i.push(braceEscape(f) + "-" + braceEscape(e));
|
|
141
369
|
} else if (e === f) {
|
|
142
|
-
i.push(
|
|
370
|
+
i.push(braceEscape(e));
|
|
143
371
|
}
|
|
144
372
|
f = "";
|
|
145
373
|
r++;
|
|
146
374
|
continue;
|
|
147
375
|
}
|
|
148
376
|
if (t.startsWith("-]", r + 1)) {
|
|
149
|
-
i.push(
|
|
377
|
+
i.push(braceEscape(e + "-"));
|
|
150
378
|
r += 2;
|
|
151
379
|
continue;
|
|
152
380
|
}
|
|
@@ -155,7 +383,7 @@ const b = (t, e) => {
|
|
|
155
383
|
r += 2;
|
|
156
384
|
continue;
|
|
157
385
|
}
|
|
158
|
-
i.push(
|
|
386
|
+
i.push(braceEscape(e));
|
|
159
387
|
r++;
|
|
160
388
|
}
|
|
161
389
|
if (c < r) {
|
|
@@ -166,37 +394,42 @@ const b = (t, e) => {
|
|
|
166
394
|
}
|
|
167
395
|
if (n.length === 0 && i.length === 1 && /^\\?.$/.test(i[0]) && !l) {
|
|
168
396
|
const t = i[0].length === 2 ? i[0].slice(-1) : i[0];
|
|
169
|
-
return [
|
|
397
|
+
return [ regexpEscape(t), false, c - s, false ];
|
|
170
398
|
}
|
|
171
|
-
const u = "[" + (l ? "^" : "") +
|
|
172
|
-
const d = "[" + (l ? "" : "^") +
|
|
399
|
+
const u = "[" + (l ? "^" : "") + rangesToString(i) + "]";
|
|
400
|
+
const d = "[" + (l ? "" : "^") + rangesToString(n) + "]";
|
|
173
401
|
const p = i.length && n.length ? "(" + u + "|" + d + ")" : i.length ? u : d;
|
|
174
402
|
return [ p, h, c - s, true ];
|
|
175
403
|
};
|
|
176
404
|
|
|
177
|
-
const
|
|
405
|
+
const unescape = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = true} = {}) => {
|
|
406
|
+
if (s) {
|
|
407
|
+
return e ? t.replace(/\[([^\/\\])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
408
|
+
}
|
|
409
|
+
return e ? t.replace(/\[([^\/\\{}])\]/g, "$1") : t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
410
|
+
};
|
|
178
411
|
|
|
179
|
-
const
|
|
412
|
+
const A = new Set([ "!", "?", "+", "*", "@" ]);
|
|
180
413
|
|
|
181
|
-
const
|
|
414
|
+
const isExtglobType = t => A.has(t);
|
|
182
415
|
|
|
183
|
-
const
|
|
416
|
+
const M = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
184
417
|
|
|
185
|
-
const
|
|
418
|
+
const P = "(?!\\.)";
|
|
186
419
|
|
|
187
|
-
const
|
|
420
|
+
const F = new Set([ "[", "." ]);
|
|
188
421
|
|
|
189
|
-
const
|
|
422
|
+
const R = new Set([ "..", "." ]);
|
|
190
423
|
|
|
191
|
-
const
|
|
424
|
+
const O = new Set("().*{}+?[]^$\\!");
|
|
192
425
|
|
|
193
|
-
const
|
|
426
|
+
const regExpEscape$1 = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
194
427
|
|
|
195
|
-
const
|
|
428
|
+
const z = "[^/]";
|
|
196
429
|
|
|
197
|
-
const
|
|
430
|
+
const D = z + "*?";
|
|
198
431
|
|
|
199
|
-
const
|
|
432
|
+
const N = z + "+?";
|
|
200
433
|
|
|
201
434
|
class AST {
|
|
202
435
|
type;
|
|
@@ -342,7 +575,7 @@ class AST {
|
|
|
342
575
|
l += s;
|
|
343
576
|
continue;
|
|
344
577
|
}
|
|
345
|
-
if (!i.noext &&
|
|
578
|
+
if (!i.noext && isExtglobType(s) && t.charAt(a) === "(") {
|
|
346
579
|
e.push(l);
|
|
347
580
|
l = "";
|
|
348
581
|
const n = new AST(s, e);
|
|
@@ -383,7 +616,7 @@ class AST {
|
|
|
383
616
|
f += s;
|
|
384
617
|
continue;
|
|
385
618
|
}
|
|
386
|
-
if (
|
|
619
|
+
if (isExtglobType(s) && t.charAt(a) === "(") {
|
|
387
620
|
l.push(f);
|
|
388
621
|
f = "";
|
|
389
622
|
const e = new AST(s, l);
|
|
@@ -440,7 +673,7 @@ class AST {
|
|
|
440
673
|
const e = t ?? !!this.#a.dot;
|
|
441
674
|
if (this.#t === this) this.#f();
|
|
442
675
|
if (!this.type) {
|
|
443
|
-
const s = this.isStart() && this.isEnd();
|
|
676
|
+
const s = this.isStart() && this.isEnd() && !this.#i.some((t => typeof t !== "string"));
|
|
444
677
|
const i = this.#i.map((e => {
|
|
445
678
|
const [i, n, r, o] = typeof e === "string" ? AST.#d(e, this.#e, s) : e.toRegExpSource(t);
|
|
446
679
|
this.#e = this.#e || r;
|
|
@@ -450,12 +683,12 @@ class AST {
|
|
|
450
683
|
let n = "";
|
|
451
684
|
if (this.isStart()) {
|
|
452
685
|
if (typeof this.#i[0] === "string") {
|
|
453
|
-
const s = this.#i.length === 1 &&
|
|
686
|
+
const s = this.#i.length === 1 && R.has(this.#i[0]);
|
|
454
687
|
if (!s) {
|
|
455
|
-
const s =
|
|
688
|
+
const s = F;
|
|
456
689
|
const r = e && s.has(i.charAt(0)) || i.startsWith("\\.") && s.has(i.charAt(2)) || i.startsWith("\\.\\.") && s.has(i.charAt(4));
|
|
457
690
|
const o = !e && !t && s.has(i.charAt(0));
|
|
458
|
-
n = r ?
|
|
691
|
+
n = r ? M : o ? P : "";
|
|
459
692
|
}
|
|
460
693
|
}
|
|
461
694
|
}
|
|
@@ -464,7 +697,7 @@ class AST {
|
|
|
464
697
|
r = "(?:$|\\/)";
|
|
465
698
|
}
|
|
466
699
|
const o = n + i + r;
|
|
467
|
-
return [ o,
|
|
700
|
+
return [ o, unescape(i), this.#e = !!this.#e, this.#s ];
|
|
468
701
|
}
|
|
469
702
|
const s = this.type === "*" || this.type === "+";
|
|
470
703
|
const i = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
@@ -474,9 +707,9 @@ class AST {
|
|
|
474
707
|
this.#i = [ t ];
|
|
475
708
|
this.type = null;
|
|
476
709
|
this.#e = undefined;
|
|
477
|
-
return [ t,
|
|
710
|
+
return [ t, unescape(this.toString()), false, false ];
|
|
478
711
|
}
|
|
479
|
-
let r = !s || t || e || !
|
|
712
|
+
let r = !s || t || e || !P ? "" : this.#p(true);
|
|
480
713
|
if (r === n) {
|
|
481
714
|
r = "";
|
|
482
715
|
}
|
|
@@ -485,12 +718,12 @@ class AST {
|
|
|
485
718
|
}
|
|
486
719
|
let o = "";
|
|
487
720
|
if (this.type === "!" && this.#c) {
|
|
488
|
-
o = (this.isStart() && !e ?
|
|
721
|
+
o = (this.isStart() && !e ? P : "") + N;
|
|
489
722
|
} else {
|
|
490
|
-
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ?
|
|
723
|
+
const s = this.type === "!" ? "))" + (this.isStart() && !e && !t ? P : "") + D + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && r ? ")" : this.type === "*" && r ? `)?` : `)${this.type}`;
|
|
491
724
|
o = i + n + s;
|
|
492
725
|
}
|
|
493
|
-
return [ o,
|
|
726
|
+
return [ o, unescape(n), this.#e = !!this.#e, this.#s ];
|
|
494
727
|
}
|
|
495
728
|
#p(t) {
|
|
496
729
|
return this.#i.map((e => {
|
|
@@ -510,7 +743,7 @@ class AST {
|
|
|
510
743
|
const h = t.charAt(o);
|
|
511
744
|
if (i) {
|
|
512
745
|
i = false;
|
|
513
|
-
n += (
|
|
746
|
+
n += (O.has(h) ? "\\" : "") + h;
|
|
514
747
|
continue;
|
|
515
748
|
}
|
|
516
749
|
if (h === "\\") {
|
|
@@ -522,7 +755,7 @@ class AST {
|
|
|
522
755
|
continue;
|
|
523
756
|
}
|
|
524
757
|
if (h === "[") {
|
|
525
|
-
const [s, i, h, a] =
|
|
758
|
+
const [s, i, h, a] = parseClass(t, o);
|
|
526
759
|
if (h) {
|
|
527
760
|
n += s;
|
|
528
761
|
r = r || i;
|
|
@@ -532,102 +765,107 @@ class AST {
|
|
|
532
765
|
}
|
|
533
766
|
}
|
|
534
767
|
if (h === "*") {
|
|
535
|
-
|
|
768
|
+
n += s && t === "*" ? N : D;
|
|
536
769
|
e = true;
|
|
537
770
|
continue;
|
|
538
771
|
}
|
|
539
772
|
if (h === "?") {
|
|
540
|
-
n +=
|
|
773
|
+
n += z;
|
|
541
774
|
e = true;
|
|
542
775
|
continue;
|
|
543
776
|
}
|
|
544
|
-
n +=
|
|
777
|
+
n += regExpEscape$1(h);
|
|
545
778
|
}
|
|
546
|
-
return [ n,
|
|
779
|
+
return [ n, unescape(t), !!e, r ];
|
|
547
780
|
}
|
|
548
781
|
}
|
|
549
782
|
|
|
550
|
-
const
|
|
783
|
+
const escape = (t, {windowsPathsNoEscape: e = false, magicalBraces: s = false} = {}) => {
|
|
784
|
+
if (s) {
|
|
785
|
+
return e ? t.replace(/[?*()[\]{}]/g, "[$&]") : t.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
786
|
+
}
|
|
787
|
+
return e ? t.replace(/[?*()[\]]/g, "[$&]") : t.replace(/[?*()[\]\\]/g, "\\$&");
|
|
788
|
+
};
|
|
551
789
|
|
|
552
|
-
const
|
|
553
|
-
|
|
790
|
+
const minimatch = (t, e, s = {}) => {
|
|
791
|
+
assertValidPattern(e);
|
|
554
792
|
if (!s.nocomment && e.charAt(0) === "#") {
|
|
555
793
|
return false;
|
|
556
794
|
}
|
|
557
795
|
return new Minimatch(e, s).match(t);
|
|
558
796
|
};
|
|
559
797
|
|
|
560
|
-
const
|
|
798
|
+
const B = /^\*+([^+@!?\*\[\(]*)$/;
|
|
561
799
|
|
|
562
|
-
const
|
|
800
|
+
const starDotExtTest = t => e => !e.startsWith(".") && e.endsWith(t);
|
|
563
801
|
|
|
564
|
-
const
|
|
802
|
+
const starDotExtTestDot = t => e => e.endsWith(t);
|
|
565
803
|
|
|
566
|
-
const
|
|
804
|
+
const starDotExtTestNocase = t => {
|
|
567
805
|
t = t.toLowerCase();
|
|
568
806
|
return e => !e.startsWith(".") && e.toLowerCase().endsWith(t);
|
|
569
807
|
};
|
|
570
808
|
|
|
571
|
-
const
|
|
809
|
+
const starDotExtTestNocaseDot = t => {
|
|
572
810
|
t = t.toLowerCase();
|
|
573
811
|
return e => e.toLowerCase().endsWith(t);
|
|
574
812
|
};
|
|
575
813
|
|
|
576
814
|
const _ = /^\*+\.\*+$/;
|
|
577
815
|
|
|
578
|
-
const
|
|
816
|
+
const starDotStarTest = t => !t.startsWith(".") && t.includes(".");
|
|
579
817
|
|
|
580
|
-
const
|
|
818
|
+
const starDotStarTestDot = t => t !== "." && t !== ".." && t.includes(".");
|
|
581
819
|
|
|
582
|
-
const
|
|
820
|
+
const I = /^\.\*+$/;
|
|
583
821
|
|
|
584
|
-
const
|
|
822
|
+
const dotStarTest = t => t !== "." && t !== ".." && t.startsWith(".");
|
|
585
823
|
|
|
586
|
-
const
|
|
824
|
+
const W = /^\*+$/;
|
|
587
825
|
|
|
588
|
-
const
|
|
826
|
+
const starTest = t => t.length !== 0 && !t.startsWith(".");
|
|
589
827
|
|
|
590
|
-
const
|
|
828
|
+
const starTestDot = t => t.length !== 0 && t !== "." && t !== "..";
|
|
591
829
|
|
|
592
|
-
const
|
|
830
|
+
const j = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
593
831
|
|
|
594
|
-
const
|
|
595
|
-
const s =
|
|
832
|
+
const qmarksTestNocase = ([t, e = ""]) => {
|
|
833
|
+
const s = qmarksTestNoExt([ t ]);
|
|
596
834
|
if (!e) return s;
|
|
597
835
|
e = e.toLowerCase();
|
|
598
836
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
599
837
|
};
|
|
600
838
|
|
|
601
|
-
const
|
|
602
|
-
const s =
|
|
839
|
+
const qmarksTestNocaseDot = ([t, e = ""]) => {
|
|
840
|
+
const s = qmarksTestNoExtDot([ t ]);
|
|
603
841
|
if (!e) return s;
|
|
604
842
|
e = e.toLowerCase();
|
|
605
843
|
return t => s(t) && t.toLowerCase().endsWith(e);
|
|
606
844
|
};
|
|
607
845
|
|
|
608
|
-
const
|
|
609
|
-
const s =
|
|
846
|
+
const qmarksTestDot = ([t, e = ""]) => {
|
|
847
|
+
const s = qmarksTestNoExtDot([ t ]);
|
|
610
848
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
611
849
|
};
|
|
612
850
|
|
|
613
|
-
const
|
|
614
|
-
const s =
|
|
851
|
+
const qmarksTest = ([t, e = ""]) => {
|
|
852
|
+
const s = qmarksTestNoExt([ t ]);
|
|
615
853
|
return !e ? s : t => s(t) && t.endsWith(e);
|
|
616
854
|
};
|
|
617
855
|
|
|
618
|
-
const
|
|
856
|
+
const qmarksTestNoExt = ([t]) => {
|
|
619
857
|
const e = t.length;
|
|
620
858
|
return t => t.length === e && !t.startsWith(".");
|
|
621
859
|
};
|
|
622
860
|
|
|
623
|
-
const
|
|
861
|
+
const qmarksTestNoExtDot = ([t]) => {
|
|
624
862
|
const e = t.length;
|
|
625
863
|
return t => t.length === e && t !== "." && t !== "..";
|
|
626
864
|
};
|
|
627
865
|
|
|
628
|
-
const
|
|
866
|
+
const $ = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
629
867
|
|
|
630
|
-
const
|
|
868
|
+
const G = {
|
|
631
869
|
win32: {
|
|
632
870
|
sep: "\\"
|
|
633
871
|
},
|
|
@@ -636,80 +874,80 @@ const et = {
|
|
|
636
874
|
}
|
|
637
875
|
};
|
|
638
876
|
|
|
639
|
-
const
|
|
877
|
+
const U = $ === "win32" ? G.win32.sep : G.posix.sep;
|
|
640
878
|
|
|
641
|
-
|
|
879
|
+
minimatch.sep = U;
|
|
642
880
|
|
|
643
|
-
const
|
|
881
|
+
const q = Symbol("globstar **");
|
|
644
882
|
|
|
645
|
-
|
|
883
|
+
minimatch.GLOBSTAR = q;
|
|
646
884
|
|
|
647
|
-
const
|
|
885
|
+
const H = "[^/]";
|
|
648
886
|
|
|
649
|
-
const
|
|
887
|
+
const Z = H + "*?";
|
|
650
888
|
|
|
651
|
-
const
|
|
889
|
+
const V = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
652
890
|
|
|
653
|
-
const
|
|
891
|
+
const J = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
654
892
|
|
|
655
|
-
const
|
|
893
|
+
const filter = (t, e = {}) => s => minimatch(s, t, e);
|
|
656
894
|
|
|
657
|
-
|
|
895
|
+
minimatch.filter = filter;
|
|
658
896
|
|
|
659
|
-
const
|
|
897
|
+
const ext = (t, e = {}) => Object.assign({}, t, e);
|
|
660
898
|
|
|
661
|
-
const
|
|
899
|
+
const defaults = t => {
|
|
662
900
|
if (!t || typeof t !== "object" || !Object.keys(t).length) {
|
|
663
|
-
return
|
|
901
|
+
return minimatch;
|
|
664
902
|
}
|
|
665
|
-
const e =
|
|
666
|
-
const
|
|
667
|
-
return Object.assign(
|
|
903
|
+
const e = minimatch;
|
|
904
|
+
const m = (s, i, n = {}) => e(s, i, ext(t, n));
|
|
905
|
+
return Object.assign(m, {
|
|
668
906
|
Minimatch: class Minimatch extends e.Minimatch {
|
|
669
907
|
constructor(e, s = {}) {
|
|
670
|
-
super(e,
|
|
908
|
+
super(e, ext(t, s));
|
|
671
909
|
}
|
|
672
910
|
static defaults(s) {
|
|
673
|
-
return e.defaults(
|
|
911
|
+
return e.defaults(ext(t, s)).Minimatch;
|
|
674
912
|
}
|
|
675
913
|
},
|
|
676
914
|
AST: class AST extends e.AST {
|
|
677
915
|
constructor(e, s, i = {}) {
|
|
678
|
-
super(e, s,
|
|
916
|
+
super(e, s, ext(t, i));
|
|
679
917
|
}
|
|
680
918
|
static fromGlob(s, i = {}) {
|
|
681
|
-
return e.AST.fromGlob(s,
|
|
919
|
+
return e.AST.fromGlob(s, ext(t, i));
|
|
682
920
|
}
|
|
683
921
|
},
|
|
684
|
-
unescape: (s, i = {}) => e.unescape(s,
|
|
685
|
-
escape: (s, i = {}) => e.escape(s,
|
|
686
|
-
filter: (s, i = {}) => e.filter(s,
|
|
687
|
-
defaults: s => e.defaults(
|
|
688
|
-
makeRe: (s, i = {}) => e.makeRe(s,
|
|
689
|
-
braceExpand: (s, i = {}) => e.braceExpand(s,
|
|
690
|
-
match: (s, i, n = {}) => e.match(s, i,
|
|
922
|
+
unescape: (s, i = {}) => e.unescape(s, ext(t, i)),
|
|
923
|
+
escape: (s, i = {}) => e.escape(s, ext(t, i)),
|
|
924
|
+
filter: (s, i = {}) => e.filter(s, ext(t, i)),
|
|
925
|
+
defaults: s => e.defaults(ext(t, s)),
|
|
926
|
+
makeRe: (s, i = {}) => e.makeRe(s, ext(t, i)),
|
|
927
|
+
braceExpand: (s, i = {}) => e.braceExpand(s, ext(t, i)),
|
|
928
|
+
match: (s, i, n = {}) => e.match(s, i, ext(t, n)),
|
|
691
929
|
sep: e.sep,
|
|
692
|
-
GLOBSTAR:
|
|
930
|
+
GLOBSTAR: q
|
|
693
931
|
});
|
|
694
932
|
};
|
|
695
933
|
|
|
696
|
-
|
|
934
|
+
minimatch.defaults = defaults;
|
|
697
935
|
|
|
698
|
-
const
|
|
699
|
-
|
|
700
|
-
if (
|
|
701
|
-
return [
|
|
936
|
+
const braceExpand = (t, e = {}) => {
|
|
937
|
+
assertValidPattern(t);
|
|
938
|
+
if (e.nobrace || !/\{(?:(?!\{).)*\}/.test(t)) {
|
|
939
|
+
return [ t ];
|
|
702
940
|
}
|
|
703
|
-
return
|
|
941
|
+
return expand(t);
|
|
704
942
|
};
|
|
705
943
|
|
|
706
|
-
|
|
944
|
+
minimatch.braceExpand = braceExpand;
|
|
707
945
|
|
|
708
|
-
const
|
|
946
|
+
const makeRe = (t, e = {}) => new Minimatch(t, e).makeRe();
|
|
709
947
|
|
|
710
|
-
|
|
948
|
+
minimatch.makeRe = makeRe;
|
|
711
949
|
|
|
712
|
-
const
|
|
950
|
+
const match = (t, e, s = {}) => {
|
|
713
951
|
const i = new Minimatch(e, s);
|
|
714
952
|
t = t.filter((t => i.match(t)));
|
|
715
953
|
if (i.options.nonull && !t.length) {
|
|
@@ -718,11 +956,11 @@ const dt = (t, e, s = {}) => {
|
|
|
718
956
|
return t;
|
|
719
957
|
};
|
|
720
958
|
|
|
721
|
-
|
|
959
|
+
minimatch.match = match;
|
|
722
960
|
|
|
723
|
-
const
|
|
961
|
+
const K = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
724
962
|
|
|
725
|
-
const
|
|
963
|
+
const regExpEscape = t => t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
726
964
|
|
|
727
965
|
class Minimatch {
|
|
728
966
|
options;
|
|
@@ -743,11 +981,11 @@ class Minimatch {
|
|
|
743
981
|
windowsNoMagicRoot;
|
|
744
982
|
regexp;
|
|
745
983
|
constructor(t, e = {}) {
|
|
746
|
-
|
|
984
|
+
assertValidPattern(t);
|
|
747
985
|
e = e || {};
|
|
748
986
|
this.options = e;
|
|
749
987
|
this.pattern = t;
|
|
750
|
-
this.platform = e.platform ||
|
|
988
|
+
this.platform = e.platform || $;
|
|
751
989
|
this.isWindows = this.platform === "win32";
|
|
752
990
|
this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === false;
|
|
753
991
|
if (this.windowsPathsNoEscape) {
|
|
@@ -801,7 +1039,7 @@ class Minimatch {
|
|
|
801
1039
|
this.debug(this.pattern, this.globParts);
|
|
802
1040
|
let i = this.globParts.map(((t, e, s) => {
|
|
803
1041
|
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
804
|
-
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !
|
|
1042
|
+
const e = t[0] === "" && t[1] === "" && (t[2] === "?" || !K.test(t[2])) && !K.test(t[3]);
|
|
805
1043
|
const s = /^[a-z]:/i.test(t[0]);
|
|
806
1044
|
if (e) {
|
|
807
1045
|
return [ ...t.slice(0, 4), ...t.slice(4).map((t => this.parse(t))) ];
|
|
@@ -1068,7 +1306,7 @@ class Minimatch {
|
|
|
1068
1306
|
if (l === false) {
|
|
1069
1307
|
return false;
|
|
1070
1308
|
}
|
|
1071
|
-
if (l ===
|
|
1309
|
+
if (l === q) {
|
|
1072
1310
|
this.debug("GLOBSTAR", [ e, l, c ]);
|
|
1073
1311
|
var f = r;
|
|
1074
1312
|
var u = o + 1;
|
|
@@ -1123,25 +1361,25 @@ class Minimatch {
|
|
|
1123
1361
|
}
|
|
1124
1362
|
}
|
|
1125
1363
|
braceExpand() {
|
|
1126
|
-
return
|
|
1364
|
+
return braceExpand(this.pattern, this.options);
|
|
1127
1365
|
}
|
|
1128
1366
|
parse(t) {
|
|
1129
|
-
|
|
1367
|
+
assertValidPattern(t);
|
|
1130
1368
|
const e = this.options;
|
|
1131
|
-
if (t === "**") return
|
|
1369
|
+
if (t === "**") return q;
|
|
1132
1370
|
if (t === "") return "";
|
|
1133
1371
|
let s;
|
|
1134
1372
|
let i = null;
|
|
1135
|
-
if (s = t.match(
|
|
1136
|
-
i = e.dot ?
|
|
1137
|
-
} else if (s = t.match(
|
|
1138
|
-
i = (e.nocase ? e.dot ?
|
|
1139
|
-
} else if (s = t.match(
|
|
1140
|
-
i = (e.nocase ? e.dot ?
|
|
1373
|
+
if (s = t.match(W)) {
|
|
1374
|
+
i = e.dot ? starTestDot : starTest;
|
|
1375
|
+
} else if (s = t.match(B)) {
|
|
1376
|
+
i = (e.nocase ? e.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : e.dot ? starDotExtTestDot : starDotExtTest)(s[1]);
|
|
1377
|
+
} else if (s = t.match(j)) {
|
|
1378
|
+
i = (e.nocase ? e.dot ? qmarksTestNocaseDot : qmarksTestNocase : e.dot ? qmarksTestDot : qmarksTest)(s);
|
|
1141
1379
|
} else if (s = t.match(_)) {
|
|
1142
|
-
i = e.dot ?
|
|
1143
|
-
} else if (s = t.match(
|
|
1144
|
-
i =
|
|
1380
|
+
i = e.dot ? starDotStarTestDot : starDotStarTest;
|
|
1381
|
+
} else if (s = t.match(I)) {
|
|
1382
|
+
i = dotStarTest;
|
|
1145
1383
|
}
|
|
1146
1384
|
const n = AST.fromGlob(t, this.options).toMMPattern();
|
|
1147
1385
|
if (i && typeof n === "object") {
|
|
@@ -1159,38 +1397,49 @@ class Minimatch {
|
|
|
1159
1397
|
return this.regexp;
|
|
1160
1398
|
}
|
|
1161
1399
|
const e = this.options;
|
|
1162
|
-
const s = e.noglobstar ?
|
|
1400
|
+
const s = e.noglobstar ? Z : e.dot ? V : J;
|
|
1163
1401
|
const i = new Set(e.nocase ? [ "i" ] : []);
|
|
1164
1402
|
let n = t.map((t => {
|
|
1165
1403
|
const e = t.map((t => {
|
|
1166
1404
|
if (t instanceof RegExp) {
|
|
1167
1405
|
for (const e of t.flags.split("")) i.add(e);
|
|
1168
1406
|
}
|
|
1169
|
-
return typeof t === "string" ?
|
|
1407
|
+
return typeof t === "string" ? regExpEscape(t) : t === q ? q : t._src;
|
|
1170
1408
|
}));
|
|
1171
1409
|
e.forEach(((t, i) => {
|
|
1172
1410
|
const n = e[i + 1];
|
|
1173
1411
|
const r = e[i - 1];
|
|
1174
|
-
if (t !==
|
|
1412
|
+
if (t !== q || r === q) {
|
|
1175
1413
|
return;
|
|
1176
1414
|
}
|
|
1177
1415
|
if (r === undefined) {
|
|
1178
|
-
if (n !== undefined && n !==
|
|
1416
|
+
if (n !== undefined && n !== q) {
|
|
1179
1417
|
e[i + 1] = "(?:\\/|" + s + "\\/)?" + n;
|
|
1180
1418
|
} else {
|
|
1181
1419
|
e[i] = s;
|
|
1182
1420
|
}
|
|
1183
1421
|
} else if (n === undefined) {
|
|
1184
|
-
e[i - 1] = r + "(
|
|
1185
|
-
} else if (n !==
|
|
1422
|
+
e[i - 1] = r + "(?:\\/|\\/" + s + ")?";
|
|
1423
|
+
} else if (n !== q) {
|
|
1186
1424
|
e[i - 1] = r + "(?:\\/|\\/" + s + "\\/)" + n;
|
|
1187
|
-
e[i + 1] =
|
|
1425
|
+
e[i + 1] = q;
|
|
1188
1426
|
}
|
|
1189
1427
|
}));
|
|
1190
|
-
|
|
1428
|
+
const n = e.filter((t => t !== q));
|
|
1429
|
+
if (this.partial && n.length >= 1) {
|
|
1430
|
+
const t = [];
|
|
1431
|
+
for (let e = 1; e <= n.length; e++) {
|
|
1432
|
+
t.push(n.slice(0, e).join("/"));
|
|
1433
|
+
}
|
|
1434
|
+
return "(?:" + t.join("|") + ")";
|
|
1435
|
+
}
|
|
1436
|
+
return n.join("/");
|
|
1191
1437
|
})).join("|");
|
|
1192
1438
|
const [r, o] = t.length > 1 ? [ "(?:", ")" ] : [ "", "" ];
|
|
1193
1439
|
n = "^" + r + n + o + "$";
|
|
1440
|
+
if (this.partial) {
|
|
1441
|
+
n = "^(?:\\/|" + r + n.slice(1, -1) + o + ")$";
|
|
1442
|
+
}
|
|
1194
1443
|
if (this.negate) n = "^(?!" + n + ").+$";
|
|
1195
1444
|
try {
|
|
1196
1445
|
this.regexp = new RegExp(n, [ ...i ].join(""));
|
|
@@ -1253,34 +1502,34 @@ class Minimatch {
|
|
|
1253
1502
|
return this.negate;
|
|
1254
1503
|
}
|
|
1255
1504
|
static defaults(t) {
|
|
1256
|
-
return
|
|
1505
|
+
return minimatch.defaults(t).Minimatch;
|
|
1257
1506
|
}
|
|
1258
1507
|
}
|
|
1259
1508
|
|
|
1260
|
-
|
|
1509
|
+
minimatch.AST = AST;
|
|
1261
1510
|
|
|
1262
|
-
|
|
1511
|
+
minimatch.Minimatch = Minimatch;
|
|
1263
1512
|
|
|
1264
|
-
|
|
1513
|
+
minimatch.escape = escape;
|
|
1265
1514
|
|
|
1266
|
-
|
|
1515
|
+
minimatch.unescape = unescape;
|
|
1267
1516
|
|
|
1268
|
-
const
|
|
1517
|
+
const Y = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
1269
1518
|
|
|
1270
|
-
const
|
|
1519
|
+
const X = new Set;
|
|
1271
1520
|
|
|
1272
|
-
const
|
|
1521
|
+
const Q = typeof process === "object" && !!process ? process : {};
|
|
1273
1522
|
|
|
1274
|
-
const
|
|
1275
|
-
typeof
|
|
1523
|
+
const emitWarning = (t, e, s, i) => {
|
|
1524
|
+
typeof Q.emitWarning === "function" ? Q.emitWarning(t, e, s, i) : console.error(`[${s}] ${e}: ${t}`);
|
|
1276
1525
|
};
|
|
1277
1526
|
|
|
1278
|
-
let
|
|
1527
|
+
let tt = globalThis.AbortController;
|
|
1279
1528
|
|
|
1280
|
-
let
|
|
1529
|
+
let et = globalThis.AbortSignal;
|
|
1281
1530
|
|
|
1282
|
-
if (typeof
|
|
1283
|
-
|
|
1531
|
+
if (typeof tt === "undefined") {
|
|
1532
|
+
et = class AbortSignal {
|
|
1284
1533
|
onabort;
|
|
1285
1534
|
_onabort=[];
|
|
1286
1535
|
reason;
|
|
@@ -1289,11 +1538,11 @@ if (typeof St === "undefined") {
|
|
|
1289
1538
|
this._onabort.push(e);
|
|
1290
1539
|
}
|
|
1291
1540
|
};
|
|
1292
|
-
|
|
1541
|
+
tt = class AbortController {
|
|
1293
1542
|
constructor() {
|
|
1294
|
-
|
|
1543
|
+
warnACPolyfill();
|
|
1295
1544
|
}
|
|
1296
|
-
signal=new
|
|
1545
|
+
signal=new et;
|
|
1297
1546
|
abort(t) {
|
|
1298
1547
|
if (this.signal.aborted) return;
|
|
1299
1548
|
this.signal.reason = t;
|
|
@@ -1304,21 +1553,21 @@ if (typeof St === "undefined") {
|
|
|
1304
1553
|
this.signal.onabort?.(t);
|
|
1305
1554
|
}
|
|
1306
1555
|
};
|
|
1307
|
-
let t =
|
|
1308
|
-
const
|
|
1556
|
+
let t = Q.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1557
|
+
const warnACPolyfill = () => {
|
|
1309
1558
|
if (!t) return;
|
|
1310
1559
|
t = false;
|
|
1311
|
-
|
|
1560
|
+
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);
|
|
1312
1561
|
};
|
|
1313
1562
|
}
|
|
1314
1563
|
|
|
1315
|
-
const
|
|
1564
|
+
const shouldWarn = t => !X.has(t);
|
|
1316
1565
|
|
|
1317
|
-
const
|
|
1566
|
+
const st = Symbol("type");
|
|
1318
1567
|
|
|
1319
|
-
const
|
|
1568
|
+
const isPosInt = t => t && t === Math.floor(t) && t > 0 && isFinite(t);
|
|
1320
1569
|
|
|
1321
|
-
const
|
|
1570
|
+
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;
|
|
1322
1571
|
|
|
1323
1572
|
class ZeroArray extends Array {
|
|
1324
1573
|
constructor(t) {
|
|
@@ -1332,7 +1581,7 @@ class Stack {
|
|
|
1332
1581
|
length;
|
|
1333
1582
|
static #g=false;
|
|
1334
1583
|
static create(t) {
|
|
1335
|
-
const e =
|
|
1584
|
+
const e = getUintArray(t);
|
|
1336
1585
|
if (!e) return [];
|
|
1337
1586
|
Stack.#g = true;
|
|
1338
1587
|
const s = new Stack(t, e);
|
|
@@ -1356,12 +1605,12 @@ class Stack {
|
|
|
1356
1605
|
|
|
1357
1606
|
class LRUCache {
|
|
1358
1607
|
#m;
|
|
1359
|
-
#w;
|
|
1360
1608
|
#y;
|
|
1609
|
+
#w;
|
|
1361
1610
|
#b;
|
|
1362
1611
|
#S;
|
|
1363
1612
|
#k;
|
|
1364
|
-
#
|
|
1613
|
+
#x;
|
|
1365
1614
|
ttl;
|
|
1366
1615
|
ttlResolution;
|
|
1367
1616
|
ttlAutopurge;
|
|
@@ -1377,10 +1626,10 @@ class LRUCache {
|
|
|
1377
1626
|
allowStaleOnFetchAbort;
|
|
1378
1627
|
allowStaleOnFetchRejection;
|
|
1379
1628
|
ignoreFetchAbort;
|
|
1380
|
-
#
|
|
1629
|
+
#v;
|
|
1381
1630
|
#E;
|
|
1382
|
-
#T;
|
|
1383
1631
|
#C;
|
|
1632
|
+
#T;
|
|
1384
1633
|
#L;
|
|
1385
1634
|
#A;
|
|
1386
1635
|
#M;
|
|
@@ -1392,16 +1641,16 @@ class LRUCache {
|
|
|
1392
1641
|
#D;
|
|
1393
1642
|
#N;
|
|
1394
1643
|
#B;
|
|
1395
|
-
#W;
|
|
1396
1644
|
#_;
|
|
1397
1645
|
#I;
|
|
1646
|
+
#W;
|
|
1398
1647
|
static unsafeExposeInternals(t) {
|
|
1399
1648
|
return {
|
|
1400
1649
|
starts: t.#D,
|
|
1401
1650
|
ttls: t.#N,
|
|
1402
1651
|
sizes: t.#z,
|
|
1403
|
-
keyMap: t.#
|
|
1404
|
-
keyList: t.#
|
|
1652
|
+
keyMap: t.#C,
|
|
1653
|
+
keyList: t.#T,
|
|
1405
1654
|
valList: t.#L,
|
|
1406
1655
|
next: t.#A,
|
|
1407
1656
|
prev: t.#M,
|
|
@@ -1413,9 +1662,9 @@ class LRUCache {
|
|
|
1413
1662
|
},
|
|
1414
1663
|
free: t.#R,
|
|
1415
1664
|
isBackgroundFetch: e => t.#j(e),
|
|
1416
|
-
backgroundFetch: (e, s, i, n) => t
|
|
1665
|
+
backgroundFetch: (e, s, i, n) => t.#$(e, s, i, n),
|
|
1417
1666
|
moveToTail: e => t.#G(e),
|
|
1418
|
-
indexes: e => t
|
|
1667
|
+
indexes: e => t.#U(e),
|
|
1419
1668
|
rindexes: e => t.#q(e),
|
|
1420
1669
|
isStale: e => t.#H(e)
|
|
1421
1670
|
};
|
|
@@ -1424,22 +1673,22 @@ class LRUCache {
|
|
|
1424
1673
|
return this.#m;
|
|
1425
1674
|
}
|
|
1426
1675
|
get maxSize() {
|
|
1427
|
-
return this.#
|
|
1676
|
+
return this.#y;
|
|
1428
1677
|
}
|
|
1429
1678
|
get calculatedSize() {
|
|
1430
1679
|
return this.#E;
|
|
1431
1680
|
}
|
|
1432
1681
|
get size() {
|
|
1433
|
-
return this.#
|
|
1682
|
+
return this.#v;
|
|
1434
1683
|
}
|
|
1435
1684
|
get fetchMethod() {
|
|
1436
1685
|
return this.#k;
|
|
1437
1686
|
}
|
|
1438
1687
|
get memoMethod() {
|
|
1439
|
-
return this.#
|
|
1688
|
+
return this.#x;
|
|
1440
1689
|
}
|
|
1441
1690
|
get dispose() {
|
|
1442
|
-
return this.#
|
|
1691
|
+
return this.#w;
|
|
1443
1692
|
}
|
|
1444
1693
|
get onInsert() {
|
|
1445
1694
|
return this.#b;
|
|
@@ -1448,20 +1697,20 @@ class LRUCache {
|
|
|
1448
1697
|
return this.#S;
|
|
1449
1698
|
}
|
|
1450
1699
|
constructor(t) {
|
|
1451
|
-
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:
|
|
1452
|
-
if (e !== 0 && !
|
|
1700
|
+
const {max: e = 0, ttl: s, ttlResolution: i = 1, ttlAutopurge: n, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: h, dispose: a, onInsert: l, disposeAfter: c, noDisposeOnSet: f, noUpdateTTL: u, maxSize: d = 0, maxEntrySize: p = 0, sizeCalculation: g, fetchMethod: y, memoMethod: w, noDeleteOnFetchRejection: b, noDeleteOnStaleGet: S, allowStaleOnFetchRejection: k, allowStaleOnFetchAbort: x, ignoreFetchAbort: v} = t;
|
|
1701
|
+
if (e !== 0 && !isPosInt(e)) {
|
|
1453
1702
|
throw new TypeError("max option must be a nonnegative integer");
|
|
1454
1703
|
}
|
|
1455
|
-
const
|
|
1456
|
-
if (!
|
|
1704
|
+
const E = e ? getUintArray(e) : Array;
|
|
1705
|
+
if (!E) {
|
|
1457
1706
|
throw new Error("invalid max value: " + e);
|
|
1458
1707
|
}
|
|
1459
1708
|
this.#m = e;
|
|
1460
|
-
this.#
|
|
1461
|
-
this.maxEntrySize = p || this.#
|
|
1709
|
+
this.#y = d;
|
|
1710
|
+
this.maxEntrySize = p || this.#y;
|
|
1462
1711
|
this.sizeCalculation = g;
|
|
1463
1712
|
if (this.sizeCalculation) {
|
|
1464
|
-
if (!this.#
|
|
1713
|
+
if (!this.#y && !this.maxEntrySize) {
|
|
1465
1714
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
1466
1715
|
}
|
|
1467
1716
|
if (typeof this.sizeCalculation !== "function") {
|
|
@@ -1471,24 +1720,24 @@ class LRUCache {
|
|
|
1471
1720
|
if (w !== undefined && typeof w !== "function") {
|
|
1472
1721
|
throw new TypeError("memoMethod must be a function if defined");
|
|
1473
1722
|
}
|
|
1474
|
-
this.#
|
|
1475
|
-
if (
|
|
1723
|
+
this.#x = w;
|
|
1724
|
+
if (y !== undefined && typeof y !== "function") {
|
|
1476
1725
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
1477
1726
|
}
|
|
1478
|
-
this.#k =
|
|
1479
|
-
this.#
|
|
1480
|
-
this.#
|
|
1481
|
-
this.#
|
|
1727
|
+
this.#k = y;
|
|
1728
|
+
this.#_ = !!y;
|
|
1729
|
+
this.#C = new Map;
|
|
1730
|
+
this.#T = new Array(e).fill(undefined);
|
|
1482
1731
|
this.#L = new Array(e).fill(undefined);
|
|
1483
|
-
this.#A = new
|
|
1484
|
-
this.#M = new
|
|
1732
|
+
this.#A = new E(e);
|
|
1733
|
+
this.#M = new E(e);
|
|
1485
1734
|
this.#P = 0;
|
|
1486
1735
|
this.#F = 0;
|
|
1487
1736
|
this.#R = Stack.create(e);
|
|
1488
|
-
this.#
|
|
1737
|
+
this.#v = 0;
|
|
1489
1738
|
this.#E = 0;
|
|
1490
1739
|
if (typeof a === "function") {
|
|
1491
|
-
this.#
|
|
1740
|
+
this.#w = a;
|
|
1492
1741
|
}
|
|
1493
1742
|
if (typeof l === "function") {
|
|
1494
1743
|
this.#b = l;
|
|
@@ -1500,66 +1749,66 @@ class LRUCache {
|
|
|
1500
1749
|
this.#S = undefined;
|
|
1501
1750
|
this.#O = undefined;
|
|
1502
1751
|
}
|
|
1503
|
-
this.#B = !!this.#
|
|
1504
|
-
this.#
|
|
1505
|
-
this.#
|
|
1752
|
+
this.#B = !!this.#w;
|
|
1753
|
+
this.#W = !!this.#b;
|
|
1754
|
+
this.#I = !!this.#S;
|
|
1506
1755
|
this.noDisposeOnSet = !!f;
|
|
1507
1756
|
this.noUpdateTTL = !!u;
|
|
1508
|
-
this.noDeleteOnFetchRejection = !!
|
|
1509
|
-
this.allowStaleOnFetchRejection = !!
|
|
1510
|
-
this.allowStaleOnFetchAbort = !!
|
|
1757
|
+
this.noDeleteOnFetchRejection = !!b;
|
|
1758
|
+
this.allowStaleOnFetchRejection = !!k;
|
|
1759
|
+
this.allowStaleOnFetchAbort = !!x;
|
|
1511
1760
|
this.ignoreFetchAbort = !!v;
|
|
1512
1761
|
if (this.maxEntrySize !== 0) {
|
|
1513
|
-
if (this.#
|
|
1514
|
-
if (!
|
|
1762
|
+
if (this.#y !== 0) {
|
|
1763
|
+
if (!isPosInt(this.#y)) {
|
|
1515
1764
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
1516
1765
|
}
|
|
1517
1766
|
}
|
|
1518
|
-
if (!
|
|
1767
|
+
if (!isPosInt(this.maxEntrySize)) {
|
|
1519
1768
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
1520
1769
|
}
|
|
1521
1770
|
this.#Z();
|
|
1522
1771
|
}
|
|
1523
1772
|
this.allowStale = !!h;
|
|
1524
|
-
this.noDeleteOnStaleGet = !!
|
|
1773
|
+
this.noDeleteOnStaleGet = !!S;
|
|
1525
1774
|
this.updateAgeOnGet = !!r;
|
|
1526
1775
|
this.updateAgeOnHas = !!o;
|
|
1527
|
-
this.ttlResolution =
|
|
1776
|
+
this.ttlResolution = isPosInt(i) || i === 0 ? i : 1;
|
|
1528
1777
|
this.ttlAutopurge = !!n;
|
|
1529
1778
|
this.ttl = s || 0;
|
|
1530
1779
|
if (this.ttl) {
|
|
1531
|
-
if (!
|
|
1780
|
+
if (!isPosInt(this.ttl)) {
|
|
1532
1781
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
1533
1782
|
}
|
|
1534
1783
|
this.#V();
|
|
1535
1784
|
}
|
|
1536
|
-
if (this.#m === 0 && this.ttl === 0 && this.#
|
|
1785
|
+
if (this.#m === 0 && this.ttl === 0 && this.#y === 0) {
|
|
1537
1786
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
1538
1787
|
}
|
|
1539
|
-
if (!this.ttlAutopurge && !this.#m && !this.#
|
|
1788
|
+
if (!this.ttlAutopurge && !this.#m && !this.#y) {
|
|
1540
1789
|
const t = "LRU_CACHE_UNBOUNDED";
|
|
1541
|
-
if (
|
|
1542
|
-
|
|
1790
|
+
if (shouldWarn(t)) {
|
|
1791
|
+
X.add(t);
|
|
1543
1792
|
const e = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
|
1544
|
-
|
|
1793
|
+
emitWarning(e, "UnboundedCacheWarning", t, LRUCache);
|
|
1545
1794
|
}
|
|
1546
1795
|
}
|
|
1547
1796
|
}
|
|
1548
1797
|
getRemainingTTL(t) {
|
|
1549
|
-
return this.#
|
|
1798
|
+
return this.#C.has(t) ? Infinity : 0;
|
|
1550
1799
|
}
|
|
1551
1800
|
#V() {
|
|
1552
1801
|
const t = new ZeroArray(this.#m);
|
|
1553
1802
|
const e = new ZeroArray(this.#m);
|
|
1554
1803
|
this.#N = t;
|
|
1555
1804
|
this.#D = e;
|
|
1556
|
-
this.#J = (s, i, n =
|
|
1805
|
+
this.#J = (s, i, n = Y.now()) => {
|
|
1557
1806
|
e[s] = i !== 0 ? n : 0;
|
|
1558
1807
|
t[s] = i;
|
|
1559
1808
|
if (i !== 0 && this.ttlAutopurge) {
|
|
1560
1809
|
const t = setTimeout((() => {
|
|
1561
1810
|
if (this.#H(s)) {
|
|
1562
|
-
this.#K(this.#
|
|
1811
|
+
this.#K(this.#T[s], "expire");
|
|
1563
1812
|
}
|
|
1564
1813
|
}), i + 1);
|
|
1565
1814
|
if (t.unref) {
|
|
@@ -1568,23 +1817,23 @@ class LRUCache {
|
|
|
1568
1817
|
}
|
|
1569
1818
|
};
|
|
1570
1819
|
this.#Y = s => {
|
|
1571
|
-
e[s] = t[s] !== 0 ?
|
|
1820
|
+
e[s] = t[s] !== 0 ? Y.now() : 0;
|
|
1572
1821
|
};
|
|
1573
|
-
this.#X = (
|
|
1574
|
-
if (t[
|
|
1575
|
-
const
|
|
1576
|
-
const
|
|
1577
|
-
if (!
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1822
|
+
this.#X = (i, n) => {
|
|
1823
|
+
if (t[n]) {
|
|
1824
|
+
const r = t[n];
|
|
1825
|
+
const o = e[n];
|
|
1826
|
+
if (!r || !o) return;
|
|
1827
|
+
i.ttl = r;
|
|
1828
|
+
i.start = o;
|
|
1829
|
+
i.now = s || getNow();
|
|
1830
|
+
const h = i.now - o;
|
|
1831
|
+
i.remainingTTL = r - h;
|
|
1583
1832
|
}
|
|
1584
1833
|
};
|
|
1585
1834
|
let s = 0;
|
|
1586
|
-
const
|
|
1587
|
-
const t =
|
|
1835
|
+
const getNow = () => {
|
|
1836
|
+
const t = Y.now();
|
|
1588
1837
|
if (this.ttlResolution > 0) {
|
|
1589
1838
|
s = t;
|
|
1590
1839
|
const e = setTimeout((() => s = 0), this.ttlResolution);
|
|
@@ -1594,23 +1843,23 @@ class LRUCache {
|
|
|
1594
1843
|
}
|
|
1595
1844
|
return t;
|
|
1596
1845
|
};
|
|
1597
|
-
this.getRemainingTTL =
|
|
1598
|
-
const
|
|
1599
|
-
if (
|
|
1846
|
+
this.getRemainingTTL = i => {
|
|
1847
|
+
const n = this.#C.get(i);
|
|
1848
|
+
if (n === undefined) {
|
|
1600
1849
|
return 0;
|
|
1601
1850
|
}
|
|
1602
|
-
const
|
|
1603
|
-
const
|
|
1604
|
-
if (!
|
|
1851
|
+
const r = t[n];
|
|
1852
|
+
const o = e[n];
|
|
1853
|
+
if (!r || !o) {
|
|
1605
1854
|
return Infinity;
|
|
1606
1855
|
}
|
|
1607
|
-
const
|
|
1608
|
-
return
|
|
1856
|
+
const h = (s || getNow()) - o;
|
|
1857
|
+
return r - h;
|
|
1609
1858
|
};
|
|
1610
|
-
this.#H =
|
|
1611
|
-
const
|
|
1612
|
-
const
|
|
1613
|
-
return !!
|
|
1859
|
+
this.#H = i => {
|
|
1860
|
+
const n = e[i];
|
|
1861
|
+
const r = t[i];
|
|
1862
|
+
return !!r && !!n && (s || getNow()) - n > r;
|
|
1614
1863
|
};
|
|
1615
1864
|
}
|
|
1616
1865
|
#Y=() => {};
|
|
@@ -1629,13 +1878,13 @@ class LRUCache {
|
|
|
1629
1878
|
if (this.#j(e)) {
|
|
1630
1879
|
return 0;
|
|
1631
1880
|
}
|
|
1632
|
-
if (!
|
|
1881
|
+
if (!isPosInt(s)) {
|
|
1633
1882
|
if (i) {
|
|
1634
1883
|
if (typeof i !== "function") {
|
|
1635
1884
|
throw new TypeError("sizeCalculation must be a function");
|
|
1636
1885
|
}
|
|
1637
1886
|
s = i(e, t);
|
|
1638
|
-
if (!
|
|
1887
|
+
if (!isPosInt(s)) {
|
|
1639
1888
|
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1640
1889
|
}
|
|
1641
1890
|
} else {
|
|
@@ -1646,8 +1895,8 @@ class LRUCache {
|
|
|
1646
1895
|
};
|
|
1647
1896
|
this.#et = (e, s, i) => {
|
|
1648
1897
|
t[e] = s;
|
|
1649
|
-
if (this.#
|
|
1650
|
-
const s = this.#
|
|
1898
|
+
if (this.#y) {
|
|
1899
|
+
const s = this.#y - t[e];
|
|
1651
1900
|
while (this.#E > s) {
|
|
1652
1901
|
this.#st(true);
|
|
1653
1902
|
}
|
|
@@ -1667,8 +1916,8 @@ class LRUCache {
|
|
|
1667
1916
|
}
|
|
1668
1917
|
return 0;
|
|
1669
1918
|
};
|
|
1670
|
-
*
|
|
1671
|
-
if (this.#
|
|
1919
|
+
* #U({allowStale: t = this.allowStale} = {}) {
|
|
1920
|
+
if (this.#v) {
|
|
1672
1921
|
for (let e = this.#F; true; ) {
|
|
1673
1922
|
if (!this.#it(e)) {
|
|
1674
1923
|
break;
|
|
@@ -1685,7 +1934,7 @@ class LRUCache {
|
|
|
1685
1934
|
}
|
|
1686
1935
|
}
|
|
1687
1936
|
* #q({allowStale: t = this.allowStale} = {}) {
|
|
1688
|
-
if (this.#
|
|
1937
|
+
if (this.#v) {
|
|
1689
1938
|
for (let e = this.#P; true; ) {
|
|
1690
1939
|
if (!this.#it(e)) {
|
|
1691
1940
|
break;
|
|
@@ -1702,25 +1951,25 @@ class LRUCache {
|
|
|
1702
1951
|
}
|
|
1703
1952
|
}
|
|
1704
1953
|
#it(t) {
|
|
1705
|
-
return t !== undefined && this.#
|
|
1954
|
+
return t !== undefined && this.#C.get(this.#T[t]) === t;
|
|
1706
1955
|
}
|
|
1707
1956
|
* entries() {
|
|
1708
|
-
for (const t of this
|
|
1709
|
-
if (this.#L[t] !== undefined && this.#
|
|
1710
|
-
yield [ this.#
|
|
1957
|
+
for (const t of this.#U()) {
|
|
1958
|
+
if (this.#L[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#L[t])) {
|
|
1959
|
+
yield [ this.#T[t], this.#L[t] ];
|
|
1711
1960
|
}
|
|
1712
1961
|
}
|
|
1713
1962
|
}
|
|
1714
1963
|
* rentries() {
|
|
1715
1964
|
for (const t of this.#q()) {
|
|
1716
|
-
if (this.#L[t] !== undefined && this.#
|
|
1717
|
-
yield [ this.#
|
|
1965
|
+
if (this.#L[t] !== undefined && this.#T[t] !== undefined && !this.#j(this.#L[t])) {
|
|
1966
|
+
yield [ this.#T[t], this.#L[t] ];
|
|
1718
1967
|
}
|
|
1719
1968
|
}
|
|
1720
1969
|
}
|
|
1721
1970
|
* keys() {
|
|
1722
|
-
for (const t of this
|
|
1723
|
-
const e = this.#
|
|
1971
|
+
for (const t of this.#U()) {
|
|
1972
|
+
const e = this.#T[t];
|
|
1724
1973
|
if (e !== undefined && !this.#j(this.#L[t])) {
|
|
1725
1974
|
yield e;
|
|
1726
1975
|
}
|
|
@@ -1728,14 +1977,14 @@ class LRUCache {
|
|
|
1728
1977
|
}
|
|
1729
1978
|
* rkeys() {
|
|
1730
1979
|
for (const t of this.#q()) {
|
|
1731
|
-
const e = this.#
|
|
1980
|
+
const e = this.#T[t];
|
|
1732
1981
|
if (e !== undefined && !this.#j(this.#L[t])) {
|
|
1733
1982
|
yield e;
|
|
1734
1983
|
}
|
|
1735
1984
|
}
|
|
1736
1985
|
}
|
|
1737
1986
|
* values() {
|
|
1738
|
-
for (const t of this
|
|
1987
|
+
for (const t of this.#U()) {
|
|
1739
1988
|
const e = this.#L[t];
|
|
1740
1989
|
if (e !== undefined && !this.#j(this.#L[t])) {
|
|
1741
1990
|
yield this.#L[t];
|
|
@@ -1755,21 +2004,21 @@ class LRUCache {
|
|
|
1755
2004
|
}
|
|
1756
2005
|
[Symbol.toStringTag]="LRUCache";
|
|
1757
2006
|
find(t, e = {}) {
|
|
1758
|
-
for (const s of this
|
|
2007
|
+
for (const s of this.#U()) {
|
|
1759
2008
|
const i = this.#L[s];
|
|
1760
2009
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1761
2010
|
if (n === undefined) continue;
|
|
1762
|
-
if (t(n, this.#
|
|
1763
|
-
return this.get(this.#
|
|
2011
|
+
if (t(n, this.#T[s], this)) {
|
|
2012
|
+
return this.get(this.#T[s], e);
|
|
1764
2013
|
}
|
|
1765
2014
|
}
|
|
1766
2015
|
}
|
|
1767
2016
|
forEach(t, e = this) {
|
|
1768
|
-
for (const s of this
|
|
2017
|
+
for (const s of this.#U()) {
|
|
1769
2018
|
const i = this.#L[s];
|
|
1770
2019
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1771
2020
|
if (n === undefined) continue;
|
|
1772
|
-
t.call(e, n, this.#
|
|
2021
|
+
t.call(e, n, this.#T[s], this);
|
|
1773
2022
|
}
|
|
1774
2023
|
}
|
|
1775
2024
|
rforEach(t, e = this) {
|
|
@@ -1777,7 +2026,7 @@ class LRUCache {
|
|
|
1777
2026
|
const i = this.#L[s];
|
|
1778
2027
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1779
2028
|
if (n === undefined) continue;
|
|
1780
|
-
t.call(e, n, this.#
|
|
2029
|
+
t.call(e, n, this.#T[s], this);
|
|
1781
2030
|
}
|
|
1782
2031
|
}
|
|
1783
2032
|
purgeStale() {
|
|
@@ -1786,14 +2035,14 @@ class LRUCache {
|
|
|
1786
2035
|
allowStale: true
|
|
1787
2036
|
})) {
|
|
1788
2037
|
if (this.#H(e)) {
|
|
1789
|
-
this.#K(this.#
|
|
2038
|
+
this.#K(this.#T[e], "expire");
|
|
1790
2039
|
t = true;
|
|
1791
2040
|
}
|
|
1792
2041
|
}
|
|
1793
2042
|
return t;
|
|
1794
2043
|
}
|
|
1795
2044
|
info(t) {
|
|
1796
|
-
const e = this.#
|
|
2045
|
+
const e = this.#C.get(t);
|
|
1797
2046
|
if (e === undefined) return undefined;
|
|
1798
2047
|
const s = this.#L[e];
|
|
1799
2048
|
const i = this.#j(s) ? s.__staleWhileFetching : s;
|
|
@@ -1805,7 +2054,7 @@ class LRUCache {
|
|
|
1805
2054
|
const t = this.#N[e];
|
|
1806
2055
|
const s = this.#D[e];
|
|
1807
2056
|
if (t && s) {
|
|
1808
|
-
const e = t - (
|
|
2057
|
+
const e = t - (Y.now() - s);
|
|
1809
2058
|
n.ttl = e;
|
|
1810
2059
|
n.start = Date.now();
|
|
1811
2060
|
}
|
|
@@ -1817,10 +2066,10 @@ class LRUCache {
|
|
|
1817
2066
|
}
|
|
1818
2067
|
dump() {
|
|
1819
2068
|
const t = [];
|
|
1820
|
-
for (const e of this
|
|
2069
|
+
for (const e of this.#U({
|
|
1821
2070
|
allowStale: true
|
|
1822
2071
|
})) {
|
|
1823
|
-
const s = this.#
|
|
2072
|
+
const s = this.#T[e];
|
|
1824
2073
|
const i = this.#L[e];
|
|
1825
2074
|
const n = this.#j(i) ? i.__staleWhileFetching : i;
|
|
1826
2075
|
if (n === undefined || s === undefined) continue;
|
|
@@ -1829,7 +2078,7 @@ class LRUCache {
|
|
|
1829
2078
|
};
|
|
1830
2079
|
if (this.#N && this.#D) {
|
|
1831
2080
|
r.ttl = this.#N[e];
|
|
1832
|
-
const t =
|
|
2081
|
+
const t = Y.now() - this.#D[e];
|
|
1833
2082
|
r.start = Math.floor(Date.now() - t);
|
|
1834
2083
|
}
|
|
1835
2084
|
if (this.#z) {
|
|
@@ -1844,7 +2093,7 @@ class LRUCache {
|
|
|
1844
2093
|
for (const [e, s] of t) {
|
|
1845
2094
|
if (s.start) {
|
|
1846
2095
|
const t = Date.now() - s.start;
|
|
1847
|
-
s.start =
|
|
2096
|
+
s.start = Y.now() - t;
|
|
1848
2097
|
}
|
|
1849
2098
|
this.set(e, s.value, s);
|
|
1850
2099
|
}
|
|
@@ -1865,42 +2114,42 @@ class LRUCache {
|
|
|
1865
2114
|
this.#K(t, "set");
|
|
1866
2115
|
return this;
|
|
1867
2116
|
}
|
|
1868
|
-
let c = this.#
|
|
2117
|
+
let c = this.#v === 0 ? undefined : this.#C.get(t);
|
|
1869
2118
|
if (c === undefined) {
|
|
1870
|
-
c = this.#
|
|
1871
|
-
this.#
|
|
2119
|
+
c = this.#v === 0 ? this.#F : this.#R.length !== 0 ? this.#R.pop() : this.#v === this.#m ? this.#st(false) : this.#v;
|
|
2120
|
+
this.#T[c] = t;
|
|
1872
2121
|
this.#L[c] = e;
|
|
1873
|
-
this.#
|
|
2122
|
+
this.#C.set(t, c);
|
|
1874
2123
|
this.#A[this.#F] = c;
|
|
1875
2124
|
this.#M[c] = this.#F;
|
|
1876
2125
|
this.#F = c;
|
|
1877
|
-
this.#
|
|
2126
|
+
this.#v++;
|
|
1878
2127
|
this.#et(c, l, h);
|
|
1879
2128
|
if (h) h.set = "add";
|
|
1880
2129
|
a = false;
|
|
1881
|
-
if (this.#
|
|
2130
|
+
if (this.#W) {
|
|
1882
2131
|
this.#b?.(e, t, "add");
|
|
1883
2132
|
}
|
|
1884
2133
|
} else {
|
|
1885
2134
|
this.#G(c);
|
|
1886
2135
|
const s = this.#L[c];
|
|
1887
2136
|
if (e !== s) {
|
|
1888
|
-
if (this.#
|
|
2137
|
+
if (this.#_ && this.#j(s)) {
|
|
1889
2138
|
s.__abortController.abort(new Error("replaced"));
|
|
1890
2139
|
const {__staleWhileFetching: e} = s;
|
|
1891
2140
|
if (e !== undefined && !r) {
|
|
1892
2141
|
if (this.#B) {
|
|
1893
|
-
this.#
|
|
2142
|
+
this.#w?.(e, t, "set");
|
|
1894
2143
|
}
|
|
1895
|
-
if (this.#
|
|
2144
|
+
if (this.#I) {
|
|
1896
2145
|
this.#O?.push([ e, t, "set" ]);
|
|
1897
2146
|
}
|
|
1898
2147
|
}
|
|
1899
2148
|
} else if (!r) {
|
|
1900
2149
|
if (this.#B) {
|
|
1901
|
-
this.#
|
|
2150
|
+
this.#w?.(s, t, "set");
|
|
1902
2151
|
}
|
|
1903
|
-
if (this.#
|
|
2152
|
+
if (this.#I) {
|
|
1904
2153
|
this.#O?.push([ s, t, "set" ]);
|
|
1905
2154
|
}
|
|
1906
2155
|
}
|
|
@@ -1915,7 +2164,7 @@ class LRUCache {
|
|
|
1915
2164
|
} else if (h) {
|
|
1916
2165
|
h.set = "update";
|
|
1917
2166
|
}
|
|
1918
|
-
if (this.#
|
|
2167
|
+
if (this.#W) {
|
|
1919
2168
|
this.onInsert?.(e, t, e === s ? "update" : "replace");
|
|
1920
2169
|
}
|
|
1921
2170
|
}
|
|
@@ -1928,7 +2177,7 @@ class LRUCache {
|
|
|
1928
2177
|
}
|
|
1929
2178
|
if (h) this.#X(h, c);
|
|
1930
2179
|
}
|
|
1931
|
-
if (!r && this.#
|
|
2180
|
+
if (!r && this.#I && this.#O) {
|
|
1932
2181
|
const t = this.#O;
|
|
1933
2182
|
let e;
|
|
1934
2183
|
while (e = t?.shift()) {
|
|
@@ -1939,7 +2188,7 @@ class LRUCache {
|
|
|
1939
2188
|
}
|
|
1940
2189
|
pop() {
|
|
1941
2190
|
try {
|
|
1942
|
-
while (this.#
|
|
2191
|
+
while (this.#v) {
|
|
1943
2192
|
const t = this.#L[this.#P];
|
|
1944
2193
|
this.#st(true);
|
|
1945
2194
|
if (this.#j(t)) {
|
|
@@ -1951,7 +2200,7 @@ class LRUCache {
|
|
|
1951
2200
|
}
|
|
1952
2201
|
}
|
|
1953
2202
|
} finally {
|
|
1954
|
-
if (this.#
|
|
2203
|
+
if (this.#I && this.#O) {
|
|
1955
2204
|
const t = this.#O;
|
|
1956
2205
|
let e;
|
|
1957
2206
|
while (e = t?.shift()) {
|
|
@@ -1962,37 +2211,37 @@ class LRUCache {
|
|
|
1962
2211
|
}
|
|
1963
2212
|
#st(t) {
|
|
1964
2213
|
const e = this.#P;
|
|
1965
|
-
const s = this.#
|
|
2214
|
+
const s = this.#T[e];
|
|
1966
2215
|
const i = this.#L[e];
|
|
1967
|
-
if (this.#
|
|
2216
|
+
if (this.#_ && this.#j(i)) {
|
|
1968
2217
|
i.__abortController.abort(new Error("evicted"));
|
|
1969
|
-
} else if (this.#B || this.#
|
|
2218
|
+
} else if (this.#B || this.#I) {
|
|
1970
2219
|
if (this.#B) {
|
|
1971
|
-
this.#
|
|
2220
|
+
this.#w?.(i, s, "evict");
|
|
1972
2221
|
}
|
|
1973
|
-
if (this.#
|
|
2222
|
+
if (this.#I) {
|
|
1974
2223
|
this.#O?.push([ i, s, "evict" ]);
|
|
1975
2224
|
}
|
|
1976
2225
|
}
|
|
1977
2226
|
this.#Q(e);
|
|
1978
2227
|
if (t) {
|
|
1979
|
-
this.#
|
|
2228
|
+
this.#T[e] = undefined;
|
|
1980
2229
|
this.#L[e] = undefined;
|
|
1981
2230
|
this.#R.push(e);
|
|
1982
2231
|
}
|
|
1983
|
-
if (this.#
|
|
2232
|
+
if (this.#v === 1) {
|
|
1984
2233
|
this.#P = this.#F = 0;
|
|
1985
2234
|
this.#R.length = 0;
|
|
1986
2235
|
} else {
|
|
1987
2236
|
this.#P = this.#A[e];
|
|
1988
2237
|
}
|
|
1989
|
-
this.#
|
|
1990
|
-
this.#
|
|
2238
|
+
this.#C.delete(s);
|
|
2239
|
+
this.#v--;
|
|
1991
2240
|
return e;
|
|
1992
2241
|
}
|
|
1993
2242
|
has(t, e = {}) {
|
|
1994
2243
|
const {updateAgeOnHas: s = this.updateAgeOnHas, status: i} = e;
|
|
1995
|
-
const n = this.#
|
|
2244
|
+
const n = this.#C.get(t);
|
|
1996
2245
|
if (n !== undefined) {
|
|
1997
2246
|
const t = this.#L[n];
|
|
1998
2247
|
if (this.#j(t) && t.__staleWhileFetching === undefined) {
|
|
@@ -2018,19 +2267,19 @@ class LRUCache {
|
|
|
2018
2267
|
}
|
|
2019
2268
|
peek(t, e = {}) {
|
|
2020
2269
|
const {allowStale: s = this.allowStale} = e;
|
|
2021
|
-
const i = this.#
|
|
2270
|
+
const i = this.#C.get(t);
|
|
2022
2271
|
if (i === undefined || !s && this.#H(i)) {
|
|
2023
2272
|
return;
|
|
2024
2273
|
}
|
|
2025
2274
|
const n = this.#L[i];
|
|
2026
2275
|
return this.#j(n) ? n.__staleWhileFetching : n;
|
|
2027
2276
|
}
|
|
2028
|
-
|
|
2277
|
+
#$(t, e, s, i) {
|
|
2029
2278
|
const n = e === undefined ? undefined : this.#L[e];
|
|
2030
2279
|
if (this.#j(n)) {
|
|
2031
2280
|
return n;
|
|
2032
2281
|
}
|
|
2033
|
-
const r = new
|
|
2282
|
+
const r = new tt;
|
|
2034
2283
|
const {signal: o} = s;
|
|
2035
2284
|
o?.addEventListener("abort", (() => r.abort(o.reason)), {
|
|
2036
2285
|
signal: r.signal
|
|
@@ -2040,26 +2289,26 @@ class LRUCache {
|
|
|
2040
2289
|
options: s,
|
|
2041
2290
|
context: i
|
|
2042
2291
|
};
|
|
2043
|
-
const
|
|
2292
|
+
const cb = (i, n = false) => {
|
|
2044
2293
|
const {aborted: o} = r.signal;
|
|
2045
|
-
const
|
|
2294
|
+
const l = s.ignoreFetchAbort && i !== undefined;
|
|
2046
2295
|
if (s.status) {
|
|
2047
2296
|
if (o && !n) {
|
|
2048
2297
|
s.status.fetchAborted = true;
|
|
2049
2298
|
s.status.fetchError = r.signal.reason;
|
|
2050
|
-
if (
|
|
2299
|
+
if (l) s.status.fetchAbortIgnored = true;
|
|
2051
2300
|
} else {
|
|
2052
2301
|
s.status.fetchResolved = true;
|
|
2053
2302
|
}
|
|
2054
2303
|
}
|
|
2055
|
-
if (o && !
|
|
2056
|
-
return
|
|
2304
|
+
if (o && !l && !n) {
|
|
2305
|
+
return fetchFail(r.signal.reason);
|
|
2057
2306
|
}
|
|
2058
|
-
const
|
|
2059
|
-
if (this.#L[e] ===
|
|
2307
|
+
const c = a;
|
|
2308
|
+
if (this.#L[e] === a) {
|
|
2060
2309
|
if (i === undefined) {
|
|
2061
|
-
if (
|
|
2062
|
-
this.#L[e] =
|
|
2310
|
+
if (c.__staleWhileFetching) {
|
|
2311
|
+
this.#L[e] = c.__staleWhileFetching;
|
|
2063
2312
|
} else {
|
|
2064
2313
|
this.#K(t, "fetch");
|
|
2065
2314
|
}
|
|
@@ -2070,37 +2319,37 @@ class LRUCache {
|
|
|
2070
2319
|
}
|
|
2071
2320
|
return i;
|
|
2072
2321
|
};
|
|
2073
|
-
const
|
|
2322
|
+
const eb = t => {
|
|
2074
2323
|
if (s.status) {
|
|
2075
2324
|
s.status.fetchRejected = true;
|
|
2076
2325
|
s.status.fetchError = t;
|
|
2077
2326
|
}
|
|
2078
|
-
return
|
|
2327
|
+
return fetchFail(t);
|
|
2079
2328
|
};
|
|
2080
|
-
const
|
|
2329
|
+
const fetchFail = i => {
|
|
2081
2330
|
const {aborted: n} = r.signal;
|
|
2082
2331
|
const o = n && s.allowStaleOnFetchAbort;
|
|
2083
2332
|
const h = o || s.allowStaleOnFetchRejection;
|
|
2084
|
-
const
|
|
2085
|
-
const
|
|
2086
|
-
if (this.#L[e] ===
|
|
2087
|
-
const s = !
|
|
2333
|
+
const l = h || s.noDeleteOnFetchRejection;
|
|
2334
|
+
const c = a;
|
|
2335
|
+
if (this.#L[e] === a) {
|
|
2336
|
+
const s = !l || c.__staleWhileFetching === undefined;
|
|
2088
2337
|
if (s) {
|
|
2089
2338
|
this.#K(t, "fetch");
|
|
2090
2339
|
} else if (!o) {
|
|
2091
|
-
this.#L[e] =
|
|
2340
|
+
this.#L[e] = c.__staleWhileFetching;
|
|
2092
2341
|
}
|
|
2093
2342
|
}
|
|
2094
2343
|
if (h) {
|
|
2095
|
-
if (s.status &&
|
|
2344
|
+
if (s.status && c.__staleWhileFetching !== undefined) {
|
|
2096
2345
|
s.status.returnedStale = true;
|
|
2097
2346
|
}
|
|
2098
|
-
return
|
|
2099
|
-
} else if (
|
|
2347
|
+
return c.__staleWhileFetching;
|
|
2348
|
+
} else if (c.__returned === c) {
|
|
2100
2349
|
throw i;
|
|
2101
2350
|
}
|
|
2102
2351
|
};
|
|
2103
|
-
const
|
|
2352
|
+
const pcall = (e, i) => {
|
|
2104
2353
|
const o = this.#k?.(t, n, h);
|
|
2105
2354
|
if (o && o instanceof Promise) {
|
|
2106
2355
|
o.then((t => e(t === undefined ? undefined : t)), i);
|
|
@@ -2109,46 +2358,46 @@ class LRUCache {
|
|
|
2109
2358
|
if (!s.ignoreFetchAbort || s.allowStaleOnFetchAbort) {
|
|
2110
2359
|
e(undefined);
|
|
2111
2360
|
if (s.allowStaleOnFetchAbort) {
|
|
2112
|
-
e = t =>
|
|
2361
|
+
e = t => cb(t, true);
|
|
2113
2362
|
}
|
|
2114
2363
|
}
|
|
2115
2364
|
}));
|
|
2116
2365
|
};
|
|
2117
2366
|
if (s.status) s.status.fetchDispatched = true;
|
|
2118
|
-
const
|
|
2119
|
-
const
|
|
2367
|
+
const a = new Promise(pcall).then(cb, eb);
|
|
2368
|
+
const l = Object.assign(a, {
|
|
2120
2369
|
__abortController: r,
|
|
2121
2370
|
__staleWhileFetching: n,
|
|
2122
2371
|
__returned: undefined
|
|
2123
2372
|
});
|
|
2124
2373
|
if (e === undefined) {
|
|
2125
|
-
this.set(t,
|
|
2374
|
+
this.set(t, l, {
|
|
2126
2375
|
...h.options,
|
|
2127
2376
|
status: undefined
|
|
2128
2377
|
});
|
|
2129
|
-
e = this.#
|
|
2378
|
+
e = this.#C.get(t);
|
|
2130
2379
|
} else {
|
|
2131
|
-
this.#L[e] =
|
|
2380
|
+
this.#L[e] = l;
|
|
2132
2381
|
}
|
|
2133
|
-
return
|
|
2382
|
+
return l;
|
|
2134
2383
|
}
|
|
2135
2384
|
#j(t) {
|
|
2136
|
-
if (!this.#
|
|
2385
|
+
if (!this.#_) return false;
|
|
2137
2386
|
const e = t;
|
|
2138
|
-
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof
|
|
2387
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof tt;
|
|
2139
2388
|
}
|
|
2140
2389
|
async fetch(t, e = {}) {
|
|
2141
|
-
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:
|
|
2142
|
-
if (!this.#
|
|
2143
|
-
if (
|
|
2390
|
+
const {allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: r = this.ttl, noDisposeOnSet: o = this.noDisposeOnSet, size: h = 0, sizeCalculation: a = this.sizeCalculation, noUpdateTTL: l = this.noUpdateTTL, noDeleteOnFetchRejection: c = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: f = this.allowStaleOnFetchRejection, ignoreFetchAbort: u = this.ignoreFetchAbort, allowStaleOnFetchAbort: d = this.allowStaleOnFetchAbort, context: p, forceRefresh: g = false, status: y, signal: w} = e;
|
|
2391
|
+
if (!this.#_) {
|
|
2392
|
+
if (y) y.fetch = "get";
|
|
2144
2393
|
return this.get(t, {
|
|
2145
2394
|
allowStale: s,
|
|
2146
2395
|
updateAgeOnGet: i,
|
|
2147
2396
|
noDeleteOnStaleGet: n,
|
|
2148
|
-
status:
|
|
2397
|
+
status: y
|
|
2149
2398
|
});
|
|
2150
2399
|
}
|
|
2151
|
-
const
|
|
2400
|
+
const b = {
|
|
2152
2401
|
allowStale: s,
|
|
2153
2402
|
updateAgeOnGet: i,
|
|
2154
2403
|
noDeleteOnStaleGet: n,
|
|
@@ -2161,40 +2410,40 @@ class LRUCache {
|
|
|
2161
2410
|
allowStaleOnFetchRejection: f,
|
|
2162
2411
|
allowStaleOnFetchAbort: d,
|
|
2163
2412
|
ignoreFetchAbort: u,
|
|
2164
|
-
status:
|
|
2413
|
+
status: y,
|
|
2165
2414
|
signal: w
|
|
2166
2415
|
};
|
|
2167
|
-
let
|
|
2168
|
-
if (
|
|
2169
|
-
if (
|
|
2170
|
-
const e = this
|
|
2416
|
+
let S = this.#C.get(t);
|
|
2417
|
+
if (S === undefined) {
|
|
2418
|
+
if (y) y.fetch = "miss";
|
|
2419
|
+
const e = this.#$(t, S, b, p);
|
|
2171
2420
|
return e.__returned = e;
|
|
2172
2421
|
} else {
|
|
2173
|
-
const e = this.#L[
|
|
2422
|
+
const e = this.#L[S];
|
|
2174
2423
|
if (this.#j(e)) {
|
|
2175
2424
|
const t = s && e.__staleWhileFetching !== undefined;
|
|
2176
|
-
if (
|
|
2177
|
-
|
|
2178
|
-
if (t)
|
|
2425
|
+
if (y) {
|
|
2426
|
+
y.fetch = "inflight";
|
|
2427
|
+
if (t) y.returnedStale = true;
|
|
2179
2428
|
}
|
|
2180
2429
|
return t ? e.__staleWhileFetching : e.__returned = e;
|
|
2181
2430
|
}
|
|
2182
|
-
const n = this.#H(
|
|
2431
|
+
const n = this.#H(S);
|
|
2183
2432
|
if (!g && !n) {
|
|
2184
|
-
if (
|
|
2185
|
-
this.#G(
|
|
2433
|
+
if (y) y.fetch = "hit";
|
|
2434
|
+
this.#G(S);
|
|
2186
2435
|
if (i) {
|
|
2187
|
-
this.#Y(
|
|
2436
|
+
this.#Y(S);
|
|
2188
2437
|
}
|
|
2189
|
-
if (
|
|
2438
|
+
if (y) this.#X(y, S);
|
|
2190
2439
|
return e;
|
|
2191
2440
|
}
|
|
2192
|
-
const r = this
|
|
2441
|
+
const r = this.#$(t, S, b, p);
|
|
2193
2442
|
const o = r.__staleWhileFetching !== undefined;
|
|
2194
2443
|
const h = o && s;
|
|
2195
|
-
if (
|
|
2196
|
-
|
|
2197
|
-
if (h && n)
|
|
2444
|
+
if (y) {
|
|
2445
|
+
y.fetch = n ? "stale" : "refresh";
|
|
2446
|
+
if (h && n) y.returnedStale = true;
|
|
2198
2447
|
}
|
|
2199
2448
|
return h ? r.__staleWhileFetching : r.__returned = r;
|
|
2200
2449
|
}
|
|
@@ -2205,7 +2454,7 @@ class LRUCache {
|
|
|
2205
2454
|
return s;
|
|
2206
2455
|
}
|
|
2207
2456
|
memo(t, e = {}) {
|
|
2208
|
-
const s = this.#
|
|
2457
|
+
const s = this.#x;
|
|
2209
2458
|
if (!s) {
|
|
2210
2459
|
throw new Error("no memoMethod provided to constructor");
|
|
2211
2460
|
}
|
|
@@ -2221,7 +2470,7 @@ class LRUCache {
|
|
|
2221
2470
|
}
|
|
2222
2471
|
get(t, e = {}) {
|
|
2223
2472
|
const {allowStale: s = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: r} = e;
|
|
2224
|
-
const o = this.#
|
|
2473
|
+
const o = this.#C.get(t);
|
|
2225
2474
|
if (o !== undefined) {
|
|
2226
2475
|
const e = this.#L[o];
|
|
2227
2476
|
const h = this.#j(e);
|
|
@@ -2275,27 +2524,27 @@ class LRUCache {
|
|
|
2275
2524
|
}
|
|
2276
2525
|
#K(t, e) {
|
|
2277
2526
|
let s = false;
|
|
2278
|
-
if (this.#
|
|
2279
|
-
const i = this.#
|
|
2527
|
+
if (this.#v !== 0) {
|
|
2528
|
+
const i = this.#C.get(t);
|
|
2280
2529
|
if (i !== undefined) {
|
|
2281
2530
|
s = true;
|
|
2282
|
-
if (this.#
|
|
2531
|
+
if (this.#v === 1) {
|
|
2283
2532
|
this.#rt(e);
|
|
2284
2533
|
} else {
|
|
2285
2534
|
this.#Q(i);
|
|
2286
2535
|
const s = this.#L[i];
|
|
2287
2536
|
if (this.#j(s)) {
|
|
2288
2537
|
s.__abortController.abort(new Error("deleted"));
|
|
2289
|
-
} else if (this.#B || this.#
|
|
2538
|
+
} else if (this.#B || this.#I) {
|
|
2290
2539
|
if (this.#B) {
|
|
2291
|
-
this.#
|
|
2540
|
+
this.#w?.(s, t, e);
|
|
2292
2541
|
}
|
|
2293
|
-
if (this.#
|
|
2542
|
+
if (this.#I) {
|
|
2294
2543
|
this.#O?.push([ s, t, e ]);
|
|
2295
2544
|
}
|
|
2296
2545
|
}
|
|
2297
|
-
this.#
|
|
2298
|
-
this.#
|
|
2546
|
+
this.#C.delete(t);
|
|
2547
|
+
this.#T[i] = undefined;
|
|
2299
2548
|
this.#L[i] = undefined;
|
|
2300
2549
|
if (i === this.#F) {
|
|
2301
2550
|
this.#F = this.#M[i];
|
|
@@ -2307,12 +2556,12 @@ class LRUCache {
|
|
|
2307
2556
|
const e = this.#A[i];
|
|
2308
2557
|
this.#M[e] = this.#M[i];
|
|
2309
2558
|
}
|
|
2310
|
-
this.#
|
|
2559
|
+
this.#v--;
|
|
2311
2560
|
this.#R.push(i);
|
|
2312
2561
|
}
|
|
2313
2562
|
}
|
|
2314
2563
|
}
|
|
2315
|
-
if (this.#
|
|
2564
|
+
if (this.#I && this.#O?.length) {
|
|
2316
2565
|
const t = this.#O;
|
|
2317
2566
|
let e;
|
|
2318
2567
|
while (e = t?.shift()) {
|
|
@@ -2332,18 +2581,18 @@ class LRUCache {
|
|
|
2332
2581
|
if (this.#j(s)) {
|
|
2333
2582
|
s.__abortController.abort(new Error("deleted"));
|
|
2334
2583
|
} else {
|
|
2335
|
-
const i = this.#
|
|
2584
|
+
const i = this.#T[e];
|
|
2336
2585
|
if (this.#B) {
|
|
2337
|
-
this.#
|
|
2586
|
+
this.#w?.(s, i, t);
|
|
2338
2587
|
}
|
|
2339
|
-
if (this.#
|
|
2588
|
+
if (this.#I) {
|
|
2340
2589
|
this.#O?.push([ s, i, t ]);
|
|
2341
2590
|
}
|
|
2342
2591
|
}
|
|
2343
2592
|
}
|
|
2344
|
-
this.#
|
|
2593
|
+
this.#C.clear();
|
|
2345
2594
|
this.#L.fill(undefined);
|
|
2346
|
-
this.#
|
|
2595
|
+
this.#T.fill(undefined);
|
|
2347
2596
|
if (this.#N && this.#D) {
|
|
2348
2597
|
this.#N.fill(0);
|
|
2349
2598
|
this.#D.fill(0);
|
|
@@ -2355,8 +2604,8 @@ class LRUCache {
|
|
|
2355
2604
|
this.#F = 0;
|
|
2356
2605
|
this.#R.length = 0;
|
|
2357
2606
|
this.#E = 0;
|
|
2358
|
-
this.#
|
|
2359
|
-
if (this.#
|
|
2607
|
+
this.#v = 0;
|
|
2608
|
+
if (this.#I && this.#O) {
|
|
2360
2609
|
const t = this.#O;
|
|
2361
2610
|
let e;
|
|
2362
2611
|
while (e = t?.shift()) {
|
|
@@ -2366,88 +2615,88 @@ class LRUCache {
|
|
|
2366
2615
|
}
|
|
2367
2616
|
}
|
|
2368
2617
|
|
|
2369
|
-
const
|
|
2618
|
+
const it = typeof process === "object" && process ? process : {
|
|
2370
2619
|
stdout: null,
|
|
2371
2620
|
stderr: null
|
|
2372
2621
|
};
|
|
2373
2622
|
|
|
2374
|
-
const
|
|
2623
|
+
const isStream = t => !!t && typeof t === "object" && (t instanceof Minipass || t instanceof l.default || isReadable(t) || isWritable(t));
|
|
2375
2624
|
|
|
2376
|
-
const
|
|
2625
|
+
const isReadable = t => !!t && typeof t === "object" && t instanceof r.EventEmitter && typeof t.pipe === "function" && t.pipe !== l.default.Writable.prototype.pipe;
|
|
2377
2626
|
|
|
2378
|
-
const
|
|
2627
|
+
const isWritable = t => !!t && typeof t === "object" && t instanceof r.EventEmitter && typeof t.write === "function" && typeof t.end === "function";
|
|
2379
2628
|
|
|
2380
|
-
const
|
|
2629
|
+
const nt = Symbol("EOF");
|
|
2381
2630
|
|
|
2382
|
-
const
|
|
2631
|
+
const rt = Symbol("maybeEmitEnd");
|
|
2383
2632
|
|
|
2384
|
-
const
|
|
2633
|
+
const ot = Symbol("emittedEnd");
|
|
2385
2634
|
|
|
2386
|
-
const
|
|
2635
|
+
const ht = Symbol("emittingEnd");
|
|
2387
2636
|
|
|
2388
|
-
const
|
|
2637
|
+
const at = Symbol("emittedError");
|
|
2389
2638
|
|
|
2390
|
-
const
|
|
2639
|
+
const lt = Symbol("closed");
|
|
2391
2640
|
|
|
2392
|
-
const
|
|
2641
|
+
const ct = Symbol("read");
|
|
2393
2642
|
|
|
2394
|
-
const
|
|
2643
|
+
const ft = Symbol("flush");
|
|
2395
2644
|
|
|
2396
|
-
const
|
|
2645
|
+
const ut = Symbol("flushChunk");
|
|
2397
2646
|
|
|
2398
|
-
const
|
|
2647
|
+
const dt = Symbol("encoding");
|
|
2399
2648
|
|
|
2400
|
-
const
|
|
2649
|
+
const pt = Symbol("decoder");
|
|
2401
2650
|
|
|
2402
|
-
const
|
|
2651
|
+
const gt = Symbol("flowing");
|
|
2403
2652
|
|
|
2404
|
-
const
|
|
2653
|
+
const mt = Symbol("paused");
|
|
2405
2654
|
|
|
2406
|
-
const
|
|
2655
|
+
const yt = Symbol("resume");
|
|
2407
2656
|
|
|
2408
|
-
const
|
|
2657
|
+
const wt = Symbol("buffer");
|
|
2409
2658
|
|
|
2410
|
-
const
|
|
2659
|
+
const bt = Symbol("pipes");
|
|
2411
2660
|
|
|
2412
|
-
const
|
|
2661
|
+
const St = Symbol("bufferLength");
|
|
2413
2662
|
|
|
2414
|
-
const
|
|
2663
|
+
const kt = Symbol("bufferPush");
|
|
2415
2664
|
|
|
2416
|
-
const
|
|
2665
|
+
const xt = Symbol("bufferShift");
|
|
2417
2666
|
|
|
2418
|
-
const
|
|
2667
|
+
const vt = Symbol("objectMode");
|
|
2419
2668
|
|
|
2420
|
-
const
|
|
2669
|
+
const Et = Symbol("destroyed");
|
|
2421
2670
|
|
|
2422
|
-
const
|
|
2671
|
+
const Ct = Symbol("error");
|
|
2423
2672
|
|
|
2424
|
-
const
|
|
2673
|
+
const Tt = Symbol("emitData");
|
|
2425
2674
|
|
|
2426
|
-
const
|
|
2675
|
+
const Lt = Symbol("emitEnd");
|
|
2427
2676
|
|
|
2428
|
-
const
|
|
2677
|
+
const At = Symbol("emitEnd2");
|
|
2429
2678
|
|
|
2430
|
-
const
|
|
2679
|
+
const Mt = Symbol("async");
|
|
2431
2680
|
|
|
2432
|
-
const
|
|
2681
|
+
const Pt = Symbol("abort");
|
|
2433
2682
|
|
|
2434
|
-
const
|
|
2683
|
+
const Ft = Symbol("aborted");
|
|
2435
2684
|
|
|
2436
|
-
const
|
|
2685
|
+
const Rt = Symbol("signal");
|
|
2437
2686
|
|
|
2438
|
-
const
|
|
2687
|
+
const Ot = Symbol("dataListeners");
|
|
2439
2688
|
|
|
2440
|
-
const
|
|
2689
|
+
const zt = Symbol("discarded");
|
|
2441
2690
|
|
|
2442
|
-
const
|
|
2691
|
+
const defer = t => Promise.resolve().then(t);
|
|
2443
2692
|
|
|
2444
|
-
const
|
|
2693
|
+
const nodefer = t => t();
|
|
2445
2694
|
|
|
2446
|
-
const
|
|
2695
|
+
const isEndish = t => t === "end" || t === "finish" || t === "prefinish";
|
|
2447
2696
|
|
|
2448
|
-
const
|
|
2697
|
+
const isArrayBufferLike = t => t instanceof ArrayBuffer || !!t && typeof t === "object" && t.constructor && t.constructor.name === "ArrayBuffer" && t.byteLength >= 0;
|
|
2449
2698
|
|
|
2450
|
-
const
|
|
2699
|
+
const isArrayBufferView = t => !Buffer.isBuffer(t) && ArrayBuffer.isView(t);
|
|
2451
2700
|
|
|
2452
2701
|
class Pipe {
|
|
2453
2702
|
src;
|
|
@@ -2458,7 +2707,7 @@ class Pipe {
|
|
|
2458
2707
|
this.src = t;
|
|
2459
2708
|
this.dest = e;
|
|
2460
2709
|
this.opts = s;
|
|
2461
|
-
this.ondrain = () => t[
|
|
2710
|
+
this.ondrain = () => t[yt]();
|
|
2462
2711
|
this.dest.on("drain", this.ondrain);
|
|
2463
2712
|
}
|
|
2464
2713
|
unpipe() {
|
|
@@ -2483,30 +2732,30 @@ class PipeProxyErrors extends Pipe {
|
|
|
2483
2732
|
}
|
|
2484
2733
|
}
|
|
2485
2734
|
|
|
2486
|
-
const
|
|
2487
|
-
|
|
2488
|
-
const
|
|
2489
|
-
|
|
2490
|
-
class Minipass extends
|
|
2491
|
-
[
|
|
2492
|
-
[
|
|
2493
|
-
[
|
|
2494
|
-
[
|
|
2495
|
-
[
|
|
2496
|
-
[
|
|
2497
|
-
[
|
|
2498
|
-
[
|
|
2499
|
-
[
|
|
2500
|
-
[
|
|
2501
|
-
[
|
|
2502
|
-
[
|
|
2503
|
-
[
|
|
2504
|
-
[
|
|
2505
|
-
[
|
|
2506
|
-
[
|
|
2507
|
-
[
|
|
2508
|
-
[
|
|
2509
|
-
[
|
|
2735
|
+
const isObjectModeOptions = t => !!t.objectMode;
|
|
2736
|
+
|
|
2737
|
+
const isEncodingOptions = t => !t.objectMode && !!t.encoding && t.encoding !== "buffer";
|
|
2738
|
+
|
|
2739
|
+
class Minipass extends r.EventEmitter {
|
|
2740
|
+
[gt]=false;
|
|
2741
|
+
[mt]=false;
|
|
2742
|
+
[bt]=[];
|
|
2743
|
+
[wt]=[];
|
|
2744
|
+
[vt];
|
|
2745
|
+
[dt];
|
|
2746
|
+
[Mt];
|
|
2747
|
+
[pt];
|
|
2748
|
+
[nt]=false;
|
|
2749
|
+
[ot]=false;
|
|
2750
|
+
[ht]=false;
|
|
2751
|
+
[lt]=false;
|
|
2752
|
+
[at]=null;
|
|
2753
|
+
[St]=0;
|
|
2754
|
+
[Et]=false;
|
|
2755
|
+
[Rt];
|
|
2756
|
+
[Ft]=false;
|
|
2757
|
+
[Ot]=0;
|
|
2758
|
+
[zt]=false;
|
|
2510
2759
|
writable=true;
|
|
2511
2760
|
readable=true;
|
|
2512
2761
|
constructor(...t) {
|
|
@@ -2515,43 +2764,43 @@ class Minipass extends o.EventEmitter {
|
|
|
2515
2764
|
if (e.objectMode && typeof e.encoding === "string") {
|
|
2516
2765
|
throw new TypeError("Encoding and objectMode may not be used together");
|
|
2517
2766
|
}
|
|
2518
|
-
if (
|
|
2519
|
-
this[
|
|
2520
|
-
this[
|
|
2521
|
-
} else if (
|
|
2522
|
-
this[
|
|
2523
|
-
this[
|
|
2767
|
+
if (isObjectModeOptions(e)) {
|
|
2768
|
+
this[vt] = true;
|
|
2769
|
+
this[dt] = null;
|
|
2770
|
+
} else if (isEncodingOptions(e)) {
|
|
2771
|
+
this[dt] = e.encoding;
|
|
2772
|
+
this[vt] = false;
|
|
2524
2773
|
} else {
|
|
2525
|
-
this[
|
|
2526
|
-
this[
|
|
2774
|
+
this[vt] = false;
|
|
2775
|
+
this[dt] = null;
|
|
2527
2776
|
}
|
|
2528
|
-
this[
|
|
2529
|
-
this[
|
|
2777
|
+
this[Mt] = !!e.async;
|
|
2778
|
+
this[pt] = this[dt] ? new h.StringDecoder(this[dt]) : null;
|
|
2530
2779
|
if (e && e.debugExposeBuffer === true) {
|
|
2531
2780
|
Object.defineProperty(this, "buffer", {
|
|
2532
|
-
get: () => this[
|
|
2781
|
+
get: () => this[wt]
|
|
2533
2782
|
});
|
|
2534
2783
|
}
|
|
2535
2784
|
if (e && e.debugExposePipes === true) {
|
|
2536
2785
|
Object.defineProperty(this, "pipes", {
|
|
2537
|
-
get: () => this[
|
|
2786
|
+
get: () => this[bt]
|
|
2538
2787
|
});
|
|
2539
2788
|
}
|
|
2540
2789
|
const {signal: s} = e;
|
|
2541
2790
|
if (s) {
|
|
2542
|
-
this[
|
|
2791
|
+
this[Rt] = s;
|
|
2543
2792
|
if (s.aborted) {
|
|
2544
|
-
this[
|
|
2793
|
+
this[Pt]();
|
|
2545
2794
|
} else {
|
|
2546
|
-
s.addEventListener("abort", (() => this[
|
|
2795
|
+
s.addEventListener("abort", (() => this[Pt]()));
|
|
2547
2796
|
}
|
|
2548
2797
|
}
|
|
2549
2798
|
}
|
|
2550
2799
|
get bufferLength() {
|
|
2551
|
-
return this[
|
|
2800
|
+
return this[St];
|
|
2552
2801
|
}
|
|
2553
2802
|
get encoding() {
|
|
2554
|
-
return this[
|
|
2803
|
+
return this[dt];
|
|
2555
2804
|
}
|
|
2556
2805
|
set encoding(t) {
|
|
2557
2806
|
throw new Error("Encoding must be set at instantiation time");
|
|
@@ -2560,30 +2809,30 @@ class Minipass extends o.EventEmitter {
|
|
|
2560
2809
|
throw new Error("Encoding must be set at instantiation time");
|
|
2561
2810
|
}
|
|
2562
2811
|
get objectMode() {
|
|
2563
|
-
return this[
|
|
2812
|
+
return this[vt];
|
|
2564
2813
|
}
|
|
2565
2814
|
set objectMode(t) {
|
|
2566
2815
|
throw new Error("objectMode must be set at instantiation time");
|
|
2567
2816
|
}
|
|
2568
2817
|
get ["async"]() {
|
|
2569
|
-
return this[
|
|
2818
|
+
return this[Mt];
|
|
2570
2819
|
}
|
|
2571
2820
|
set ["async"](t) {
|
|
2572
|
-
this[
|
|
2821
|
+
this[Mt] = this[Mt] || !!t;
|
|
2573
2822
|
}
|
|
2574
|
-
[
|
|
2575
|
-
this[
|
|
2576
|
-
this.emit("abort", this[
|
|
2577
|
-
this.destroy(this[
|
|
2823
|
+
[Pt]() {
|
|
2824
|
+
this[Ft] = true;
|
|
2825
|
+
this.emit("abort", this[Rt]?.reason);
|
|
2826
|
+
this.destroy(this[Rt]?.reason);
|
|
2578
2827
|
}
|
|
2579
2828
|
get aborted() {
|
|
2580
|
-
return this[
|
|
2829
|
+
return this[Ft];
|
|
2581
2830
|
}
|
|
2582
2831
|
set aborted(t) {}
|
|
2583
2832
|
write(t, e, s) {
|
|
2584
|
-
if (this[
|
|
2585
|
-
if (this[
|
|
2586
|
-
if (this[
|
|
2833
|
+
if (this[Ft]) return false;
|
|
2834
|
+
if (this[nt]) throw new Error("write after end");
|
|
2835
|
+
if (this[Et]) {
|
|
2587
2836
|
this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), {
|
|
2588
2837
|
code: "ERR_STREAM_DESTROYED"
|
|
2589
2838
|
}));
|
|
@@ -2594,70 +2843,70 @@ class Minipass extends o.EventEmitter {
|
|
|
2594
2843
|
e = "utf8";
|
|
2595
2844
|
}
|
|
2596
2845
|
if (!e) e = "utf8";
|
|
2597
|
-
const i = this[
|
|
2598
|
-
if (!this[
|
|
2599
|
-
if (
|
|
2846
|
+
const i = this[Mt] ? defer : nodefer;
|
|
2847
|
+
if (!this[vt] && !Buffer.isBuffer(t)) {
|
|
2848
|
+
if (isArrayBufferView(t)) {
|
|
2600
2849
|
t = Buffer.from(t.buffer, t.byteOffset, t.byteLength);
|
|
2601
|
-
} else if (
|
|
2850
|
+
} else if (isArrayBufferLike(t)) {
|
|
2602
2851
|
t = Buffer.from(t);
|
|
2603
2852
|
} else if (typeof t !== "string") {
|
|
2604
2853
|
throw new Error("Non-contiguous data written to non-objectMode stream");
|
|
2605
2854
|
}
|
|
2606
2855
|
}
|
|
2607
|
-
if (this[
|
|
2608
|
-
if (this[
|
|
2609
|
-
if (this[
|
|
2610
|
-
if (this[
|
|
2856
|
+
if (this[vt]) {
|
|
2857
|
+
if (this[gt] && this[St] !== 0) this[ft](true);
|
|
2858
|
+
if (this[gt]) this.emit("data", t); else this[kt](t);
|
|
2859
|
+
if (this[St] !== 0) this.emit("readable");
|
|
2611
2860
|
if (s) i(s);
|
|
2612
|
-
return this[
|
|
2861
|
+
return this[gt];
|
|
2613
2862
|
}
|
|
2614
2863
|
if (!t.length) {
|
|
2615
|
-
if (this[
|
|
2864
|
+
if (this[St] !== 0) this.emit("readable");
|
|
2616
2865
|
if (s) i(s);
|
|
2617
|
-
return this[
|
|
2866
|
+
return this[gt];
|
|
2618
2867
|
}
|
|
2619
|
-
if (typeof t === "string" && !(e === this[
|
|
2868
|
+
if (typeof t === "string" && !(e === this[dt] && !this[pt]?.lastNeed)) {
|
|
2620
2869
|
t = Buffer.from(t, e);
|
|
2621
2870
|
}
|
|
2622
|
-
if (Buffer.isBuffer(t) && this[
|
|
2623
|
-
t = this[
|
|
2871
|
+
if (Buffer.isBuffer(t) && this[dt]) {
|
|
2872
|
+
t = this[pt].write(t);
|
|
2624
2873
|
}
|
|
2625
|
-
if (this[
|
|
2626
|
-
if (this[
|
|
2627
|
-
if (this[
|
|
2874
|
+
if (this[gt] && this[St] !== 0) this[ft](true);
|
|
2875
|
+
if (this[gt]) this.emit("data", t); else this[kt](t);
|
|
2876
|
+
if (this[St] !== 0) this.emit("readable");
|
|
2628
2877
|
if (s) i(s);
|
|
2629
|
-
return this[
|
|
2878
|
+
return this[gt];
|
|
2630
2879
|
}
|
|
2631
2880
|
read(t) {
|
|
2632
|
-
if (this[
|
|
2633
|
-
this[
|
|
2634
|
-
if (this[
|
|
2635
|
-
this[
|
|
2881
|
+
if (this[Et]) return null;
|
|
2882
|
+
this[zt] = false;
|
|
2883
|
+
if (this[St] === 0 || t === 0 || t && t > this[St]) {
|
|
2884
|
+
this[rt]();
|
|
2636
2885
|
return null;
|
|
2637
2886
|
}
|
|
2638
|
-
if (this[
|
|
2639
|
-
if (this[
|
|
2640
|
-
this[
|
|
2887
|
+
if (this[vt]) t = null;
|
|
2888
|
+
if (this[wt].length > 1 && !this[vt]) {
|
|
2889
|
+
this[wt] = [ this[dt] ? this[wt].join("") : Buffer.concat(this[wt], this[St]) ];
|
|
2641
2890
|
}
|
|
2642
|
-
const e = this[
|
|
2643
|
-
this[
|
|
2891
|
+
const e = this[ct](t || null, this[wt][0]);
|
|
2892
|
+
this[rt]();
|
|
2644
2893
|
return e;
|
|
2645
2894
|
}
|
|
2646
|
-
[
|
|
2647
|
-
if (this[
|
|
2895
|
+
[ct](t, e) {
|
|
2896
|
+
if (this[vt]) this[xt](); else {
|
|
2648
2897
|
const s = e;
|
|
2649
|
-
if (t === s.length || t === null) this[
|
|
2650
|
-
this[
|
|
2898
|
+
if (t === s.length || t === null) this[xt](); else if (typeof s === "string") {
|
|
2899
|
+
this[wt][0] = s.slice(t);
|
|
2651
2900
|
e = s.slice(0, t);
|
|
2652
|
-
this[
|
|
2901
|
+
this[St] -= t;
|
|
2653
2902
|
} else {
|
|
2654
|
-
this[
|
|
2903
|
+
this[wt][0] = s.subarray(t);
|
|
2655
2904
|
e = s.subarray(0, t);
|
|
2656
|
-
this[
|
|
2905
|
+
this[St] -= t;
|
|
2657
2906
|
}
|
|
2658
2907
|
}
|
|
2659
2908
|
this.emit("data", e);
|
|
2660
|
-
if (!this[
|
|
2909
|
+
if (!this[wt].length && !this[nt]) this.emit("drain");
|
|
2661
2910
|
return e;
|
|
2662
2911
|
}
|
|
2663
2912
|
end(t, e, s) {
|
|
@@ -2671,78 +2920,78 @@ class Minipass extends o.EventEmitter {
|
|
|
2671
2920
|
}
|
|
2672
2921
|
if (t !== undefined) this.write(t, e);
|
|
2673
2922
|
if (s) this.once("end", s);
|
|
2674
|
-
this[
|
|
2923
|
+
this[nt] = true;
|
|
2675
2924
|
this.writable = false;
|
|
2676
|
-
if (this[
|
|
2925
|
+
if (this[gt] || !this[mt]) this[rt]();
|
|
2677
2926
|
return this;
|
|
2678
2927
|
}
|
|
2679
|
-
[
|
|
2680
|
-
if (this[
|
|
2681
|
-
if (!this[
|
|
2682
|
-
this[
|
|
2928
|
+
[yt]() {
|
|
2929
|
+
if (this[Et]) return;
|
|
2930
|
+
if (!this[Ot] && !this[bt].length) {
|
|
2931
|
+
this[zt] = true;
|
|
2683
2932
|
}
|
|
2684
|
-
this[
|
|
2685
|
-
this[
|
|
2933
|
+
this[mt] = false;
|
|
2934
|
+
this[gt] = true;
|
|
2686
2935
|
this.emit("resume");
|
|
2687
|
-
if (this[
|
|
2936
|
+
if (this[wt].length) this[ft](); else if (this[nt]) this[rt](); else this.emit("drain");
|
|
2688
2937
|
}
|
|
2689
2938
|
resume() {
|
|
2690
|
-
return this[
|
|
2939
|
+
return this[yt]();
|
|
2691
2940
|
}
|
|
2692
2941
|
pause() {
|
|
2693
|
-
this[
|
|
2694
|
-
this[
|
|
2695
|
-
this[
|
|
2942
|
+
this[gt] = false;
|
|
2943
|
+
this[mt] = true;
|
|
2944
|
+
this[zt] = false;
|
|
2696
2945
|
}
|
|
2697
2946
|
get destroyed() {
|
|
2698
|
-
return this[
|
|
2947
|
+
return this[Et];
|
|
2699
2948
|
}
|
|
2700
2949
|
get flowing() {
|
|
2701
|
-
return this[
|
|
2950
|
+
return this[gt];
|
|
2702
2951
|
}
|
|
2703
2952
|
get paused() {
|
|
2704
|
-
return this[
|
|
2953
|
+
return this[mt];
|
|
2705
2954
|
}
|
|
2706
|
-
[
|
|
2707
|
-
if (this[
|
|
2708
|
-
this[
|
|
2955
|
+
[kt](t) {
|
|
2956
|
+
if (this[vt]) this[St] += 1; else this[St] += t.length;
|
|
2957
|
+
this[wt].push(t);
|
|
2709
2958
|
}
|
|
2710
|
-
[
|
|
2711
|
-
if (this[
|
|
2712
|
-
return this[
|
|
2959
|
+
[xt]() {
|
|
2960
|
+
if (this[vt]) this[St] -= 1; else this[St] -= this[wt][0].length;
|
|
2961
|
+
return this[wt].shift();
|
|
2713
2962
|
}
|
|
2714
|
-
[
|
|
2715
|
-
do {} while (this[
|
|
2716
|
-
if (!t && !this[
|
|
2963
|
+
[ft](t = false) {
|
|
2964
|
+
do {} while (this[ut](this[xt]()) && this[wt].length);
|
|
2965
|
+
if (!t && !this[wt].length && !this[nt]) this.emit("drain");
|
|
2717
2966
|
}
|
|
2718
|
-
[
|
|
2967
|
+
[ut](t) {
|
|
2719
2968
|
this.emit("data", t);
|
|
2720
|
-
return this[
|
|
2969
|
+
return this[gt];
|
|
2721
2970
|
}
|
|
2722
2971
|
pipe(t, e) {
|
|
2723
|
-
if (this[
|
|
2724
|
-
this[
|
|
2725
|
-
const s = this[
|
|
2972
|
+
if (this[Et]) return t;
|
|
2973
|
+
this[zt] = false;
|
|
2974
|
+
const s = this[ot];
|
|
2726
2975
|
e = e || {};
|
|
2727
|
-
if (t ===
|
|
2976
|
+
if (t === it.stdout || t === it.stderr) e.end = false; else e.end = e.end !== false;
|
|
2728
2977
|
e.proxyErrors = !!e.proxyErrors;
|
|
2729
2978
|
if (s) {
|
|
2730
2979
|
if (e.end) t.end();
|
|
2731
2980
|
} else {
|
|
2732
|
-
this[
|
|
2733
|
-
if (this[
|
|
2981
|
+
this[bt].push(!e.proxyErrors ? new Pipe(this, t, e) : new PipeProxyErrors(this, t, e));
|
|
2982
|
+
if (this[Mt]) defer((() => this[yt]())); else this[yt]();
|
|
2734
2983
|
}
|
|
2735
2984
|
return t;
|
|
2736
2985
|
}
|
|
2737
2986
|
unpipe(t) {
|
|
2738
|
-
const e = this[
|
|
2987
|
+
const e = this[bt].find((e => e.dest === t));
|
|
2739
2988
|
if (e) {
|
|
2740
|
-
if (this[
|
|
2741
|
-
if (this[
|
|
2742
|
-
this[
|
|
2989
|
+
if (this[bt].length === 1) {
|
|
2990
|
+
if (this[gt] && this[Ot] === 0) {
|
|
2991
|
+
this[gt] = false;
|
|
2743
2992
|
}
|
|
2744
|
-
this[
|
|
2745
|
-
} else this[
|
|
2993
|
+
this[bt] = [];
|
|
2994
|
+
} else this[bt].splice(this[bt].indexOf(e), 1);
|
|
2746
2995
|
e.unpipe();
|
|
2747
2996
|
}
|
|
2748
2997
|
}
|
|
@@ -2752,19 +3001,19 @@ class Minipass extends o.EventEmitter {
|
|
|
2752
3001
|
on(t, e) {
|
|
2753
3002
|
const s = super.on(t, e);
|
|
2754
3003
|
if (t === "data") {
|
|
2755
|
-
this[
|
|
2756
|
-
this[
|
|
2757
|
-
if (!this[
|
|
2758
|
-
this[
|
|
3004
|
+
this[zt] = false;
|
|
3005
|
+
this[Ot]++;
|
|
3006
|
+
if (!this[bt].length && !this[gt]) {
|
|
3007
|
+
this[yt]();
|
|
2759
3008
|
}
|
|
2760
|
-
} else if (t === "readable" && this[
|
|
3009
|
+
} else if (t === "readable" && this[St] !== 0) {
|
|
2761
3010
|
super.emit("readable");
|
|
2762
|
-
} else if (
|
|
3011
|
+
} else if (isEndish(t) && this[ot]) {
|
|
2763
3012
|
super.emit(t);
|
|
2764
3013
|
this.removeAllListeners(t);
|
|
2765
|
-
} else if (t === "error" && this[
|
|
3014
|
+
} else if (t === "error" && this[at]) {
|
|
2766
3015
|
const t = e;
|
|
2767
|
-
if (this[
|
|
3016
|
+
if (this[Mt]) defer((() => t.call(this, this[at]))); else t.call(this, this[at]);
|
|
2768
3017
|
}
|
|
2769
3018
|
return s;
|
|
2770
3019
|
}
|
|
@@ -2774,9 +3023,9 @@ class Minipass extends o.EventEmitter {
|
|
|
2774
3023
|
off(t, e) {
|
|
2775
3024
|
const s = super.off(t, e);
|
|
2776
3025
|
if (t === "data") {
|
|
2777
|
-
this[
|
|
2778
|
-
if (this[
|
|
2779
|
-
this[
|
|
3026
|
+
this[Ot] = this.listeners("data").length;
|
|
3027
|
+
if (this[Ot] === 0 && !this[zt] && !this[bt].length) {
|
|
3028
|
+
this[gt] = false;
|
|
2780
3029
|
}
|
|
2781
3030
|
}
|
|
2782
3031
|
return s;
|
|
@@ -2784,49 +3033,49 @@ class Minipass extends o.EventEmitter {
|
|
|
2784
3033
|
removeAllListeners(t) {
|
|
2785
3034
|
const e = super.removeAllListeners(t);
|
|
2786
3035
|
if (t === "data" || t === undefined) {
|
|
2787
|
-
this[
|
|
2788
|
-
if (!this[
|
|
2789
|
-
this[
|
|
3036
|
+
this[Ot] = 0;
|
|
3037
|
+
if (!this[zt] && !this[bt].length) {
|
|
3038
|
+
this[gt] = false;
|
|
2790
3039
|
}
|
|
2791
3040
|
}
|
|
2792
3041
|
return e;
|
|
2793
3042
|
}
|
|
2794
3043
|
get emittedEnd() {
|
|
2795
|
-
return this[
|
|
3044
|
+
return this[ot];
|
|
2796
3045
|
}
|
|
2797
|
-
[
|
|
2798
|
-
if (!this[
|
|
2799
|
-
this[
|
|
3046
|
+
[rt]() {
|
|
3047
|
+
if (!this[ht] && !this[ot] && !this[Et] && this[wt].length === 0 && this[nt]) {
|
|
3048
|
+
this[ht] = true;
|
|
2800
3049
|
this.emit("end");
|
|
2801
3050
|
this.emit("prefinish");
|
|
2802
3051
|
this.emit("finish");
|
|
2803
|
-
if (this[
|
|
2804
|
-
this[
|
|
3052
|
+
if (this[lt]) this.emit("close");
|
|
3053
|
+
this[ht] = false;
|
|
2805
3054
|
}
|
|
2806
3055
|
}
|
|
2807
3056
|
emit(t, ...e) {
|
|
2808
3057
|
const s = e[0];
|
|
2809
|
-
if (t !== "error" && t !== "close" && t !==
|
|
3058
|
+
if (t !== "error" && t !== "close" && t !== Et && this[Et]) {
|
|
2810
3059
|
return false;
|
|
2811
3060
|
} else if (t === "data") {
|
|
2812
|
-
return !this[
|
|
3061
|
+
return !this[vt] && !s ? false : this[Mt] ? (defer((() => this[Tt](s))), true) : this[Tt](s);
|
|
2813
3062
|
} else if (t === "end") {
|
|
2814
|
-
return this[
|
|
3063
|
+
return this[Lt]();
|
|
2815
3064
|
} else if (t === "close") {
|
|
2816
|
-
this[
|
|
2817
|
-
if (!this[
|
|
3065
|
+
this[lt] = true;
|
|
3066
|
+
if (!this[ot] && !this[Et]) return false;
|
|
2818
3067
|
const t = super.emit("close");
|
|
2819
3068
|
this.removeAllListeners("close");
|
|
2820
3069
|
return t;
|
|
2821
3070
|
} else if (t === "error") {
|
|
2822
|
-
this[
|
|
2823
|
-
super.emit(
|
|
2824
|
-
const t = !this[
|
|
2825
|
-
this[
|
|
3071
|
+
this[at] = s;
|
|
3072
|
+
super.emit(Ct, s);
|
|
3073
|
+
const t = !this[Rt] || this.listeners("error").length ? super.emit("error", s) : false;
|
|
3074
|
+
this[rt]();
|
|
2826
3075
|
return t;
|
|
2827
3076
|
} else if (t === "resume") {
|
|
2828
3077
|
const t = super.emit("resume");
|
|
2829
|
-
this[
|
|
3078
|
+
this[rt]();
|
|
2830
3079
|
return t;
|
|
2831
3080
|
} else if (t === "finish" || t === "prefinish") {
|
|
2832
3081
|
const e = super.emit(t);
|
|
@@ -2834,34 +3083,34 @@ class Minipass extends o.EventEmitter {
|
|
|
2834
3083
|
return e;
|
|
2835
3084
|
}
|
|
2836
3085
|
const i = super.emit(t, ...e);
|
|
2837
|
-
this[
|
|
3086
|
+
this[rt]();
|
|
2838
3087
|
return i;
|
|
2839
3088
|
}
|
|
2840
|
-
[
|
|
2841
|
-
for (const e of this[
|
|
3089
|
+
[Tt](t) {
|
|
3090
|
+
for (const e of this[bt]) {
|
|
2842
3091
|
if (e.dest.write(t) === false) this.pause();
|
|
2843
3092
|
}
|
|
2844
|
-
const e = this[
|
|
2845
|
-
this[
|
|
3093
|
+
const e = this[zt] ? false : super.emit("data", t);
|
|
3094
|
+
this[rt]();
|
|
2846
3095
|
return e;
|
|
2847
3096
|
}
|
|
2848
|
-
[
|
|
2849
|
-
if (this[
|
|
2850
|
-
this[
|
|
3097
|
+
[Lt]() {
|
|
3098
|
+
if (this[ot]) return false;
|
|
3099
|
+
this[ot] = true;
|
|
2851
3100
|
this.readable = false;
|
|
2852
|
-
return this[
|
|
3101
|
+
return this[Mt] ? (defer((() => this[At]())), true) : this[At]();
|
|
2853
3102
|
}
|
|
2854
|
-
[
|
|
2855
|
-
if (this[
|
|
2856
|
-
const t = this[
|
|
3103
|
+
[At]() {
|
|
3104
|
+
if (this[pt]) {
|
|
3105
|
+
const t = this[pt].end();
|
|
2857
3106
|
if (t) {
|
|
2858
|
-
for (const e of this[
|
|
3107
|
+
for (const e of this[bt]) {
|
|
2859
3108
|
e.dest.write(t);
|
|
2860
3109
|
}
|
|
2861
|
-
if (!this[
|
|
3110
|
+
if (!this[zt]) super.emit("data", t);
|
|
2862
3111
|
}
|
|
2863
3112
|
}
|
|
2864
|
-
for (const t of this[
|
|
3113
|
+
for (const t of this[bt]) {
|
|
2865
3114
|
t.end();
|
|
2866
3115
|
}
|
|
2867
3116
|
const t = super.emit("end");
|
|
@@ -2872,33 +3121,33 @@ class Minipass extends o.EventEmitter {
|
|
|
2872
3121
|
const t = Object.assign([], {
|
|
2873
3122
|
dataLength: 0
|
|
2874
3123
|
});
|
|
2875
|
-
if (!this[
|
|
3124
|
+
if (!this[vt]) t.dataLength = 0;
|
|
2876
3125
|
const e = this.promise();
|
|
2877
3126
|
this.on("data", (e => {
|
|
2878
3127
|
t.push(e);
|
|
2879
|
-
if (!this[
|
|
3128
|
+
if (!this[vt]) t.dataLength += e.length;
|
|
2880
3129
|
}));
|
|
2881
3130
|
await e;
|
|
2882
3131
|
return t;
|
|
2883
3132
|
}
|
|
2884
3133
|
async concat() {
|
|
2885
|
-
if (this[
|
|
3134
|
+
if (this[vt]) {
|
|
2886
3135
|
throw new Error("cannot concat in objectMode");
|
|
2887
3136
|
}
|
|
2888
3137
|
const t = await this.collect();
|
|
2889
|
-
return this[
|
|
3138
|
+
return this[dt] ? t.join("") : Buffer.concat(t, t.dataLength);
|
|
2890
3139
|
}
|
|
2891
3140
|
async promise() {
|
|
2892
3141
|
return new Promise(((t, e) => {
|
|
2893
|
-
this.on(
|
|
3142
|
+
this.on(Et, (() => e(new Error("stream destroyed"))));
|
|
2894
3143
|
this.on("error", (t => e(t)));
|
|
2895
3144
|
this.on("end", (() => t()));
|
|
2896
3145
|
}));
|
|
2897
3146
|
}
|
|
2898
3147
|
[Symbol.asyncIterator]() {
|
|
2899
|
-
this[
|
|
3148
|
+
this[zt] = false;
|
|
2900
3149
|
let t = false;
|
|
2901
|
-
const
|
|
3150
|
+
const stop = async () => {
|
|
2902
3151
|
this.pause();
|
|
2903
3152
|
t = true;
|
|
2904
3153
|
return {
|
|
@@ -2906,201 +3155,201 @@ class Minipass extends o.EventEmitter {
|
|
|
2906
3155
|
done: true
|
|
2907
3156
|
};
|
|
2908
3157
|
};
|
|
2909
|
-
const
|
|
2910
|
-
if (t) return
|
|
2911
|
-
const
|
|
2912
|
-
if (
|
|
3158
|
+
const next = () => {
|
|
3159
|
+
if (t) return stop();
|
|
3160
|
+
const e = this.read();
|
|
3161
|
+
if (e !== null) return Promise.resolve({
|
|
2913
3162
|
done: false,
|
|
2914
|
-
value:
|
|
3163
|
+
value: e
|
|
2915
3164
|
});
|
|
2916
|
-
if (this[
|
|
3165
|
+
if (this[nt]) return stop();
|
|
3166
|
+
let s;
|
|
2917
3167
|
let i;
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
this.off("
|
|
2921
|
-
this.off(
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
n(t);
|
|
3168
|
+
const onerr = t => {
|
|
3169
|
+
this.off("data", ondata);
|
|
3170
|
+
this.off("end", onend);
|
|
3171
|
+
this.off(Et, ondestroy);
|
|
3172
|
+
stop();
|
|
3173
|
+
i(t);
|
|
2925
3174
|
};
|
|
2926
|
-
const
|
|
2927
|
-
this.off("error",
|
|
2928
|
-
this.off("end",
|
|
2929
|
-
this.off(
|
|
3175
|
+
const ondata = t => {
|
|
3176
|
+
this.off("error", onerr);
|
|
3177
|
+
this.off("end", onend);
|
|
3178
|
+
this.off(Et, ondestroy);
|
|
2930
3179
|
this.pause();
|
|
2931
|
-
|
|
3180
|
+
s({
|
|
2932
3181
|
value: t,
|
|
2933
|
-
done: !!this[
|
|
3182
|
+
done: !!this[nt]
|
|
2934
3183
|
});
|
|
2935
3184
|
};
|
|
2936
|
-
const
|
|
2937
|
-
this.off("error",
|
|
2938
|
-
this.off("data",
|
|
2939
|
-
this.off(
|
|
2940
|
-
|
|
2941
|
-
|
|
3185
|
+
const onend = () => {
|
|
3186
|
+
this.off("error", onerr);
|
|
3187
|
+
this.off("data", ondata);
|
|
3188
|
+
this.off(Et, ondestroy);
|
|
3189
|
+
stop();
|
|
3190
|
+
s({
|
|
2942
3191
|
done: true,
|
|
2943
3192
|
value: undefined
|
|
2944
3193
|
});
|
|
2945
3194
|
};
|
|
2946
|
-
const
|
|
3195
|
+
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
2947
3196
|
return new Promise(((t, e) => {
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
this.once(
|
|
2951
|
-
this.once("error",
|
|
2952
|
-
this.once("end",
|
|
2953
|
-
this.once("data",
|
|
3197
|
+
i = e;
|
|
3198
|
+
s = t;
|
|
3199
|
+
this.once(Et, ondestroy);
|
|
3200
|
+
this.once("error", onerr);
|
|
3201
|
+
this.once("end", onend);
|
|
3202
|
+
this.once("data", ondata);
|
|
2954
3203
|
}));
|
|
2955
3204
|
};
|
|
2956
3205
|
return {
|
|
2957
|
-
next
|
|
2958
|
-
throw:
|
|
2959
|
-
return:
|
|
3206
|
+
next,
|
|
3207
|
+
throw: stop,
|
|
3208
|
+
return: stop,
|
|
2960
3209
|
[Symbol.asyncIterator]() {
|
|
2961
3210
|
return this;
|
|
2962
3211
|
}
|
|
2963
3212
|
};
|
|
2964
3213
|
}
|
|
2965
3214
|
[Symbol.iterator]() {
|
|
2966
|
-
this[
|
|
3215
|
+
this[zt] = false;
|
|
2967
3216
|
let t = false;
|
|
2968
|
-
const
|
|
3217
|
+
const stop = () => {
|
|
2969
3218
|
this.pause();
|
|
2970
|
-
this.off(
|
|
2971
|
-
this.off(
|
|
2972
|
-
this.off("end",
|
|
3219
|
+
this.off(Ct, stop);
|
|
3220
|
+
this.off(Et, stop);
|
|
3221
|
+
this.off("end", stop);
|
|
2973
3222
|
t = true;
|
|
2974
3223
|
return {
|
|
2975
3224
|
done: true,
|
|
2976
3225
|
value: undefined
|
|
2977
3226
|
};
|
|
2978
3227
|
};
|
|
2979
|
-
const
|
|
2980
|
-
if (t) return
|
|
2981
|
-
const
|
|
2982
|
-
return
|
|
3228
|
+
const next = () => {
|
|
3229
|
+
if (t) return stop();
|
|
3230
|
+
const e = this.read();
|
|
3231
|
+
return e === null ? stop() : {
|
|
2983
3232
|
done: false,
|
|
2984
|
-
value:
|
|
3233
|
+
value: e
|
|
2985
3234
|
};
|
|
2986
3235
|
};
|
|
2987
|
-
this.once("end",
|
|
2988
|
-
this.once(
|
|
2989
|
-
this.once(
|
|
3236
|
+
this.once("end", stop);
|
|
3237
|
+
this.once(Ct, stop);
|
|
3238
|
+
this.once(Et, stop);
|
|
2990
3239
|
return {
|
|
2991
|
-
next
|
|
2992
|
-
throw:
|
|
2993
|
-
return:
|
|
3240
|
+
next,
|
|
3241
|
+
throw: stop,
|
|
3242
|
+
return: stop,
|
|
2994
3243
|
[Symbol.iterator]() {
|
|
2995
3244
|
return this;
|
|
2996
3245
|
}
|
|
2997
3246
|
};
|
|
2998
3247
|
}
|
|
2999
3248
|
destroy(t) {
|
|
3000
|
-
if (this[
|
|
3001
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3249
|
+
if (this[Et]) {
|
|
3250
|
+
if (t) this.emit("error", t); else this.emit(Et);
|
|
3002
3251
|
return this;
|
|
3003
3252
|
}
|
|
3004
|
-
this[
|
|
3005
|
-
this[
|
|
3006
|
-
this[
|
|
3007
|
-
this[
|
|
3253
|
+
this[Et] = true;
|
|
3254
|
+
this[zt] = true;
|
|
3255
|
+
this[wt].length = 0;
|
|
3256
|
+
this[St] = 0;
|
|
3008
3257
|
const e = this;
|
|
3009
|
-
if (typeof e.close === "function" && !this[
|
|
3010
|
-
if (t) this.emit("error", t); else this.emit(
|
|
3258
|
+
if (typeof e.close === "function" && !this[lt]) e.close();
|
|
3259
|
+
if (t) this.emit("error", t); else this.emit(Et);
|
|
3011
3260
|
return this;
|
|
3012
3261
|
}
|
|
3013
3262
|
static get isStream() {
|
|
3014
|
-
return
|
|
3263
|
+
return isStream;
|
|
3015
3264
|
}
|
|
3016
3265
|
}
|
|
3017
3266
|
|
|
3018
|
-
const
|
|
3267
|
+
const Dt = s.realpathSync.native;
|
|
3019
3268
|
|
|
3020
|
-
const
|
|
3021
|
-
lstatSync:
|
|
3022
|
-
readdir:
|
|
3023
|
-
readdirSync:
|
|
3024
|
-
readlinkSync:
|
|
3025
|
-
realpathSync:
|
|
3269
|
+
const Nt = {
|
|
3270
|
+
lstatSync: s.lstatSync,
|
|
3271
|
+
readdir: s.readdir,
|
|
3272
|
+
readdirSync: s.readdirSync,
|
|
3273
|
+
readlinkSync: s.readlinkSync,
|
|
3274
|
+
realpathSync: Dt,
|
|
3026
3275
|
promises: {
|
|
3027
|
-
lstat:
|
|
3028
|
-
readdir:
|
|
3029
|
-
readlink:
|
|
3030
|
-
realpath:
|
|
3276
|
+
lstat: n.lstat,
|
|
3277
|
+
readdir: n.readdir,
|
|
3278
|
+
readlink: n.readlink,
|
|
3279
|
+
realpath: n.realpath
|
|
3031
3280
|
}
|
|
3032
3281
|
};
|
|
3033
3282
|
|
|
3034
|
-
const
|
|
3035
|
-
...
|
|
3283
|
+
const fsFromOption = t => !t || t === Nt || t === a ? Nt : {
|
|
3284
|
+
...Nt,
|
|
3036
3285
|
...t,
|
|
3037
3286
|
promises: {
|
|
3038
|
-
...
|
|
3287
|
+
...Nt.promises,
|
|
3039
3288
|
...t.promises || {}
|
|
3040
3289
|
}
|
|
3041
3290
|
};
|
|
3042
3291
|
|
|
3043
|
-
const
|
|
3292
|
+
const Bt = /^\\\\\?\\([a-z]:)\\?$/i;
|
|
3044
3293
|
|
|
3045
|
-
const
|
|
3294
|
+
const uncToDrive = t => t.replace(/\//g, "\\").replace(Bt, "$1\\");
|
|
3046
3295
|
|
|
3047
|
-
const
|
|
3296
|
+
const _t = /[\\\/]/;
|
|
3048
3297
|
|
|
3049
|
-
const
|
|
3298
|
+
const It = 0;
|
|
3050
3299
|
|
|
3051
|
-
const
|
|
3300
|
+
const Wt = 1;
|
|
3052
3301
|
|
|
3053
|
-
const
|
|
3302
|
+
const jt = 2;
|
|
3054
3303
|
|
|
3055
|
-
const
|
|
3304
|
+
const $t = 4;
|
|
3056
3305
|
|
|
3057
|
-
const
|
|
3306
|
+
const Gt = 6;
|
|
3058
3307
|
|
|
3059
|
-
const
|
|
3308
|
+
const Ut = 8;
|
|
3060
3309
|
|
|
3061
|
-
const
|
|
3310
|
+
const qt = 10;
|
|
3062
3311
|
|
|
3063
|
-
const
|
|
3312
|
+
const Ht = 12;
|
|
3064
3313
|
|
|
3065
|
-
const
|
|
3314
|
+
const Zt = 15;
|
|
3066
3315
|
|
|
3067
|
-
const
|
|
3316
|
+
const Vt = ~Zt;
|
|
3068
3317
|
|
|
3069
|
-
const
|
|
3318
|
+
const Jt = 16;
|
|
3070
3319
|
|
|
3071
|
-
const
|
|
3320
|
+
const Kt = 32;
|
|
3072
3321
|
|
|
3073
|
-
const
|
|
3322
|
+
const Yt = 64;
|
|
3074
3323
|
|
|
3075
|
-
const
|
|
3324
|
+
const Xt = 128;
|
|
3076
3325
|
|
|
3077
|
-
const
|
|
3326
|
+
const Qt = 256;
|
|
3078
3327
|
|
|
3079
|
-
const
|
|
3328
|
+
const te = 512;
|
|
3080
3329
|
|
|
3081
|
-
const
|
|
3330
|
+
const ee = Yt | Xt | te;
|
|
3082
3331
|
|
|
3083
|
-
const
|
|
3332
|
+
const se = 1023;
|
|
3084
3333
|
|
|
3085
|
-
const
|
|
3334
|
+
const entToType = t => t.isFile() ? Ut : t.isDirectory() ? $t : t.isSymbolicLink() ? qt : t.isCharacterDevice() ? jt : t.isBlockDevice() ? Gt : t.isSocket() ? Ht : t.isFIFO() ? Wt : It;
|
|
3086
3335
|
|
|
3087
|
-
const
|
|
3336
|
+
const ie = new Map;
|
|
3088
3337
|
|
|
3089
|
-
const
|
|
3090
|
-
const e =
|
|
3338
|
+
const normalize = t => {
|
|
3339
|
+
const e = ie.get(t);
|
|
3091
3340
|
if (e) return e;
|
|
3092
3341
|
const s = t.normalize("NFKD");
|
|
3093
|
-
|
|
3342
|
+
ie.set(t, s);
|
|
3094
3343
|
return s;
|
|
3095
3344
|
};
|
|
3096
3345
|
|
|
3097
|
-
const
|
|
3346
|
+
const ne = new Map;
|
|
3098
3347
|
|
|
3099
|
-
const
|
|
3100
|
-
const e =
|
|
3348
|
+
const normalizeNocase = t => {
|
|
3349
|
+
const e = ne.get(t);
|
|
3101
3350
|
if (e) return e;
|
|
3102
|
-
const s =
|
|
3103
|
-
|
|
3351
|
+
const s = normalize(t.toLowerCase());
|
|
3352
|
+
ne.set(t, s);
|
|
3104
3353
|
return s;
|
|
3105
3354
|
};
|
|
3106
3355
|
|
|
@@ -3121,7 +3370,7 @@ class ChildrenCache extends LRUCache {
|
|
|
3121
3370
|
}
|
|
3122
3371
|
}
|
|
3123
3372
|
|
|
3124
|
-
const
|
|
3373
|
+
const re = Symbol("PathScurry setAsCwd");
|
|
3125
3374
|
|
|
3126
3375
|
class PathBase {
|
|
3127
3376
|
name;
|
|
@@ -3163,9 +3412,9 @@ class PathBase {
|
|
|
3163
3412
|
get ino() {
|
|
3164
3413
|
return this.#pt;
|
|
3165
3414
|
}
|
|
3166
|
-
#
|
|
3415
|
+
#v;
|
|
3167
3416
|
get size() {
|
|
3168
|
-
return this.#
|
|
3417
|
+
return this.#v;
|
|
3169
3418
|
}
|
|
3170
3419
|
#gt;
|
|
3171
3420
|
get blocks() {
|
|
@@ -3175,13 +3424,13 @@ class PathBase {
|
|
|
3175
3424
|
get atimeMs() {
|
|
3176
3425
|
return this.#mt;
|
|
3177
3426
|
}
|
|
3178
|
-
#
|
|
3427
|
+
#yt;
|
|
3179
3428
|
get mtimeMs() {
|
|
3180
|
-
return this.#
|
|
3429
|
+
return this.#yt;
|
|
3181
3430
|
}
|
|
3182
|
-
#
|
|
3431
|
+
#wt;
|
|
3183
3432
|
get ctimeMs() {
|
|
3184
|
-
return this.#
|
|
3433
|
+
return this.#wt;
|
|
3185
3434
|
}
|
|
3186
3435
|
#bt;
|
|
3187
3436
|
get birthtimeMs() {
|
|
@@ -3195,17 +3444,17 @@ class PathBase {
|
|
|
3195
3444
|
get mtime() {
|
|
3196
3445
|
return this.#kt;
|
|
3197
3446
|
}
|
|
3198
|
-
#
|
|
3447
|
+
#xt;
|
|
3199
3448
|
get ctime() {
|
|
3200
|
-
return this.#
|
|
3449
|
+
return this.#xt;
|
|
3201
3450
|
}
|
|
3202
|
-
#
|
|
3451
|
+
#vt;
|
|
3203
3452
|
get birthtime() {
|
|
3204
|
-
return this.#
|
|
3453
|
+
return this.#vt;
|
|
3205
3454
|
}
|
|
3206
3455
|
#Et;
|
|
3207
|
-
#Tt;
|
|
3208
3456
|
#Ct;
|
|
3457
|
+
#Tt;
|
|
3209
3458
|
#Lt;
|
|
3210
3459
|
#At;
|
|
3211
3460
|
#Mt;
|
|
@@ -3219,28 +3468,28 @@ class PathBase {
|
|
|
3219
3468
|
get path() {
|
|
3220
3469
|
return this.parentPath;
|
|
3221
3470
|
}
|
|
3222
|
-
constructor(t, e =
|
|
3471
|
+
constructor(t, e = It, s, i, n, r, o) {
|
|
3223
3472
|
this.name = t;
|
|
3224
|
-
this.#Et = n ?
|
|
3225
|
-
this.#Pt = e &
|
|
3473
|
+
this.#Et = n ? normalizeNocase(t) : normalize(t);
|
|
3474
|
+
this.#Pt = e & se;
|
|
3226
3475
|
this.nocase = n;
|
|
3227
3476
|
this.roots = i;
|
|
3228
3477
|
this.root = s || this;
|
|
3229
3478
|
this.#Ft = r;
|
|
3230
|
-
this.#
|
|
3479
|
+
this.#Tt = o.fullpath;
|
|
3231
3480
|
this.#At = o.relative;
|
|
3232
3481
|
this.#Mt = o.relativePosix;
|
|
3233
3482
|
this.parent = o.parent;
|
|
3234
3483
|
if (this.parent) {
|
|
3235
3484
|
this.#ot = this.parent.#ot;
|
|
3236
3485
|
} else {
|
|
3237
|
-
this.#ot =
|
|
3486
|
+
this.#ot = fsFromOption(o.fs);
|
|
3238
3487
|
}
|
|
3239
3488
|
}
|
|
3240
3489
|
depth() {
|
|
3241
|
-
if (this.#
|
|
3242
|
-
if (!this.parent) return this.#
|
|
3243
|
-
return this.#
|
|
3490
|
+
if (this.#Ct !== undefined) return this.#Ct;
|
|
3491
|
+
if (!this.parent) return this.#Ct = 0;
|
|
3492
|
+
return this.#Ct = this.parent.depth() + 1;
|
|
3244
3493
|
}
|
|
3245
3494
|
childrenCache() {
|
|
3246
3495
|
return this.#Ft;
|
|
@@ -3271,7 +3520,7 @@ class PathBase {
|
|
|
3271
3520
|
provisional: 0
|
|
3272
3521
|
});
|
|
3273
3522
|
this.#Ft.set(this, e);
|
|
3274
|
-
this.#Pt &= ~
|
|
3523
|
+
this.#Pt &= ~Jt;
|
|
3275
3524
|
return e;
|
|
3276
3525
|
}
|
|
3277
3526
|
child(t, e) {
|
|
@@ -3282,21 +3531,21 @@ class PathBase {
|
|
|
3282
3531
|
return this.parent || this;
|
|
3283
3532
|
}
|
|
3284
3533
|
const s = this.children();
|
|
3285
|
-
const i = this.nocase ?
|
|
3534
|
+
const i = this.nocase ? normalizeNocase(t) : normalize(t);
|
|
3286
3535
|
for (const t of s) {
|
|
3287
3536
|
if (t.#Et === i) {
|
|
3288
3537
|
return t;
|
|
3289
3538
|
}
|
|
3290
3539
|
}
|
|
3291
3540
|
const n = this.parent ? this.sep : "";
|
|
3292
|
-
const r = this.#
|
|
3293
|
-
const o = this.newChild(t,
|
|
3541
|
+
const r = this.#Tt ? this.#Tt + n + t : undefined;
|
|
3542
|
+
const o = this.newChild(t, It, {
|
|
3294
3543
|
...e,
|
|
3295
3544
|
parent: this,
|
|
3296
3545
|
fullpath: r
|
|
3297
3546
|
});
|
|
3298
3547
|
if (!this.canReaddir()) {
|
|
3299
|
-
o.#Pt |=
|
|
3548
|
+
o.#Pt |= Xt;
|
|
3300
3549
|
}
|
|
3301
3550
|
s.push(o);
|
|
3302
3551
|
return o;
|
|
@@ -3327,17 +3576,17 @@ class PathBase {
|
|
|
3327
3576
|
return s + (!s || !e.parent ? "" : "/") + t;
|
|
3328
3577
|
}
|
|
3329
3578
|
fullpath() {
|
|
3330
|
-
if (this.#
|
|
3331
|
-
return this.#
|
|
3579
|
+
if (this.#Tt !== undefined) {
|
|
3580
|
+
return this.#Tt;
|
|
3332
3581
|
}
|
|
3333
3582
|
const t = this.name;
|
|
3334
3583
|
const e = this.parent;
|
|
3335
3584
|
if (!e) {
|
|
3336
|
-
return this.#
|
|
3585
|
+
return this.#Tt = this.name;
|
|
3337
3586
|
}
|
|
3338
3587
|
const s = e.fullpath();
|
|
3339
3588
|
const i = s + (!e.parent ? "" : this.sep) + t;
|
|
3340
|
-
return this.#
|
|
3589
|
+
return this.#Tt = i;
|
|
3341
3590
|
}
|
|
3342
3591
|
fullpathPosix() {
|
|
3343
3592
|
if (this.#Lt !== undefined) return this.#Lt;
|
|
@@ -3356,7 +3605,7 @@ class PathBase {
|
|
|
3356
3605
|
return this.#Lt = s;
|
|
3357
3606
|
}
|
|
3358
3607
|
isUnknown() {
|
|
3359
|
-
return (this.#Pt &
|
|
3608
|
+
return (this.#Pt & Zt) === It;
|
|
3360
3609
|
}
|
|
3361
3610
|
isType(t) {
|
|
3362
3611
|
return this[`is${t}`]();
|
|
@@ -3365,28 +3614,28 @@ class PathBase {
|
|
|
3365
3614
|
return this.isUnknown() ? "Unknown" : this.isDirectory() ? "Directory" : this.isFile() ? "File" : this.isSymbolicLink() ? "SymbolicLink" : this.isFIFO() ? "FIFO" : this.isCharacterDevice() ? "CharacterDevice" : this.isBlockDevice() ? "BlockDevice" : this.isSocket() ? "Socket" : "Unknown";
|
|
3366
3615
|
}
|
|
3367
3616
|
isFile() {
|
|
3368
|
-
return (this.#Pt &
|
|
3617
|
+
return (this.#Pt & Zt) === Ut;
|
|
3369
3618
|
}
|
|
3370
3619
|
isDirectory() {
|
|
3371
|
-
return (this.#Pt &
|
|
3620
|
+
return (this.#Pt & Zt) === $t;
|
|
3372
3621
|
}
|
|
3373
3622
|
isCharacterDevice() {
|
|
3374
|
-
return (this.#Pt &
|
|
3623
|
+
return (this.#Pt & Zt) === jt;
|
|
3375
3624
|
}
|
|
3376
3625
|
isBlockDevice() {
|
|
3377
|
-
return (this.#Pt &
|
|
3626
|
+
return (this.#Pt & Zt) === Gt;
|
|
3378
3627
|
}
|
|
3379
3628
|
isFIFO() {
|
|
3380
|
-
return (this.#Pt &
|
|
3629
|
+
return (this.#Pt & Zt) === Wt;
|
|
3381
3630
|
}
|
|
3382
3631
|
isSocket() {
|
|
3383
|
-
return (this.#Pt &
|
|
3632
|
+
return (this.#Pt & Zt) === Ht;
|
|
3384
3633
|
}
|
|
3385
3634
|
isSymbolicLink() {
|
|
3386
|
-
return (this.#Pt &
|
|
3635
|
+
return (this.#Pt & qt) === qt;
|
|
3387
3636
|
}
|
|
3388
3637
|
lstatCached() {
|
|
3389
|
-
return this.#Pt &
|
|
3638
|
+
return this.#Pt & Kt ? this : undefined;
|
|
3390
3639
|
}
|
|
3391
3640
|
readlinkCached() {
|
|
3392
3641
|
return this.#Rt;
|
|
@@ -3401,17 +3650,17 @@ class PathBase {
|
|
|
3401
3650
|
canReadlink() {
|
|
3402
3651
|
if (this.#Rt) return true;
|
|
3403
3652
|
if (!this.parent) return false;
|
|
3404
|
-
const t = this.#Pt &
|
|
3405
|
-
return !(t !==
|
|
3653
|
+
const t = this.#Pt & Zt;
|
|
3654
|
+
return !(t !== It && t !== qt || this.#Pt & Qt || this.#Pt & Xt);
|
|
3406
3655
|
}
|
|
3407
3656
|
calledReaddir() {
|
|
3408
|
-
return !!(this.#Pt &
|
|
3657
|
+
return !!(this.#Pt & Jt);
|
|
3409
3658
|
}
|
|
3410
3659
|
isENOENT() {
|
|
3411
|
-
return !!(this.#Pt &
|
|
3660
|
+
return !!(this.#Pt & Xt);
|
|
3412
3661
|
}
|
|
3413
3662
|
isNamed(t) {
|
|
3414
|
-
return !this.nocase ? this.#Et ===
|
|
3663
|
+
return !this.nocase ? this.#Et === normalize(t) : this.#Et === normalizeNocase(t);
|
|
3415
3664
|
}
|
|
3416
3665
|
async readlink() {
|
|
3417
3666
|
const t = this.#Rt;
|
|
@@ -3458,84 +3707,84 @@ class PathBase {
|
|
|
3458
3707
|
}
|
|
3459
3708
|
}
|
|
3460
3709
|
#Nt(t) {
|
|
3461
|
-
this.#Pt |=
|
|
3710
|
+
this.#Pt |= Jt;
|
|
3462
3711
|
for (let e = t.provisional; e < t.length; e++) {
|
|
3463
3712
|
const s = t[e];
|
|
3464
3713
|
if (s) s.#Bt();
|
|
3465
3714
|
}
|
|
3466
3715
|
}
|
|
3467
3716
|
#Bt() {
|
|
3468
|
-
if (this.#Pt &
|
|
3469
|
-
this.#Pt = (this.#Pt |
|
|
3470
|
-
this.#
|
|
3717
|
+
if (this.#Pt & Xt) return;
|
|
3718
|
+
this.#Pt = (this.#Pt | Xt) & Vt;
|
|
3719
|
+
this.#_t();
|
|
3471
3720
|
}
|
|
3472
|
-
#
|
|
3721
|
+
#_t() {
|
|
3473
3722
|
const t = this.children();
|
|
3474
3723
|
t.provisional = 0;
|
|
3475
3724
|
for (const e of t) {
|
|
3476
3725
|
e.#Bt();
|
|
3477
3726
|
}
|
|
3478
3727
|
}
|
|
3479
|
-
#_t() {
|
|
3480
|
-
this.#Pt |= De;
|
|
3481
|
-
this.#It();
|
|
3482
|
-
}
|
|
3483
3728
|
#It() {
|
|
3484
|
-
|
|
3485
|
-
let t = this.#Pt;
|
|
3486
|
-
if ((t & Ae) === xe) t &= Me;
|
|
3487
|
-
this.#Pt = t | Re;
|
|
3729
|
+
this.#Pt |= te;
|
|
3488
3730
|
this.#Wt();
|
|
3489
3731
|
}
|
|
3732
|
+
#Wt() {
|
|
3733
|
+
if (this.#Pt & Yt) return;
|
|
3734
|
+
let t = this.#Pt;
|
|
3735
|
+
if ((t & Zt) === $t) t &= Vt;
|
|
3736
|
+
this.#Pt = t | Yt;
|
|
3737
|
+
this.#_t();
|
|
3738
|
+
}
|
|
3490
3739
|
#jt(t = "") {
|
|
3491
3740
|
if (t === "ENOTDIR" || t === "EPERM") {
|
|
3492
|
-
this.#
|
|
3741
|
+
this.#Wt();
|
|
3493
3742
|
} else if (t === "ENOENT") {
|
|
3494
3743
|
this.#Bt();
|
|
3495
3744
|
} else {
|
|
3496
3745
|
this.children().provisional = 0;
|
|
3497
3746
|
}
|
|
3498
3747
|
}
|
|
3499
|
-
|
|
3748
|
+
#$t(t = "") {
|
|
3500
3749
|
if (t === "ENOTDIR") {
|
|
3501
3750
|
const t = this.parent;
|
|
3502
|
-
t.#
|
|
3751
|
+
t.#Wt();
|
|
3503
3752
|
} else if (t === "ENOENT") {
|
|
3504
3753
|
this.#Bt();
|
|
3505
3754
|
}
|
|
3506
3755
|
}
|
|
3507
3756
|
#Dt(t = "") {
|
|
3508
3757
|
let e = this.#Pt;
|
|
3509
|
-
e |=
|
|
3510
|
-
if (t === "ENOENT") e |=
|
|
3758
|
+
e |= Qt;
|
|
3759
|
+
if (t === "ENOENT") e |= Xt;
|
|
3511
3760
|
if (t === "EINVAL" || t === "UNKNOWN") {
|
|
3512
|
-
e &=
|
|
3761
|
+
e &= Vt;
|
|
3513
3762
|
}
|
|
3514
3763
|
this.#Pt = e;
|
|
3515
3764
|
if (t === "ENOTDIR" && this.parent) {
|
|
3516
|
-
this.parent.#
|
|
3765
|
+
this.parent.#Wt();
|
|
3517
3766
|
}
|
|
3518
3767
|
}
|
|
3519
3768
|
#Gt(t, e) {
|
|
3520
|
-
return this
|
|
3769
|
+
return this.#Ut(t, e) || this.#qt(t, e);
|
|
3521
3770
|
}
|
|
3522
3771
|
#qt(t, e) {
|
|
3523
|
-
const s =
|
|
3772
|
+
const s = entToType(t);
|
|
3524
3773
|
const i = this.newChild(t.name, s, {
|
|
3525
3774
|
parent: this
|
|
3526
3775
|
});
|
|
3527
|
-
const n = i.#Pt &
|
|
3528
|
-
if (n !==
|
|
3529
|
-
i.#Pt |=
|
|
3776
|
+
const n = i.#Pt & Zt;
|
|
3777
|
+
if (n !== $t && n !== qt && n !== It) {
|
|
3778
|
+
i.#Pt |= Yt;
|
|
3530
3779
|
}
|
|
3531
3780
|
e.unshift(i);
|
|
3532
3781
|
e.provisional++;
|
|
3533
3782
|
return i;
|
|
3534
3783
|
}
|
|
3535
|
-
|
|
3784
|
+
#Ut(t, e) {
|
|
3536
3785
|
for (let s = e.provisional; s < e.length; s++) {
|
|
3537
3786
|
const i = e[s];
|
|
3538
|
-
const n = this.nocase ?
|
|
3787
|
+
const n = this.nocase ? normalizeNocase(t.name) : normalize(t.name);
|
|
3539
3788
|
if (n !== i.#Et) {
|
|
3540
3789
|
continue;
|
|
3541
3790
|
}
|
|
@@ -3544,7 +3793,7 @@ class PathBase {
|
|
|
3544
3793
|
}
|
|
3545
3794
|
#Ht(t, e, s, i) {
|
|
3546
3795
|
const n = e.name;
|
|
3547
|
-
e.#Pt = e.#Pt &
|
|
3796
|
+
e.#Pt = e.#Pt & Vt | entToType(t);
|
|
3548
3797
|
if (n !== t.name) e.name = t.name;
|
|
3549
3798
|
if (s !== i.provisional) {
|
|
3550
3799
|
if (s === i.length - 1) i.pop(); else i.splice(s, 1);
|
|
@@ -3554,49 +3803,49 @@ class PathBase {
|
|
|
3554
3803
|
return e;
|
|
3555
3804
|
}
|
|
3556
3805
|
async lstat() {
|
|
3557
|
-
if ((this.#Pt &
|
|
3806
|
+
if ((this.#Pt & Xt) === 0) {
|
|
3558
3807
|
try {
|
|
3559
3808
|
this.#Zt(await this.#ot.promises.lstat(this.fullpath()));
|
|
3560
3809
|
return this;
|
|
3561
3810
|
} catch (t) {
|
|
3562
|
-
this
|
|
3811
|
+
this.#$t(t.code);
|
|
3563
3812
|
}
|
|
3564
3813
|
}
|
|
3565
3814
|
}
|
|
3566
3815
|
lstatSync() {
|
|
3567
|
-
if ((this.#Pt &
|
|
3816
|
+
if ((this.#Pt & Xt) === 0) {
|
|
3568
3817
|
try {
|
|
3569
3818
|
this.#Zt(this.#ot.lstatSync(this.fullpath()));
|
|
3570
3819
|
return this;
|
|
3571
3820
|
} catch (t) {
|
|
3572
|
-
this
|
|
3821
|
+
this.#$t(t.code);
|
|
3573
3822
|
}
|
|
3574
3823
|
}
|
|
3575
3824
|
}
|
|
3576
3825
|
#Zt(t) {
|
|
3577
|
-
const {atime: e, atimeMs: s, birthtime: i, birthtimeMs: n, blksize: r, blocks: o, ctime: h, ctimeMs: a, dev: l, gid: c, ino: f, mode: u, mtime: d, mtimeMs: p, nlink: g, rdev:
|
|
3826
|
+
const {atime: e, atimeMs: s, birthtime: i, birthtimeMs: n, blksize: r, blocks: o, ctime: h, ctimeMs: a, dev: l, gid: c, ino: f, mode: u, mtime: d, mtimeMs: p, nlink: g, rdev: y, size: w, uid: b} = t;
|
|
3578
3827
|
this.#St = e;
|
|
3579
3828
|
this.#mt = s;
|
|
3580
|
-
this.#
|
|
3829
|
+
this.#vt = i;
|
|
3581
3830
|
this.#bt = n;
|
|
3582
3831
|
this.#dt = r;
|
|
3583
3832
|
this.#gt = o;
|
|
3584
|
-
this.#
|
|
3585
|
-
this.#
|
|
3833
|
+
this.#xt = h;
|
|
3834
|
+
this.#wt = a;
|
|
3586
3835
|
this.#ht = l;
|
|
3587
3836
|
this.#ft = c;
|
|
3588
3837
|
this.#pt = f;
|
|
3589
3838
|
this.#at = u;
|
|
3590
3839
|
this.#kt = d;
|
|
3591
|
-
this.#
|
|
3840
|
+
this.#yt = p;
|
|
3592
3841
|
this.#lt = g;
|
|
3593
|
-
this.#ut =
|
|
3594
|
-
this.#
|
|
3595
|
-
this.#ct =
|
|
3596
|
-
const
|
|
3597
|
-
this.#Pt = this.#Pt &
|
|
3598
|
-
if (
|
|
3599
|
-
this.#Pt |=
|
|
3842
|
+
this.#ut = y;
|
|
3843
|
+
this.#v = w;
|
|
3844
|
+
this.#ct = b;
|
|
3845
|
+
const S = entToType(t);
|
|
3846
|
+
this.#Pt = this.#Pt & Vt | S | Kt;
|
|
3847
|
+
if (S !== It && S !== $t && S !== qt) {
|
|
3848
|
+
this.#Pt |= Yt;
|
|
3600
3849
|
}
|
|
3601
3850
|
}
|
|
3602
3851
|
#Vt=[];
|
|
@@ -3653,8 +3902,8 @@ class PathBase {
|
|
|
3653
3902
|
if (this.#Yt) {
|
|
3654
3903
|
await this.#Yt;
|
|
3655
3904
|
} else {
|
|
3656
|
-
let
|
|
3657
|
-
this.#Yt = new Promise((t =>
|
|
3905
|
+
let resolve = () => {};
|
|
3906
|
+
this.#Yt = new Promise((t => resolve = t));
|
|
3658
3907
|
try {
|
|
3659
3908
|
for (const s of await this.#ot.promises.readdir(e, {
|
|
3660
3909
|
withFileTypes: true
|
|
@@ -3667,7 +3916,7 @@ class PathBase {
|
|
|
3667
3916
|
t.provisional = 0;
|
|
3668
3917
|
}
|
|
3669
3918
|
this.#Yt = undefined;
|
|
3670
|
-
|
|
3919
|
+
resolve();
|
|
3671
3920
|
}
|
|
3672
3921
|
return t.slice(0, t.provisional);
|
|
3673
3922
|
}
|
|
@@ -3694,37 +3943,37 @@ class PathBase {
|
|
|
3694
3943
|
return t.slice(0, t.provisional);
|
|
3695
3944
|
}
|
|
3696
3945
|
canReaddir() {
|
|
3697
|
-
if (this.#Pt &
|
|
3698
|
-
const t =
|
|
3699
|
-
if (!(t ===
|
|
3946
|
+
if (this.#Pt & ee) return false;
|
|
3947
|
+
const t = Zt & this.#Pt;
|
|
3948
|
+
if (!(t === It || t === $t || t === qt)) {
|
|
3700
3949
|
return false;
|
|
3701
3950
|
}
|
|
3702
3951
|
return true;
|
|
3703
3952
|
}
|
|
3704
3953
|
shouldWalk(t, e) {
|
|
3705
|
-
return (this.#Pt &
|
|
3954
|
+
return (this.#Pt & $t) === $t && !(this.#Pt & ee) && !t.has(this) && (!e || e(this));
|
|
3706
3955
|
}
|
|
3707
3956
|
async realpath() {
|
|
3708
3957
|
if (this.#Ot) return this.#Ot;
|
|
3709
|
-
if ((
|
|
3958
|
+
if ((te | Qt | Xt) & this.#Pt) return undefined;
|
|
3710
3959
|
try {
|
|
3711
3960
|
const t = await this.#ot.promises.realpath(this.fullpath());
|
|
3712
3961
|
return this.#Ot = this.resolve(t);
|
|
3713
3962
|
} catch (t) {
|
|
3714
|
-
this.#
|
|
3963
|
+
this.#It();
|
|
3715
3964
|
}
|
|
3716
3965
|
}
|
|
3717
3966
|
realpathSync() {
|
|
3718
3967
|
if (this.#Ot) return this.#Ot;
|
|
3719
|
-
if ((
|
|
3968
|
+
if ((te | Qt | Xt) & this.#Pt) return undefined;
|
|
3720
3969
|
try {
|
|
3721
3970
|
const t = this.#ot.realpathSync(this.fullpath());
|
|
3722
3971
|
return this.#Ot = this.resolve(t);
|
|
3723
3972
|
} catch (t) {
|
|
3724
|
-
this.#
|
|
3973
|
+
this.#It();
|
|
3725
3974
|
}
|
|
3726
3975
|
}
|
|
3727
|
-
[
|
|
3976
|
+
[re](t) {
|
|
3728
3977
|
if (t === this) return;
|
|
3729
3978
|
t.isCWD = false;
|
|
3730
3979
|
this.isCWD = true;
|
|
@@ -3749,18 +3998,18 @@ class PathBase {
|
|
|
3749
3998
|
|
|
3750
3999
|
class PathWin32 extends PathBase {
|
|
3751
4000
|
sep="\\";
|
|
3752
|
-
splitSep=
|
|
3753
|
-
constructor(t, e =
|
|
4001
|
+
splitSep=_t;
|
|
4002
|
+
constructor(t, e = It, s, i, n, r, o) {
|
|
3754
4003
|
super(t, e, s, i, n, r, o);
|
|
3755
4004
|
}
|
|
3756
|
-
newChild(t, e =
|
|
4005
|
+
newChild(t, e = It, s = {}) {
|
|
3757
4006
|
return new PathWin32(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
3758
4007
|
}
|
|
3759
4008
|
getRootString(t) {
|
|
3760
|
-
return
|
|
4009
|
+
return e.win32.parse(t).root;
|
|
3761
4010
|
}
|
|
3762
4011
|
getRoot(t) {
|
|
3763
|
-
t =
|
|
4012
|
+
t = uncToDrive(t.toUpperCase());
|
|
3764
4013
|
if (t === this.root.name) {
|
|
3765
4014
|
return this.root;
|
|
3766
4015
|
}
|
|
@@ -3772,7 +4021,7 @@ class PathWin32 extends PathBase {
|
|
|
3772
4021
|
return this.roots[t] = new PathScurryWin32(t, this).root;
|
|
3773
4022
|
}
|
|
3774
4023
|
sameRoot(t, e = this.root.name) {
|
|
3775
|
-
t = t.toUpperCase().replace(/\//g, "\\").replace(
|
|
4024
|
+
t = t.toUpperCase().replace(/\//g, "\\").replace(Bt, "$1\\");
|
|
3776
4025
|
return t === e;
|
|
3777
4026
|
}
|
|
3778
4027
|
}
|
|
@@ -3780,7 +4029,7 @@ class PathWin32 extends PathBase {
|
|
|
3780
4029
|
class PathPosix extends PathBase {
|
|
3781
4030
|
splitSep="/";
|
|
3782
4031
|
sep="/";
|
|
3783
|
-
constructor(t, e =
|
|
4032
|
+
constructor(t, e = It, s, i, n, r, o) {
|
|
3784
4033
|
super(t, e, s, i, n, r, o);
|
|
3785
4034
|
}
|
|
3786
4035
|
getRootString(t) {
|
|
@@ -3789,7 +4038,7 @@ class PathPosix extends PathBase {
|
|
|
3789
4038
|
getRoot(t) {
|
|
3790
4039
|
return this.root;
|
|
3791
4040
|
}
|
|
3792
|
-
newChild(t, e =
|
|
4041
|
+
newChild(t, e = It, s = {}) {
|
|
3793
4042
|
return new PathPosix(t, e, this.root, this.roots, this.nocase, this.childrenCache(), s);
|
|
3794
4043
|
}
|
|
3795
4044
|
}
|
|
@@ -3804,12 +4053,12 @@ class PathScurryBase {
|
|
|
3804
4053
|
#Ft;
|
|
3805
4054
|
nocase;
|
|
3806
4055
|
#ot;
|
|
3807
|
-
constructor(
|
|
3808
|
-
this.#ot =
|
|
3809
|
-
if (
|
|
3810
|
-
|
|
4056
|
+
constructor(e = process.cwd(), s, i, {nocase: n, childrenCacheSize: r = 16 * 1024, fs: o = Nt} = {}) {
|
|
4057
|
+
this.#ot = fsFromOption(o);
|
|
4058
|
+
if (e instanceof URL || e.startsWith("file://")) {
|
|
4059
|
+
e = t.fileURLToPath(e);
|
|
3811
4060
|
}
|
|
3812
|
-
const h = s.resolve(
|
|
4061
|
+
const h = s.resolve(e);
|
|
3813
4062
|
this.roots = Object.create(null);
|
|
3814
4063
|
this.rootPath = this.parseRootPath(h);
|
|
3815
4064
|
this.#Xt = new ResolveCache;
|
|
@@ -4018,38 +4267,38 @@ class PathScurryBase {
|
|
|
4018
4267
|
o.push(s ? t : t.fullpath());
|
|
4019
4268
|
}
|
|
4020
4269
|
const h = new Set;
|
|
4021
|
-
const
|
|
4270
|
+
const walk = (t, e) => {
|
|
4022
4271
|
h.add(t);
|
|
4023
|
-
t.readdirCB(((t,
|
|
4272
|
+
t.readdirCB(((t, a) => {
|
|
4024
4273
|
if (t) {
|
|
4025
4274
|
return e(t);
|
|
4026
4275
|
}
|
|
4027
|
-
let
|
|
4028
|
-
if (!
|
|
4029
|
-
const
|
|
4030
|
-
if (--
|
|
4276
|
+
let l = a.length;
|
|
4277
|
+
if (!l) return e();
|
|
4278
|
+
const next = () => {
|
|
4279
|
+
if (--l === 0) {
|
|
4031
4280
|
e();
|
|
4032
4281
|
}
|
|
4033
4282
|
};
|
|
4034
|
-
for (const t of
|
|
4283
|
+
for (const t of a) {
|
|
4035
4284
|
if (!n || n(t)) {
|
|
4036
4285
|
o.push(s ? t : t.fullpath());
|
|
4037
4286
|
}
|
|
4038
4287
|
if (i && t.isSymbolicLink()) {
|
|
4039
|
-
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ?
|
|
4288
|
+
t.realpath().then((t => t?.isUnknown() ? t.lstat() : t)).then((t => t?.shouldWalk(h, r) ? walk(t, next) : next()));
|
|
4040
4289
|
} else {
|
|
4041
4290
|
if (t.shouldWalk(h, r)) {
|
|
4042
|
-
|
|
4291
|
+
walk(t, next);
|
|
4043
4292
|
} else {
|
|
4044
|
-
|
|
4293
|
+
next();
|
|
4045
4294
|
}
|
|
4046
4295
|
}
|
|
4047
4296
|
}
|
|
4048
4297
|
}), true);
|
|
4049
4298
|
};
|
|
4050
|
-
const
|
|
4299
|
+
const a = t;
|
|
4051
4300
|
return new Promise(((t, e) => {
|
|
4052
|
-
a
|
|
4301
|
+
walk(a, (s => {
|
|
4053
4302
|
if (s) return e(s);
|
|
4054
4303
|
t(o);
|
|
4055
4304
|
}));
|
|
@@ -4147,7 +4396,7 @@ class PathScurryBase {
|
|
|
4147
4396
|
const h = new Set;
|
|
4148
4397
|
const a = [ t ];
|
|
4149
4398
|
let l = 0;
|
|
4150
|
-
const
|
|
4399
|
+
const process = () => {
|
|
4151
4400
|
let t = false;
|
|
4152
4401
|
while (!t) {
|
|
4153
4402
|
const e = a.shift();
|
|
@@ -4157,21 +4406,21 @@ class PathScurryBase {
|
|
|
4157
4406
|
}
|
|
4158
4407
|
l++;
|
|
4159
4408
|
h.add(e);
|
|
4160
|
-
const
|
|
4409
|
+
const onReaddir = (e, f, u = false) => {
|
|
4161
4410
|
if (e) return o.emit("error", e);
|
|
4162
|
-
if (i && !
|
|
4411
|
+
if (i && !u) {
|
|
4163
4412
|
const t = [];
|
|
4164
|
-
for (const e of
|
|
4413
|
+
for (const e of f) {
|
|
4165
4414
|
if (e.isSymbolicLink()) {
|
|
4166
4415
|
t.push(e.realpath().then((t => t?.isUnknown() ? t.lstat() : t)));
|
|
4167
4416
|
}
|
|
4168
4417
|
}
|
|
4169
4418
|
if (t.length) {
|
|
4170
|
-
Promise.all(t).then((() =>
|
|
4419
|
+
Promise.all(t).then((() => onReaddir(null, f, true)));
|
|
4171
4420
|
return;
|
|
4172
4421
|
}
|
|
4173
4422
|
}
|
|
4174
|
-
for (const e of
|
|
4423
|
+
for (const e of f) {
|
|
4175
4424
|
if (e && (!n || n(e))) {
|
|
4176
4425
|
if (!o.write(s ? e : e.fullpath())) {
|
|
4177
4426
|
t = true;
|
|
@@ -4179,24 +4428,24 @@ class PathScurryBase {
|
|
|
4179
4428
|
}
|
|
4180
4429
|
}
|
|
4181
4430
|
l--;
|
|
4182
|
-
for (const t of
|
|
4431
|
+
for (const t of f) {
|
|
4183
4432
|
const e = t.realpathCached() || t;
|
|
4184
4433
|
if (e.shouldWalk(h, r)) {
|
|
4185
4434
|
a.push(e);
|
|
4186
4435
|
}
|
|
4187
4436
|
}
|
|
4188
4437
|
if (t && !o.flowing) {
|
|
4189
|
-
o.once("drain",
|
|
4190
|
-
} else if (!
|
|
4191
|
-
|
|
4438
|
+
o.once("drain", process);
|
|
4439
|
+
} else if (!c) {
|
|
4440
|
+
process();
|
|
4192
4441
|
}
|
|
4193
4442
|
};
|
|
4194
|
-
let
|
|
4195
|
-
e.readdirCB(
|
|
4196
|
-
|
|
4443
|
+
let c = true;
|
|
4444
|
+
e.readdirCB(onReaddir, true);
|
|
4445
|
+
c = false;
|
|
4197
4446
|
}
|
|
4198
4447
|
};
|
|
4199
|
-
|
|
4448
|
+
process();
|
|
4200
4449
|
return o;
|
|
4201
4450
|
}
|
|
4202
4451
|
streamSync(t = this.cwd, e = {}) {
|
|
@@ -4216,7 +4465,7 @@ class PathScurryBase {
|
|
|
4216
4465
|
}
|
|
4217
4466
|
const a = [ t ];
|
|
4218
4467
|
let l = 0;
|
|
4219
|
-
const
|
|
4468
|
+
const process = () => {
|
|
4220
4469
|
let t = false;
|
|
4221
4470
|
while (!t) {
|
|
4222
4471
|
const e = a.shift();
|
|
@@ -4246,24 +4495,24 @@ class PathScurryBase {
|
|
|
4246
4495
|
}
|
|
4247
4496
|
}
|
|
4248
4497
|
}
|
|
4249
|
-
if (t && !o.flowing) o.once("drain",
|
|
4498
|
+
if (t && !o.flowing) o.once("drain", process);
|
|
4250
4499
|
};
|
|
4251
|
-
|
|
4500
|
+
process();
|
|
4252
4501
|
return o;
|
|
4253
4502
|
}
|
|
4254
4503
|
chdir(t = this.cwd) {
|
|
4255
4504
|
const e = this.cwd;
|
|
4256
4505
|
this.cwd = typeof t === "string" ? this.cwd.resolve(t) : t;
|
|
4257
|
-
this.cwd[
|
|
4506
|
+
this.cwd[re](e);
|
|
4258
4507
|
}
|
|
4259
4508
|
}
|
|
4260
4509
|
|
|
4261
4510
|
class PathScurryWin32 extends PathScurryBase {
|
|
4262
4511
|
sep="\\";
|
|
4263
|
-
constructor(t = process.cwd(),
|
|
4264
|
-
const {nocase: i = true} =
|
|
4265
|
-
super(t,
|
|
4266
|
-
...
|
|
4512
|
+
constructor(t = process.cwd(), s = {}) {
|
|
4513
|
+
const {nocase: i = true} = s;
|
|
4514
|
+
super(t, e.win32, "\\", {
|
|
4515
|
+
...s,
|
|
4267
4516
|
nocase: i
|
|
4268
4517
|
});
|
|
4269
4518
|
this.nocase = i;
|
|
@@ -4272,10 +4521,10 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4272
4521
|
}
|
|
4273
4522
|
}
|
|
4274
4523
|
parseRootPath(t) {
|
|
4275
|
-
return
|
|
4524
|
+
return e.win32.parse(t).root.toUpperCase();
|
|
4276
4525
|
}
|
|
4277
4526
|
newRoot(t) {
|
|
4278
|
-
return new PathWin32(this.rootPath,
|
|
4527
|
+
return new PathWin32(this.rootPath, $t, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4279
4528
|
fs: t
|
|
4280
4529
|
});
|
|
4281
4530
|
}
|
|
@@ -4286,10 +4535,10 @@ class PathScurryWin32 extends PathScurryBase {
|
|
|
4286
4535
|
|
|
4287
4536
|
class PathScurryPosix extends PathScurryBase {
|
|
4288
4537
|
sep="/";
|
|
4289
|
-
constructor(t = process.cwd(),
|
|
4290
|
-
const {nocase: i = false} =
|
|
4291
|
-
super(t,
|
|
4292
|
-
...
|
|
4538
|
+
constructor(t = process.cwd(), s = {}) {
|
|
4539
|
+
const {nocase: i = false} = s;
|
|
4540
|
+
super(t, e.posix, "/", {
|
|
4541
|
+
...s,
|
|
4293
4542
|
nocase: i
|
|
4294
4543
|
});
|
|
4295
4544
|
this.nocase = i;
|
|
@@ -4298,7 +4547,7 @@ class PathScurryPosix extends PathScurryBase {
|
|
|
4298
4547
|
return "/";
|
|
4299
4548
|
}
|
|
4300
4549
|
newRoot(t) {
|
|
4301
|
-
return new PathPosix(this.rootPath,
|
|
4550
|
+
return new PathPosix(this.rootPath, $t, undefined, this.roots, this.nocase, this.childrenCache(), {
|
|
4302
4551
|
fs: t
|
|
4303
4552
|
});
|
|
4304
4553
|
}
|
|
@@ -4317,13 +4566,13 @@ class PathScurryDarwin extends PathScurryPosix {
|
|
|
4317
4566
|
}
|
|
4318
4567
|
}
|
|
4319
4568
|
|
|
4320
|
-
const
|
|
4569
|
+
const oe = process.platform === "win32" ? PathWin32 : PathPosix;
|
|
4321
4570
|
|
|
4322
|
-
const
|
|
4571
|
+
const he = process.platform === "win32" ? PathScurryWin32 : process.platform === "darwin" ? PathScurryDarwin : PathScurryPosix;
|
|
4323
4572
|
|
|
4324
|
-
const
|
|
4573
|
+
const isPatternList = t => t.length >= 1;
|
|
4325
4574
|
|
|
4326
|
-
const
|
|
4575
|
+
const isGlobList = t => t.length >= 1;
|
|
4327
4576
|
|
|
4328
4577
|
class Pattern {
|
|
4329
4578
|
#te;
|
|
@@ -4338,10 +4587,10 @@ class Pattern {
|
|
|
4338
4587
|
#ae;
|
|
4339
4588
|
#le=true;
|
|
4340
4589
|
constructor(t, e, s, i) {
|
|
4341
|
-
if (!
|
|
4590
|
+
if (!isPatternList(t)) {
|
|
4342
4591
|
throw new TypeError("empty pattern list");
|
|
4343
4592
|
}
|
|
4344
|
-
if (!
|
|
4593
|
+
if (!isGlobList(e)) {
|
|
4345
4594
|
throw new TypeError("empty glob list");
|
|
4346
4595
|
}
|
|
4347
4596
|
if (e.length !== t.length) {
|
|
@@ -4390,7 +4639,7 @@ class Pattern {
|
|
|
4390
4639
|
return typeof this.#te[this.#se] === "string";
|
|
4391
4640
|
}
|
|
4392
4641
|
isGlobstar() {
|
|
4393
|
-
return this.#te[this.#se] ===
|
|
4642
|
+
return this.#te[this.#se] === q;
|
|
4394
4643
|
}
|
|
4395
4644
|
isRegExp() {
|
|
4396
4645
|
return this.#te[this.#se] instanceof RegExp;
|
|
@@ -4436,7 +4685,7 @@ class Pattern {
|
|
|
4436
4685
|
}
|
|
4437
4686
|
}
|
|
4438
4687
|
|
|
4439
|
-
const
|
|
4688
|
+
const ae = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
4440
4689
|
|
|
4441
4690
|
class Ignore {
|
|
4442
4691
|
relative;
|
|
@@ -4445,7 +4694,7 @@ class Ignore {
|
|
|
4445
4694
|
absoluteChildren;
|
|
4446
4695
|
platform;
|
|
4447
4696
|
mmopts;
|
|
4448
|
-
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r =
|
|
4697
|
+
constructor(t, {nobrace: e, nocase: s, noext: i, noglobstar: n, platform: r = ae}) {
|
|
4449
4698
|
this.relative = [];
|
|
4450
4699
|
this.absolute = [];
|
|
4451
4700
|
this.relativeChildren = [];
|
|
@@ -4621,7 +4870,7 @@ class Processor {
|
|
|
4621
4870
|
const e = n === ".." || n === "" || n === ".";
|
|
4622
4871
|
this.matches.add(t.resolve(n), i, e);
|
|
4623
4872
|
continue;
|
|
4624
|
-
} else if (n ===
|
|
4873
|
+
} else if (n === q) {
|
|
4625
4874
|
if (!t.isSymbolicLink() || this.follow || e.checkFollowGlobstar()) {
|
|
4626
4875
|
this.subwalks.add(t, e);
|
|
4627
4876
|
}
|
|
@@ -4657,7 +4906,7 @@ class Processor {
|
|
|
4657
4906
|
const s = e.isAbsolute();
|
|
4658
4907
|
const n = e.pattern();
|
|
4659
4908
|
const r = e.rest();
|
|
4660
|
-
if (n ===
|
|
4909
|
+
if (n === q) {
|
|
4661
4910
|
i.testGlobstar(t, e, r, s);
|
|
4662
4911
|
} else if (n instanceof RegExp) {
|
|
4663
4912
|
i.testRegExp(t, n, r, s);
|
|
@@ -4715,7 +4964,7 @@ class Processor {
|
|
|
4715
4964
|
}
|
|
4716
4965
|
}
|
|
4717
4966
|
|
|
4718
|
-
const
|
|
4967
|
+
const makeIgnore = (t, e) => typeof t === "string" ? new Ignore([ t ], e) : Array.isArray(t) ? new Ignore(t, e) : t;
|
|
4719
4968
|
|
|
4720
4969
|
class GlobUtil {
|
|
4721
4970
|
path;
|
|
@@ -4737,7 +4986,7 @@ class GlobUtil {
|
|
|
4737
4986
|
this.#ue = !s.posix && s.platform === "win32" ? "\\" : "/";
|
|
4738
4987
|
this.includeChildMatches = s.includeChildMatches !== false;
|
|
4739
4988
|
if (s.ignore || !this.includeChildMatches) {
|
|
4740
|
-
this.#fe =
|
|
4989
|
+
this.#fe = makeIgnore(s.ignore ?? [], s);
|
|
4741
4990
|
if (!this.includeChildMatches && typeof this.#fe.add !== "function") {
|
|
4742
4991
|
const t = "cannot ignore child matches, ignore lacks add() method.";
|
|
4743
4992
|
throw new Error(t);
|
|
@@ -4856,13 +5105,13 @@ class GlobUtil {
|
|
|
4856
5105
|
}
|
|
4857
5106
|
s.processPatterns(t, e);
|
|
4858
5107
|
let n = 1;
|
|
4859
|
-
const
|
|
5108
|
+
const next = () => {
|
|
4860
5109
|
if (--n === 0) i();
|
|
4861
5110
|
};
|
|
4862
5111
|
for (const [t, e, i] of s.matches.entries()) {
|
|
4863
5112
|
if (this.#de(t)) continue;
|
|
4864
5113
|
n++;
|
|
4865
|
-
this.match(t, e, i).then((() =>
|
|
5114
|
+
this.match(t, e, i).then((() => next()));
|
|
4866
5115
|
}
|
|
4867
5116
|
for (const t of s.subwalkTargets()) {
|
|
4868
5117
|
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
|
@@ -4870,28 +5119,28 @@ class GlobUtil {
|
|
|
4870
5119
|
}
|
|
4871
5120
|
n++;
|
|
4872
5121
|
const e = t.readdirCached();
|
|
4873
|
-
if (t.calledReaddir()) this.walkCB3(t, e, s,
|
|
4874
|
-
t.readdirCB(((e, i) => this.walkCB3(t, i, s,
|
|
5122
|
+
if (t.calledReaddir()) this.walkCB3(t, e, s, next); else {
|
|
5123
|
+
t.readdirCB(((e, i) => this.walkCB3(t, i, s, next)), true);
|
|
4875
5124
|
}
|
|
4876
5125
|
}
|
|
4877
|
-
|
|
5126
|
+
next();
|
|
4878
5127
|
}
|
|
4879
5128
|
walkCB3(t, e, s, i) {
|
|
4880
5129
|
s = s.filterEntries(t, e);
|
|
4881
5130
|
let n = 1;
|
|
4882
|
-
const
|
|
5131
|
+
const next = () => {
|
|
4883
5132
|
if (--n === 0) i();
|
|
4884
5133
|
};
|
|
4885
5134
|
for (const [t, e, i] of s.matches.entries()) {
|
|
4886
5135
|
if (this.#de(t)) continue;
|
|
4887
5136
|
n++;
|
|
4888
|
-
this.match(t, e, i).then((() =>
|
|
5137
|
+
this.match(t, e, i).then((() => next()));
|
|
4889
5138
|
}
|
|
4890
5139
|
for (const [t, e] of s.subwalks.entries()) {
|
|
4891
5140
|
n++;
|
|
4892
|
-
this.walkCB2(t, e, s.child(),
|
|
5141
|
+
this.walkCB2(t, e, s.child(), next);
|
|
4893
5142
|
}
|
|
4894
|
-
|
|
5143
|
+
next();
|
|
4895
5144
|
}
|
|
4896
5145
|
walkCBSync(t, e, s) {
|
|
4897
5146
|
if (this.signal?.aborted) s();
|
|
@@ -4906,7 +5155,7 @@ class GlobUtil {
|
|
|
4906
5155
|
}
|
|
4907
5156
|
s.processPatterns(t, e);
|
|
4908
5157
|
let n = 1;
|
|
4909
|
-
const
|
|
5158
|
+
const next = () => {
|
|
4910
5159
|
if (--n === 0) i();
|
|
4911
5160
|
};
|
|
4912
5161
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -4919,14 +5168,14 @@ class GlobUtil {
|
|
|
4919
5168
|
}
|
|
4920
5169
|
n++;
|
|
4921
5170
|
const e = t.readdirSync();
|
|
4922
|
-
this.walkCB3Sync(t, e, s,
|
|
5171
|
+
this.walkCB3Sync(t, e, s, next);
|
|
4923
5172
|
}
|
|
4924
|
-
|
|
5173
|
+
next();
|
|
4925
5174
|
}
|
|
4926
5175
|
walkCB3Sync(t, e, s, i) {
|
|
4927
5176
|
s = s.filterEntries(t, e);
|
|
4928
5177
|
let n = 1;
|
|
4929
|
-
const
|
|
5178
|
+
const next = () => {
|
|
4930
5179
|
if (--n === 0) i();
|
|
4931
5180
|
};
|
|
4932
5181
|
for (const [t, e, i] of s.matches.entries()) {
|
|
@@ -4935,9 +5184,9 @@ class GlobUtil {
|
|
|
4935
5184
|
}
|
|
4936
5185
|
for (const [t, e] of s.subwalks.entries()) {
|
|
4937
5186
|
n++;
|
|
4938
|
-
this.walkCB2Sync(t, e, s.child(),
|
|
5187
|
+
this.walkCB2Sync(t, e, s.child(), next);
|
|
4939
5188
|
}
|
|
4940
|
-
|
|
5189
|
+
next();
|
|
4941
5190
|
}
|
|
4942
5191
|
}
|
|
4943
5192
|
|
|
@@ -5012,9 +5261,9 @@ class GlobStream extends GlobUtil {
|
|
|
5012
5261
|
}
|
|
5013
5262
|
}
|
|
5014
5263
|
|
|
5015
|
-
const
|
|
5264
|
+
const le = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
|
5016
5265
|
|
|
5017
|
-
let
|
|
5266
|
+
let ce = class Glob {
|
|
5018
5267
|
absolute;
|
|
5019
5268
|
cwd;
|
|
5020
5269
|
root;
|
|
@@ -5042,7 +5291,7 @@ let Ye = class Glob {
|
|
|
5042
5291
|
includeChildMatches;
|
|
5043
5292
|
opts;
|
|
5044
5293
|
patterns;
|
|
5045
|
-
constructor(
|
|
5294
|
+
constructor(e, s) {
|
|
5046
5295
|
if (!s) throw new TypeError("glob options required");
|
|
5047
5296
|
this.withFileTypes = !!s.withFileTypes;
|
|
5048
5297
|
this.signal = s.signal;
|
|
@@ -5054,7 +5303,7 @@ let Ye = class Glob {
|
|
|
5054
5303
|
if (!s.cwd) {
|
|
5055
5304
|
this.cwd = "";
|
|
5056
5305
|
} else if (s.cwd instanceof URL || s.cwd.startsWith("file://")) {
|
|
5057
|
-
s.cwd =
|
|
5306
|
+
s.cwd = t.fileURLToPath(s.cwd);
|
|
5058
5307
|
}
|
|
5059
5308
|
this.cwd = s.cwd || "";
|
|
5060
5309
|
this.root = s.root;
|
|
@@ -5072,21 +5321,21 @@ let Ye = class Glob {
|
|
|
5072
5321
|
if (this.withFileTypes && this.absolute !== undefined) {
|
|
5073
5322
|
throw new Error("cannot set absolute and withFileTypes:true");
|
|
5074
5323
|
}
|
|
5075
|
-
if (typeof
|
|
5076
|
-
|
|
5324
|
+
if (typeof e === "string") {
|
|
5325
|
+
e = [ e ];
|
|
5077
5326
|
}
|
|
5078
5327
|
this.windowsPathsNoEscape = !!s.windowsPathsNoEscape || s.allowWindowsEscape === false;
|
|
5079
5328
|
if (this.windowsPathsNoEscape) {
|
|
5080
|
-
|
|
5329
|
+
e = e.map((t => t.replace(/\\/g, "/")));
|
|
5081
5330
|
}
|
|
5082
5331
|
if (this.matchBase) {
|
|
5083
5332
|
if (s.noglobstar) {
|
|
5084
5333
|
throw new TypeError("base matching requires globstar");
|
|
5085
5334
|
}
|
|
5086
|
-
|
|
5335
|
+
e = e.map((t => t.includes("/") ? t : `./**/${t}`));
|
|
5087
5336
|
}
|
|
5088
|
-
this.pattern =
|
|
5089
|
-
this.platform = s.platform ||
|
|
5337
|
+
this.pattern = e;
|
|
5338
|
+
this.platform = s.platform || le;
|
|
5090
5339
|
this.opts = {
|
|
5091
5340
|
...s,
|
|
5092
5341
|
platform: this.platform
|
|
@@ -5097,7 +5346,7 @@ let Ye = class Glob {
|
|
|
5097
5346
|
throw new Error("nocase option contradicts provided scurry option");
|
|
5098
5347
|
}
|
|
5099
5348
|
} else {
|
|
5100
|
-
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix :
|
|
5349
|
+
const t = s.platform === "win32" ? PathScurryWin32 : s.platform === "darwin" ? PathScurryDarwin : s.platform ? PathScurryPosix : he;
|
|
5101
5350
|
this.scurry = new t(this.cwd, {
|
|
5102
5351
|
nocase: s.nocase,
|
|
5103
5352
|
fs: s.fs
|
|
@@ -5182,7 +5431,7 @@ let Ye = class Glob {
|
|
|
5182
5431
|
}
|
|
5183
5432
|
};
|
|
5184
5433
|
|
|
5185
|
-
const
|
|
5434
|
+
const hasMagic = (t, e = {}) => {
|
|
5186
5435
|
if (!Array.isArray(t)) {
|
|
5187
5436
|
t = [ t ];
|
|
5188
5437
|
}
|
|
@@ -5192,69 +5441,69 @@ const Xe = (t, e = {}) => {
|
|
|
5192
5441
|
return false;
|
|
5193
5442
|
};
|
|
5194
5443
|
|
|
5195
|
-
function
|
|
5196
|
-
return new
|
|
5444
|
+
function globStreamSync(t, e = {}) {
|
|
5445
|
+
return new ce(t, e).streamSync();
|
|
5197
5446
|
}
|
|
5198
5447
|
|
|
5199
|
-
function
|
|
5200
|
-
return new
|
|
5448
|
+
function globStream(t, e = {}) {
|
|
5449
|
+
return new ce(t, e).stream();
|
|
5201
5450
|
}
|
|
5202
5451
|
|
|
5203
|
-
function
|
|
5204
|
-
return new
|
|
5452
|
+
function globSync(t, e = {}) {
|
|
5453
|
+
return new ce(t, e).walkSync();
|
|
5205
5454
|
}
|
|
5206
5455
|
|
|
5207
|
-
async function
|
|
5208
|
-
return new
|
|
5456
|
+
async function glob_(t, e = {}) {
|
|
5457
|
+
return new ce(t, e).walk();
|
|
5209
5458
|
}
|
|
5210
5459
|
|
|
5211
|
-
function
|
|
5212
|
-
return new
|
|
5460
|
+
function globIterateSync(t, e = {}) {
|
|
5461
|
+
return new ce(t, e).iterateSync();
|
|
5213
5462
|
}
|
|
5214
5463
|
|
|
5215
|
-
function
|
|
5216
|
-
return new
|
|
5464
|
+
function globIterate(t, e = {}) {
|
|
5465
|
+
return new ce(t, e).iterate();
|
|
5217
5466
|
}
|
|
5218
5467
|
|
|
5219
|
-
const
|
|
5468
|
+
const fe = globStreamSync;
|
|
5220
5469
|
|
|
5221
|
-
const
|
|
5222
|
-
sync:
|
|
5470
|
+
const ue = Object.assign(globStream, {
|
|
5471
|
+
sync: globStreamSync
|
|
5223
5472
|
});
|
|
5224
5473
|
|
|
5225
|
-
const
|
|
5474
|
+
const de = globIterateSync;
|
|
5226
5475
|
|
|
5227
|
-
const
|
|
5228
|
-
sync:
|
|
5476
|
+
const pe = Object.assign(globIterate, {
|
|
5477
|
+
sync: globIterateSync
|
|
5229
5478
|
});
|
|
5230
5479
|
|
|
5231
|
-
const
|
|
5232
|
-
stream:
|
|
5233
|
-
iterate:
|
|
5480
|
+
const ge = Object.assign(globSync, {
|
|
5481
|
+
stream: globStreamSync,
|
|
5482
|
+
iterate: globIterateSync
|
|
5234
5483
|
});
|
|
5235
5484
|
|
|
5236
|
-
const
|
|
5237
|
-
glob:
|
|
5238
|
-
globSync
|
|
5239
|
-
sync:
|
|
5240
|
-
globStream
|
|
5241
|
-
stream:
|
|
5242
|
-
globStreamSync
|
|
5243
|
-
streamSync:
|
|
5244
|
-
globIterate
|
|
5245
|
-
iterate:
|
|
5246
|
-
globIterateSync
|
|
5247
|
-
iterateSync:
|
|
5248
|
-
Glob:
|
|
5249
|
-
hasMagic
|
|
5250
|
-
escape
|
|
5251
|
-
unescape
|
|
5485
|
+
const me = Object.assign(glob_, {
|
|
5486
|
+
glob: glob_,
|
|
5487
|
+
globSync,
|
|
5488
|
+
sync: ge,
|
|
5489
|
+
globStream,
|
|
5490
|
+
stream: ue,
|
|
5491
|
+
globStreamSync,
|
|
5492
|
+
streamSync: fe,
|
|
5493
|
+
globIterate,
|
|
5494
|
+
iterate: pe,
|
|
5495
|
+
globIterateSync,
|
|
5496
|
+
iterateSync: de,
|
|
5497
|
+
Glob: ce,
|
|
5498
|
+
hasMagic,
|
|
5499
|
+
escape,
|
|
5500
|
+
unescape
|
|
5252
5501
|
});
|
|
5253
5502
|
|
|
5254
|
-
|
|
5503
|
+
me.glob = me;
|
|
5255
5504
|
|
|
5256
|
-
async function
|
|
5257
|
-
return e ? await
|
|
5505
|
+
async function Glob(t, e) {
|
|
5506
|
+
return e ? await me(t, e) : await me(t);
|
|
5258
5507
|
}
|
|
5259
5508
|
|
|
5260
|
-
exports.Glob =
|
|
5509
|
+
exports.Glob = Glob;
|