@machhub-dev/node-red-nodes 1.0.5
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/LICENSE +373 -0
- package/dist/lib/config/machhub-env-loader.js +93 -0
- package/dist/lib/enums/data.enums.js +12 -0
- package/dist/lib/errors/errors.js +15 -0
- package/dist/lib/models/collections.model.js +2 -0
- package/dist/lib/models/machine.models.js +2 -0
- package/dist/lib/models/product.models.js +2 -0
- package/dist/lib/models/recordId.models.js +11 -0
- package/dist/lib/services/http.api.services.js +152 -0
- package/dist/lib/services/http.service.js +188 -0
- package/dist/lib/services/mqtt.service.js +234 -0
- package/dist/nodes/bulk-tag-write.html +91 -0
- package/dist/nodes/bulk-tag-write.js +118 -0
- package/dist/nodes/collections.html +508 -0
- package/dist/nodes/collections.js +241 -0
- package/dist/nodes/dbquery.html +131 -0
- package/dist/nodes/dbquery.js +83 -0
- package/dist/nodes/machhub-config.html +39 -0
- package/dist/nodes/machhub-config.js +15 -0
- package/dist/nodes/tag-read.html +194 -0
- package/dist/nodes/tag-read.js +133 -0
- package/dist/nodes/tag-write.html +162 -0
- package/dist/nodes/tag-write.js +110 -0
- package/node_modules/@babel/runtime/LICENSE +22 -0
- package/node_modules/@babel/runtime/README.md +19 -0
- package/node_modules/@babel/runtime/helpers/AwaitValue.js +4 -0
- package/node_modules/@babel/runtime/helpers/OverloadYield.js +4 -0
- package/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js +9 -0
- package/node_modules/@babel/runtime/helpers/applyDecs.js +236 -0
- package/node_modules/@babel/runtime/helpers/applyDecs2203.js +184 -0
- package/node_modules/@babel/runtime/helpers/applyDecs2203R.js +191 -0
- package/node_modules/@babel/runtime/helpers/applyDecs2301.js +222 -0
- package/node_modules/@babel/runtime/helpers/applyDecs2305.js +133 -0
- package/node_modules/@babel/runtime/helpers/applyDecs2311.js +124 -0
- package/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +6 -0
- package/node_modules/@babel/runtime/helpers/arrayWithHoles.js +4 -0
- package/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +5 -0
- package/node_modules/@babel/runtime/helpers/assertClassBrand.js +5 -0
- package/node_modules/@babel/runtime/helpers/assertThisInitialized.js +5 -0
- package/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js +24 -0
- package/node_modules/@babel/runtime/helpers/asyncIterator.js +45 -0
- package/node_modules/@babel/runtime/helpers/asyncToGenerator.js +26 -0
- package/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js +5 -0
- package/node_modules/@babel/runtime/helpers/callSuper.js +7 -0
- package/node_modules/@babel/runtime/helpers/checkInRHS.js +6 -0
- package/node_modules/@babel/runtime/helpers/checkPrivateRedeclaration.js +4 -0
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorDestructureSet.js +10 -0
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorGet.js +4 -0
- package/node_modules/@babel/runtime/helpers/classApplyDescriptorSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classCallCheck.js +4 -0
- package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticAccess.js +5 -0
- package/node_modules/@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/node_modules/@babel/runtime/helpers/classExtractFieldDescriptor.js +5 -0
- package/node_modules/@babel/runtime/helpers/classNameTDZError.js +4 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldDestructureSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldGet2.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldInitSpec.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classPrivateFieldSet2.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateGetter.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateMethodInitSpec.js +5 -0
- package/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js +4 -0
- package/node_modules/@babel/runtime/helpers/classPrivateSetter.js +5 -0
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldDestructureSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js +5 -0
- package/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js +4 -0
- package/node_modules/@babel/runtime/helpers/construct.js +10 -0
- package/node_modules/@babel/runtime/helpers/createClass.js +13 -0
- package/node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js +50 -0
- package/node_modules/@babel/runtime/helpers/createForOfIteratorHelperLoose.js +19 -0
- package/node_modules/@babel/runtime/helpers/createSuper.js +16 -0
- package/node_modules/@babel/runtime/helpers/decorate.js +250 -0
- package/node_modules/@babel/runtime/helpers/defaults.js +9 -0
- package/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
- package/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js +12 -0
- package/node_modules/@babel/runtime/helpers/defineProperty.js +10 -0
- package/node_modules/@babel/runtime/helpers/dispose.js +28 -0
- package/node_modules/@babel/runtime/helpers/esm/AwaitValue.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/OverloadYield.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs.js +236 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +184 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +191 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +222 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2305.js +133 -0
- package/node_modules/@babel/runtime/helpers/esm/applyDecs2311.js +124 -0
- package/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/assertClassBrand.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js +24 -0
- package/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +45 -0
- package/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js +26 -0
- package/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/callSuper.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/checkInRHS.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/checkPrivateRedeclaration.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorDestructureSet.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorGet.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classApplyDescriptorSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classCallCheck.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticAccess.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classCheckPrivateStaticFieldDescriptor.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classExtractFieldDescriptor.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldDestructureSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet2.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldInitSpec.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet2.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateGetter.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodInitSpec.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/classPrivateSetter.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldDestructureSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/construct.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/createClass.js +13 -0
- package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js +50 -0
- package/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelperLoose.js +19 -0
- package/node_modules/@babel/runtime/helpers/esm/createSuper.js +16 -0
- package/node_modules/@babel/runtime/helpers/esm/decorate.js +250 -0
- package/node_modules/@babel/runtime/helpers/esm/defaults.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js +12 -0
- package/node_modules/@babel/runtime/helpers/esm/defineProperty.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/dispose.js +28 -0
- package/node_modules/@babel/runtime/helpers/esm/extends.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/get.js +11 -0
- package/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/identity.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/importDeferProxy.js +27 -0
- package/node_modules/@babel/runtime/helpers/esm/inherits.js +14 -0
- package/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +5 -0
- package/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/instanceof.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +27 -0
- package/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +28 -0
- package/node_modules/@babel/runtime/helpers/esm/jsx.js +22 -0
- package/node_modules/@babel/runtime/helpers/esm/maybeArrayLike.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/nullishReceiverError.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/objectSpread.js +14 -0
- package/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +23 -0
- package/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +13 -0
- package/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/package.json +3 -0
- package/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/readOnlyError.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +304 -0
- package/node_modules/@babel/runtime/helpers/esm/set.js +22 -0
- package/node_modules/@babel/runtime/helpers/esm/setFunctionName.js +12 -0
- package/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/superPropBase.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/superPropGet.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/tdz.js +4 -0
- package/node_modules/@babel/runtime/helpers/esm/temporalRef.js +6 -0
- package/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js +2 -0
- package/node_modules/@babel/runtime/helpers/esm/toArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +12 -0
- package/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +7 -0
- package/node_modules/@babel/runtime/helpers/esm/toSetter.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/typeof.js +10 -0
- package/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +9 -0
- package/node_modules/@babel/runtime/helpers/esm/using.js +12 -0
- package/node_modules/@babel/runtime/helpers/esm/usingCtx.js +59 -0
- package/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js +69 -0
- package/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js +27 -0
- package/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +51 -0
- package/node_modules/@babel/runtime/helpers/esm/writeOnlyError.js +4 -0
- package/node_modules/@babel/runtime/helpers/extends.js +10 -0
- package/node_modules/@babel/runtime/helpers/get.js +11 -0
- package/node_modules/@babel/runtime/helpers/getPrototypeOf.js +6 -0
- package/node_modules/@babel/runtime/helpers/identity.js +4 -0
- package/node_modules/@babel/runtime/helpers/importDeferProxy.js +27 -0
- package/node_modules/@babel/runtime/helpers/inherits.js +14 -0
- package/node_modules/@babel/runtime/helpers/inheritsLoose.js +5 -0
- package/node_modules/@babel/runtime/helpers/initializerDefineProperty.js +9 -0
- package/node_modules/@babel/runtime/helpers/initializerWarningHelper.js +4 -0
- package/node_modules/@babel/runtime/helpers/instanceof.js +4 -0
- package/node_modules/@babel/runtime/helpers/interopRequireDefault.js +6 -0
- package/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +27 -0
- package/node_modules/@babel/runtime/helpers/isNativeFunction.js +8 -0
- package/node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js +9 -0
- package/node_modules/@babel/runtime/helpers/iterableToArray.js +4 -0
- package/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +28 -0
- package/node_modules/@babel/runtime/helpers/jsx.js +22 -0
- package/node_modules/@babel/runtime/helpers/maybeArrayLike.js +9 -0
- package/node_modules/@babel/runtime/helpers/newArrowCheck.js +4 -0
- package/node_modules/@babel/runtime/helpers/nonIterableRest.js +4 -0
- package/node_modules/@babel/runtime/helpers/nonIterableSpread.js +4 -0
- package/node_modules/@babel/runtime/helpers/nullishReceiverError.js +4 -0
- package/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js +4 -0
- package/node_modules/@babel/runtime/helpers/objectSpread.js +14 -0
- package/node_modules/@babel/runtime/helpers/objectSpread2.js +23 -0
- package/node_modules/@babel/runtime/helpers/objectWithoutProperties.js +13 -0
- package/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +10 -0
- package/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js +8 -0
- package/node_modules/@babel/runtime/helpers/readOnlyError.js +4 -0
- package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +304 -0
- package/node_modules/@babel/runtime/helpers/set.js +22 -0
- package/node_modules/@babel/runtime/helpers/setFunctionName.js +12 -0
- package/node_modules/@babel/runtime/helpers/setPrototypeOf.js +6 -0
- package/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js +7 -0
- package/node_modules/@babel/runtime/helpers/slicedToArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/superPropBase.js +6 -0
- package/node_modules/@babel/runtime/helpers/superPropGet.js +9 -0
- package/node_modules/@babel/runtime/helpers/superPropSet.js +6 -0
- package/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js +8 -0
- package/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js +4 -0
- package/node_modules/@babel/runtime/helpers/tdz.js +4 -0
- package/node_modules/@babel/runtime/helpers/temporalRef.js +6 -0
- package/node_modules/@babel/runtime/helpers/temporalUndefined.js +2 -0
- package/node_modules/@babel/runtime/helpers/toArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/toConsumableArray.js +8 -0
- package/node_modules/@babel/runtime/helpers/toPrimitive.js +12 -0
- package/node_modules/@babel/runtime/helpers/toPropertyKey.js +7 -0
- package/node_modules/@babel/runtime/helpers/toSetter.js +10 -0
- package/node_modules/@babel/runtime/helpers/typeof.js +10 -0
- package/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +9 -0
- package/node_modules/@babel/runtime/helpers/using.js +12 -0
- package/node_modules/@babel/runtime/helpers/usingCtx.js +59 -0
- package/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js +69 -0
- package/node_modules/@babel/runtime/helpers/wrapNativeSuper.js +27 -0
- package/node_modules/@babel/runtime/helpers/wrapRegExp.js +51 -0
- package/node_modules/@babel/runtime/helpers/writeOnlyError.js +4 -0
- package/node_modules/@babel/runtime/package.json +1056 -0
- package/node_modules/@babel/runtime/regenerator/index.js +15 -0
- package/node_modules/@types/ace/LICENSE +21 -0
- package/node_modules/@types/ace/README.md +15 -0
- package/node_modules/@types/ace/index.d.ts +3135 -0
- package/node_modules/@types/ace/package.json +30 -0
- package/node_modules/@types/body-parser/LICENSE +21 -0
- package/node_modules/@types/body-parser/README.md +15 -0
- package/node_modules/@types/body-parser/index.d.ts +95 -0
- package/node_modules/@types/body-parser/package.json +58 -0
- package/node_modules/@types/connect/LICENSE +21 -0
- package/node_modules/@types/connect/README.md +15 -0
- package/node_modules/@types/connect/index.d.ts +91 -0
- package/node_modules/@types/connect/package.json +32 -0
- package/node_modules/@types/cors/LICENSE +21 -0
- package/node_modules/@types/cors/README.md +75 -0
- package/node_modules/@types/cors/index.d.ts +56 -0
- package/node_modules/@types/cors/package.json +32 -0
- package/node_modules/@types/express/LICENSE +21 -0
- package/node_modules/@types/express/README.md +15 -0
- package/node_modules/@types/express/index.d.ts +128 -0
- package/node_modules/@types/express/package.json +45 -0
- package/node_modules/@types/express-serve-static-core/LICENSE +21 -0
- package/node_modules/@types/express-serve-static-core/README.md +15 -0
- package/node_modules/@types/express-serve-static-core/index.d.ts +1295 -0
- package/node_modules/@types/express-serve-static-core/package.json +50 -0
- package/node_modules/@types/http-errors/LICENSE +21 -0
- package/node_modules/@types/http-errors/README.md +15 -0
- package/node_modules/@types/http-errors/index.d.ts +77 -0
- package/node_modules/@types/http-errors/package.json +30 -0
- package/node_modules/@types/jquery/JQuery.d.ts +13372 -0
- package/node_modules/@types/jquery/JQueryStatic.d.ts +13944 -0
- package/node_modules/@types/jquery/LICENSE +21 -0
- package/node_modules/@types/jquery/README.md +15 -0
- package/node_modules/@types/jquery/dist/jquery.slim.d.ts +3 -0
- package/node_modules/@types/jquery/index.d.ts +7 -0
- package/node_modules/@types/jquery/legacy.d.ts +204 -0
- package/node_modules/@types/jquery/misc.d.ts +7364 -0
- package/node_modules/@types/jquery/package.json +132 -0
- package/node_modules/@types/mime/LICENSE +21 -0
- package/node_modules/@types/mime/Mime.d.ts +10 -0
- package/node_modules/@types/mime/README.md +15 -0
- package/node_modules/@types/mime/index.d.ts +31 -0
- package/node_modules/@types/mime/lite.d.ts +7 -0
- package/node_modules/@types/mime/package.json +30 -0
- package/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@types/node/README.md +15 -0
- package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/node_modules/@types/node/assert.d.ts +1040 -0
- package/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/node_modules/@types/node/buffer.d.ts +2293 -0
- package/node_modules/@types/node/child_process.d.ts +1544 -0
- package/node_modules/@types/node/cluster.d.ts +578 -0
- package/node_modules/@types/node/console.d.ts +452 -0
- package/node_modules/@types/node/constants.d.ts +19 -0
- package/node_modules/@types/node/crypto.d.ts +4451 -0
- package/node_modules/@types/node/dgram.d.ts +596 -0
- package/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/node_modules/@types/node/dns.d.ts +865 -0
- package/node_modules/@types/node/dom-events.d.ts +124 -0
- package/node_modules/@types/node/domain.d.ts +170 -0
- package/node_modules/@types/node/events.d.ts +931 -0
- package/node_modules/@types/node/fs/promises.d.ts +1264 -0
- package/node_modules/@types/node/fs.d.ts +4390 -0
- package/node_modules/@types/node/globals.d.ts +510 -0
- package/node_modules/@types/node/globals.global.d.ts +1 -0
- package/node_modules/@types/node/http.d.ts +1921 -0
- package/node_modules/@types/node/http2.d.ts +2418 -0
- package/node_modules/@types/node/https.d.ts +550 -0
- package/node_modules/@types/node/index.d.ts +90 -0
- package/node_modules/@types/node/inspector.d.ts +2746 -0
- package/node_modules/@types/node/module.d.ts +301 -0
- package/node_modules/@types/node/net.d.ts +999 -0
- package/node_modules/@types/node/os.d.ts +495 -0
- package/node_modules/@types/node/package.json +217 -0
- package/node_modules/@types/node/path.d.ts +200 -0
- package/node_modules/@types/node/perf_hooks.d.ts +941 -0
- package/node_modules/@types/node/process.d.ts +1913 -0
- package/node_modules/@types/node/punycode.d.ts +117 -0
- package/node_modules/@types/node/querystring.d.ts +153 -0
- package/node_modules/@types/node/readline/promises.d.ts +150 -0
- package/node_modules/@types/node/readline.d.ts +540 -0
- package/node_modules/@types/node/repl.d.ts +430 -0
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/sqlite.d.ts +213 -0
- package/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/node_modules/@types/node/stream/promises.d.ts +83 -0
- package/node_modules/@types/node/stream/web.d.ts +367 -0
- package/node_modules/@types/node/stream.d.ts +1707 -0
- package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/node_modules/@types/node/test.d.ts +2006 -0
- package/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/node_modules/@types/node/timers.d.ts +240 -0
- package/node_modules/@types/node/tls.d.ts +1220 -0
- package/node_modules/@types/node/trace_events.d.ts +197 -0
- package/node_modules/@types/node/tty.d.ts +208 -0
- package/node_modules/@types/node/url.d.ts +969 -0
- package/node_modules/@types/node/util.d.ts +2298 -0
- package/node_modules/@types/node/v8.d.ts +808 -0
- package/node_modules/@types/node/vm.d.ts +922 -0
- package/node_modules/@types/node/wasi.d.ts +181 -0
- package/node_modules/@types/node/worker_threads.d.ts +712 -0
- package/node_modules/@types/node/zlib.d.ts +539 -0
- package/node_modules/@types/node-red/LICENSE +21 -0
- package/node_modules/@types/node-red/README.md +15 -0
- package/node_modules/@types/node-red/index.d.ts +241 -0
- package/node_modules/@types/node-red/package.json +52 -0
- package/node_modules/@types/node-red__editor-api/LICENSE +21 -0
- package/node_modules/@types/node-red__editor-api/README.md +65 -0
- package/node_modules/@types/node-red__editor-api/index.d.ts +46 -0
- package/node_modules/@types/node-red__editor-api/package.json +33 -0
- package/node_modules/@types/node-red__editor-client/LICENSE +21 -0
- package/node_modules/@types/node-red__editor-client/README.md +15 -0
- package/node_modules/@types/node-red__editor-client/index.d.ts +1738 -0
- package/node_modules/@types/node-red__editor-client/package.json +36 -0
- package/node_modules/@types/node-red__registry/LICENSE +21 -0
- package/node_modules/@types/node-red__registry/README.md +15 -0
- package/node_modules/@types/node-red__registry/index.d.ts +452 -0
- package/node_modules/@types/node-red__registry/package.json +34 -0
- package/node_modules/@types/node-red__runtime/LICENSE +21 -0
- package/node_modules/@types/node-red__runtime/README.md +15 -0
- package/node_modules/@types/node-red__runtime/index.d.ts +1458 -0
- package/node_modules/@types/node-red__runtime/package.json +36 -0
- package/node_modules/@types/node-red__util/LICENSE +21 -0
- package/node_modules/@types/node-red__util/README.md +15 -0
- package/node_modules/@types/node-red__util/index.d.ts +557 -0
- package/node_modules/@types/node-red__util/package.json +34 -0
- package/node_modules/@types/passport/LICENSE +21 -0
- package/node_modules/@types/passport/README.md +15 -0
- package/node_modules/@types/passport/index.d.ts +921 -0
- package/node_modules/@types/passport/package.json +57 -0
- package/node_modules/@types/qs/LICENSE +21 -0
- package/node_modules/@types/qs/README.md +15 -0
- package/node_modules/@types/qs/index.d.ts +80 -0
- package/node_modules/@types/qs/package.json +65 -0
- package/node_modules/@types/range-parser/LICENSE +21 -0
- package/node_modules/@types/range-parser/README.md +53 -0
- package/node_modules/@types/range-parser/index.d.ts +34 -0
- package/node_modules/@types/range-parser/package.json +25 -0
- package/node_modules/@types/readable-stream/LICENSE +21 -0
- package/node_modules/@types/readable-stream/README.md +15 -0
- package/node_modules/@types/readable-stream/index.d.ts +677 -0
- package/node_modules/@types/readable-stream/package.json +38 -0
- package/node_modules/@types/send/LICENSE +21 -0
- package/node_modules/@types/send/README.md +15 -0
- package/node_modules/@types/send/index.d.ts +225 -0
- package/node_modules/@types/send/package.json +33 -0
- package/node_modules/@types/serve-static/LICENSE +21 -0
- package/node_modules/@types/serve-static/README.md +15 -0
- package/node_modules/@types/serve-static/index.d.ts +107 -0
- package/node_modules/@types/serve-static/package.json +39 -0
- package/node_modules/@types/sizzle/LICENSE +21 -0
- package/node_modules/@types/sizzle/README.md +15 -0
- package/node_modules/@types/sizzle/index.d.ts +91 -0
- package/node_modules/@types/sizzle/package.json +25 -0
- package/node_modules/@types/ws/LICENSE +21 -0
- package/node_modules/@types/ws/README.md +15 -0
- package/node_modules/@types/ws/index.d.mts +21 -0
- package/node_modules/@types/ws/index.d.ts +401 -0
- package/node_modules/@types/ws/package.json +71 -0
- package/node_modules/abort-controller/LICENSE +21 -0
- package/node_modules/abort-controller/README.md +98 -0
- package/node_modules/abort-controller/browser.js +13 -0
- package/node_modules/abort-controller/browser.mjs +11 -0
- package/node_modules/abort-controller/dist/abort-controller.d.ts +43 -0
- package/node_modules/abort-controller/dist/abort-controller.js +127 -0
- package/node_modules/abort-controller/dist/abort-controller.js.map +1 -0
- package/node_modules/abort-controller/dist/abort-controller.mjs +118 -0
- package/node_modules/abort-controller/dist/abort-controller.mjs.map +1 -0
- package/node_modules/abort-controller/dist/abort-controller.umd.js +5 -0
- package/node_modules/abort-controller/dist/abort-controller.umd.js.map +1 -0
- package/node_modules/abort-controller/package.json +97 -0
- package/node_modules/abort-controller/polyfill.js +21 -0
- package/node_modules/abort-controller/polyfill.mjs +19 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bl/.github/dependabot.yml +16 -0
- package/node_modules/bl/.github/workflows/test-and-release.yml +61 -0
- package/node_modules/bl/BufferList.d.ts +418 -0
- package/node_modules/bl/BufferList.js +400 -0
- package/node_modules/bl/CHANGELOG.md +142 -0
- package/node_modules/bl/LICENSE.md +13 -0
- package/node_modules/bl/README.md +247 -0
- package/node_modules/bl/bl.js +84 -0
- package/node_modules/bl/index.d.ts +88 -0
- package/node_modules/bl/package.json +123 -0
- package/node_modules/bl/test/convert.js +21 -0
- package/node_modules/bl/test/indexOf.js +492 -0
- package/node_modules/bl/test/isBufferList.js +32 -0
- package/node_modules/bl/test/test.js +948 -0
- package/node_modules/buffer/AUTHORS.md +73 -0
- package/node_modules/buffer/LICENSE +21 -0
- package/node_modules/buffer/README.md +410 -0
- package/node_modules/buffer/index.d.ts +194 -0
- package/node_modules/buffer/index.js +2106 -0
- package/node_modules/buffer/package.json +93 -0
- package/node_modules/buffer-from/LICENSE +21 -0
- package/node_modules/buffer-from/index.js +72 -0
- package/node_modules/buffer-from/package.json +19 -0
- package/node_modules/buffer-from/readme.md +69 -0
- package/node_modules/commist/.github/workflows/ci.yml +27 -0
- package/node_modules/commist/LICENSE +21 -0
- package/node_modules/commist/README.md +113 -0
- package/node_modules/commist/example.js +26 -0
- package/node_modules/commist/index.js +155 -0
- package/node_modules/commist/leven.js +91 -0
- package/node_modules/commist/package.json +28 -0
- package/node_modules/commist/test.js +368 -0
- package/node_modules/concat-stream/LICENSE +24 -0
- package/node_modules/concat-stream/index.js +144 -0
- package/node_modules/concat-stream/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/concat-stream/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/concat-stream/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/concat-stream/node_modules/readable-stream/README.md +106 -0
- package/node_modules/concat-stream/node_modules/readable-stream/errors-browser.js +127 -0
- package/node_modules/concat-stream/node_modules/readable-stream/errors.js +116 -0
- package/node_modules/concat-stream/node_modules/readable-stream/experimentalWarning.js +17 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +126 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +37 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +1027 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +190 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +641 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/async_iterator.js +180 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/buffer_list.js +183 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/destroy.js +96 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +86 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from-browser.js +3 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/from.js +52 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/pipeline.js +86 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/state.js +22 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/concat-stream/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/concat-stream/node_modules/readable-stream/package.json +68 -0
- package/node_modules/concat-stream/node_modules/readable-stream/readable-browser.js +9 -0
- package/node_modules/concat-stream/node_modules/readable-stream/readable.js +16 -0
- package/node_modules/concat-stream/package.json +55 -0
- package/node_modules/concat-stream/readme.md +102 -0
- package/node_modules/debug/LICENSE +20 -0
- package/node_modules/debug/README.md +481 -0
- package/node_modules/debug/package.json +60 -0
- package/node_modules/debug/src/browser.js +271 -0
- package/node_modules/debug/src/common.js +274 -0
- package/node_modules/debug/src/index.js +10 -0
- package/node_modules/debug/src/node.js +263 -0
- package/node_modules/event-target-shim/LICENSE +22 -0
- package/node_modules/event-target-shim/README.md +293 -0
- package/node_modules/event-target-shim/dist/event-target-shim.js +871 -0
- package/node_modules/event-target-shim/dist/event-target-shim.js.map +1 -0
- package/node_modules/event-target-shim/dist/event-target-shim.mjs +862 -0
- package/node_modules/event-target-shim/dist/event-target-shim.mjs.map +1 -0
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js +6 -0
- package/node_modules/event-target-shim/dist/event-target-shim.umd.js.map +1 -0
- package/node_modules/event-target-shim/index.d.ts +399 -0
- package/node_modules/event-target-shim/package.json +82 -0
- package/node_modules/events/.airtap.yml +15 -0
- package/node_modules/events/.github/FUNDING.yml +12 -0
- package/node_modules/events/.travis.yml +18 -0
- package/node_modules/events/History.md +118 -0
- package/node_modules/events/LICENSE +22 -0
- package/node_modules/events/Readme.md +50 -0
- package/node_modules/events/events.js +497 -0
- package/node_modules/events/package.json +37 -0
- package/node_modules/events/security.md +10 -0
- package/node_modules/events/tests/add-listeners.js +111 -0
- package/node_modules/events/tests/check-listener-leaks.js +101 -0
- package/node_modules/events/tests/common.js +104 -0
- package/node_modules/events/tests/errors.js +13 -0
- package/node_modules/events/tests/events-list.js +28 -0
- package/node_modules/events/tests/events-once.js +234 -0
- package/node_modules/events/tests/index.js +64 -0
- package/node_modules/events/tests/legacy-compat.js +16 -0
- package/node_modules/events/tests/listener-count.js +37 -0
- package/node_modules/events/tests/listeners-side-effects.js +56 -0
- package/node_modules/events/tests/listeners.js +168 -0
- package/node_modules/events/tests/max-listeners.js +47 -0
- package/node_modules/events/tests/method-names.js +35 -0
- package/node_modules/events/tests/modify-in-emit.js +90 -0
- package/node_modules/events/tests/num-args.js +60 -0
- package/node_modules/events/tests/once.js +83 -0
- package/node_modules/events/tests/prepend.js +31 -0
- package/node_modules/events/tests/remove-all-listeners.js +133 -0
- package/node_modules/events/tests/remove-listeners.js +212 -0
- package/node_modules/events/tests/set-max-listeners-side-effects.js +31 -0
- package/node_modules/events/tests/special-event-names.js +45 -0
- package/node_modules/events/tests/subclass.js +66 -0
- package/node_modules/events/tests/symbols.js +25 -0
- package/node_modules/fast-unique-numbers/LICENSE +21 -0
- package/node_modules/fast-unique-numbers/README.md +51 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.d.ts +3 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js +8 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/cache.d.ts +3 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/cache.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/cache.js +7 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/cache.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.d.ts +3 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js +46 -0
- package/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/module.d.ts +5 -0
- package/node_modules/fast-unique-numbers/build/es2019/module.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/module.js +14 -0
- package/node_modules/fast-unique-numbers/build/es2019/module.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.d.ts +4 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-factory.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.d.ts +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/add-unique-number-function.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.d.ts +3 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-factory.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.d.ts +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/cache-function.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.d.ts +4 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-factory.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.d.ts +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.js +2 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/generate-unique-number-function.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/index.d.ts +7 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/index.d.ts.map +1 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/index.js +7 -0
- package/node_modules/fast-unique-numbers/build/es2019/types/index.js.map +1 -0
- package/node_modules/fast-unique-numbers/build/es5/bundle.js +76 -0
- package/node_modules/fast-unique-numbers/build/node/factories/add-unique-number.js +14 -0
- package/node_modules/fast-unique-numbers/build/node/factories/cache.js +13 -0
- package/node_modules/fast-unique-numbers/build/node/factories/generate-unique-number.js +52 -0
- package/node_modules/fast-unique-numbers/build/node/module.js +34 -0
- package/node_modules/fast-unique-numbers/build/node/types/add-unique-number-factory.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/add-unique-number-function.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/cache-factory.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/cache-function.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/generate-unique-number-factory.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/generate-unique-number-function.js +5 -0
- package/node_modules/fast-unique-numbers/build/node/types/index.js +71 -0
- package/node_modules/fast-unique-numbers/package.json +94 -0
- package/node_modules/fast-unique-numbers/src/factories/add-unique-number.ts +11 -0
- package/node_modules/fast-unique-numbers/src/factories/cache.ts +9 -0
- package/node_modules/fast-unique-numbers/src/factories/generate-unique-number.ts +55 -0
- package/node_modules/fast-unique-numbers/src/module.ts +17 -0
- package/node_modules/fast-unique-numbers/src/tsconfig.json +6 -0
- package/node_modules/fast-unique-numbers/src/types/add-unique-number-factory.ts +4 -0
- package/node_modules/fast-unique-numbers/src/types/add-unique-number-function.ts +1 -0
- package/node_modules/fast-unique-numbers/src/types/cache-factory.ts +3 -0
- package/node_modules/fast-unique-numbers/src/types/cache-function.ts +1 -0
- package/node_modules/fast-unique-numbers/src/types/generate-unique-number-factory.ts +7 -0
- package/node_modules/fast-unique-numbers/src/types/generate-unique-number-function.ts +1 -0
- package/node_modules/fast-unique-numbers/src/types/index.ts +6 -0
- package/node_modules/help-me/.github/workflows/ci.yml +28 -0
- package/node_modules/help-me/LICENSE +22 -0
- package/node_modules/help-me/README.md +66 -0
- package/node_modules/help-me/doc/hello.txt +1 -0
- package/node_modules/help-me/doc/help.txt +5 -0
- package/node_modules/help-me/example.js +18 -0
- package/node_modules/help-me/fixture/basic/hello.txt +1 -0
- package/node_modules/help-me/fixture/basic/help.txt +1 -0
- package/node_modules/help-me/fixture/dir/a/b.txt +0 -0
- package/node_modules/help-me/fixture/no-ext/hello +1 -0
- package/node_modules/help-me/fixture/sameprefix/hello world.txt +1 -0
- package/node_modules/help-me/fixture/sameprefix/hello.txt +1 -0
- package/node_modules/help-me/fixture/shortnames/abcde fghi lmno.txt +1 -0
- package/node_modules/help-me/fixture/shortnames/abcde hello.txt +1 -0
- package/node_modules/help-me/fixture/shortnames/hello world.txt +1 -0
- package/node_modules/help-me/help-me.js +134 -0
- package/node_modules/help-me/package.json +36 -0
- package/node_modules/help-me/test.js +316 -0
- package/node_modules/ieee754/LICENSE +11 -0
- package/node_modules/ieee754/README.md +51 -0
- package/node_modules/ieee754/index.d.ts +10 -0
- package/node_modules/ieee754/index.js +85 -0
- package/node_modules/ieee754/package.json +52 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/js-sdsl/CHANGELOG.md +211 -0
- package/node_modules/js-sdsl/LICENSE +21 -0
- package/node_modules/js-sdsl/README.md +296 -0
- package/node_modules/js-sdsl/README.zh-CN.md +298 -0
- package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.d.ts +206 -0
- package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js +40 -0
- package/node_modules/js-sdsl/dist/cjs/container/ContainerBase/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.d.ts +29 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js +188 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.d.ts +49 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js +125 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashMap.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.d.ts +39 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js +94 -0
- package/node_modules/js-sdsl/dist/cjs/container/HashContainer/HashSet.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.d.ts +79 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js +118 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/PriorityQueue.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.d.ts +22 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js +52 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Queue.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.d.ts +22 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js +42 -0
- package/node_modules/js-sdsl/dist/cjs/container/OtherContainer/Stack.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.d.ts +9 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js +58 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/RandomIterator.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.d.ts +67 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js +16 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.d.ts +58 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js +338 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Deque.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.d.ts +58 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js +330 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/LinkList.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.d.ts +40 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js +158 -0
- package/node_modules/js-sdsl/dist/cjs/container/SequentialContainer/Vector.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.d.ts +18 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js +80 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeIterator.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.d.ts +47 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js +115 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/TreeNode.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.d.ts +58 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js +514 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.d.ts +62 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js +127 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedMap.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.d.ts +54 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js +107 -0
- package/node_modules/js-sdsl/dist/cjs/container/TreeContainer/OrderedSet.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/index.d.ts +21 -0
- package/node_modules/js-sdsl/dist/cjs/index.js +102 -0
- package/node_modules/js-sdsl/dist/cjs/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/utils/checkObject.d.ts +1 -0
- package/node_modules/js-sdsl/dist/cjs/utils/checkObject.js +13 -0
- package/node_modules/js-sdsl/dist/cjs/utils/checkObject.js.map +1 -0
- package/node_modules/js-sdsl/dist/cjs/utils/throwError.d.ts +1 -0
- package/node_modules/js-sdsl/dist/cjs/utils/throwError.js +12 -0
- package/node_modules/js-sdsl/dist/cjs/utils/throwError.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.d.ts +206 -0
- package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js +68 -0
- package/node_modules/js-sdsl/dist/esm/container/ContainerBase/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.d.ts +29 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js +201 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.d.ts +49 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js +248 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashMap.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.d.ts +39 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js +223 -0
- package/node_modules/js-sdsl/dist/esm/container/HashContainer/HashSet.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.d.ts +79 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js +171 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/PriorityQueue.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.d.ts +22 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js +69 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Queue.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.d.ts +22 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js +59 -0
- package/node_modules/js-sdsl/dist/esm/container/OtherContainer/Stack.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.d.ts +9 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js +78 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/RandomIterator.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.d.ts +67 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js +33 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.d.ts +58 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js +498 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Deque.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.d.ts +58 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js +456 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/LinkList.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.d.ts +40 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js +323 -0
- package/node_modules/js-sdsl/dist/esm/container/SequentialContainer/Vector.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.d.ts +18 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js +98 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeIterator.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.d.ts +47 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js +132 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/TreeNode.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.d.ts +58 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js +600 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/Base/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.d.ts +62 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js +265 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedMap.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.d.ts +54 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js +245 -0
- package/node_modules/js-sdsl/dist/esm/container/TreeContainer/OrderedSet.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/index.d.ts +21 -0
- package/node_modules/js-sdsl/dist/esm/index.js +20 -0
- package/node_modules/js-sdsl/dist/esm/index.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/utils/checkObject.d.ts +1 -0
- package/node_modules/js-sdsl/dist/esm/utils/checkObject.js +5 -0
- package/node_modules/js-sdsl/dist/esm/utils/checkObject.js.map +1 -0
- package/node_modules/js-sdsl/dist/esm/utils/throwError.d.ts +1 -0
- package/node_modules/js-sdsl/dist/esm/utils/throwError.js +4 -0
- package/node_modules/js-sdsl/dist/esm/utils/throwError.js.map +1 -0
- package/node_modules/js-sdsl/dist/umd/js-sdsl.js +3154 -0
- package/node_modules/js-sdsl/dist/umd/js-sdsl.min.js +8 -0
- package/node_modules/js-sdsl/dist/umd/js-sdsl.min.js.map +1 -0
- package/node_modules/js-sdsl/package.json +166 -0
- package/node_modules/jsonata/LICENSE +19 -0
- package/node_modules/jsonata/README.md +70 -0
- package/node_modules/jsonata/jsonata-es5.js +9867 -0
- package/node_modules/jsonata/jsonata-es5.min.js +1 -0
- package/node_modules/jsonata/jsonata.d.ts +53 -0
- package/node_modules/jsonata/jsonata.js +7541 -0
- package/node_modules/jsonata/jsonata.min.js +1 -0
- package/node_modules/jsonata/package.json +62 -0
- package/node_modules/lru-cache/LICENSE +15 -0
- package/node_modules/lru-cache/README.md +331 -0
- package/node_modules/lru-cache/dist/commonjs/index.d.ts +1277 -0
- package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/index.js +1546 -0
- package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/node_modules/lru-cache/dist/esm/index.d.ts +1277 -0
- package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/index.js +1542 -0
- package/node_modules/lru-cache/dist/esm/index.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
- package/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/node_modules/lru-cache/package.json +116 -0
- package/node_modules/minimist/.eslintrc +29 -0
- package/node_modules/minimist/.github/FUNDING.yml +12 -0
- package/node_modules/minimist/.nycrc +14 -0
- package/node_modules/minimist/CHANGELOG.md +298 -0
- package/node_modules/minimist/LICENSE +18 -0
- package/node_modules/minimist/README.md +121 -0
- package/node_modules/minimist/example/parse.js +4 -0
- package/node_modules/minimist/index.js +263 -0
- package/node_modules/minimist/package.json +75 -0
- package/node_modules/minimist/test/all_bool.js +34 -0
- package/node_modules/minimist/test/bool.js +177 -0
- package/node_modules/minimist/test/dash.js +43 -0
- package/node_modules/minimist/test/default_bool.js +37 -0
- package/node_modules/minimist/test/dotted.js +24 -0
- package/node_modules/minimist/test/kv_short.js +32 -0
- package/node_modules/minimist/test/long.js +33 -0
- package/node_modules/minimist/test/num.js +38 -0
- package/node_modules/minimist/test/parse.js +209 -0
- package/node_modules/minimist/test/parse_modified.js +11 -0
- package/node_modules/minimist/test/proto.js +64 -0
- package/node_modules/minimist/test/short.js +69 -0
- package/node_modules/minimist/test/stop_early.js +17 -0
- package/node_modules/minimist/test/unknown.js +104 -0
- package/node_modules/minimist/test/whitespace.js +10 -0
- package/node_modules/mqtt/CONTRIBUTING.md +27 -0
- package/node_modules/mqtt/LICENSE.md +15 -0
- package/node_modules/mqtt/README.md +960 -0
- package/node_modules/mqtt/build/bin/mqtt.d.ts +2 -0
- package/node_modules/mqtt/build/bin/mqtt.js +30 -0
- package/node_modules/mqtt/build/bin/mqtt.js.map +1 -0
- package/node_modules/mqtt/build/bin/pub.d.ts +2 -0
- package/node_modules/mqtt/build/bin/pub.js +147 -0
- package/node_modules/mqtt/build/bin/pub.js.map +1 -0
- package/node_modules/mqtt/build/bin/sub.d.ts +2 -0
- package/node_modules/mqtt/build/bin/sub.js +121 -0
- package/node_modules/mqtt/build/bin/sub.js.map +1 -0
- package/node_modules/mqtt/build/index.d.ts +3 -0
- package/node_modules/mqtt/build/index.js +32 -0
- package/node_modules/mqtt/build/index.js.map +1 -0
- package/node_modules/mqtt/build/lib/BufferedDuplex.d.ts +20 -0
- package/node_modules/mqtt/build/lib/BufferedDuplex.js +78 -0
- package/node_modules/mqtt/build/lib/BufferedDuplex.js.map +1 -0
- package/node_modules/mqtt/build/lib/KeepaliveManager.d.ts +21 -0
- package/node_modules/mqtt/build/lib/KeepaliveManager.js +73 -0
- package/node_modules/mqtt/build/lib/KeepaliveManager.js.map +1 -0
- package/node_modules/mqtt/build/lib/TypedEmitter.d.ts +19 -0
- package/node_modules/mqtt/build/lib/TypedEmitter.js +13 -0
- package/node_modules/mqtt/build/lib/TypedEmitter.js.map +1 -0
- package/node_modules/mqtt/build/lib/client.d.ts +235 -0
- package/node_modules/mqtt/build/lib/client.js +1211 -0
- package/node_modules/mqtt/build/lib/client.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/ali.d.ts +3 -0
- package/node_modules/mqtt/build/lib/connect/ali.js +108 -0
- package/node_modules/mqtt/build/lib/connect/ali.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/index.d.ts +10 -0
- package/node_modules/mqtt/build/lib/connect/index.js +192 -0
- package/node_modules/mqtt/build/lib/connect/index.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/tcp.d.ts +3 -0
- package/node_modules/mqtt/build/lib/connect/tcp.js +18 -0
- package/node_modules/mqtt/build/lib/connect/tcp.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/tls.d.ts +3 -0
- package/node_modules/mqtt/build/lib/connect/tls.js +38 -0
- package/node_modules/mqtt/build/lib/connect/tls.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/ws.d.ts +4 -0
- package/node_modules/mqtt/build/lib/connect/ws.js +217 -0
- package/node_modules/mqtt/build/lib/connect/ws.js.map +1 -0
- package/node_modules/mqtt/build/lib/connect/wx.d.ts +6 -0
- package/node_modules/mqtt/build/lib/connect/wx.js +115 -0
- package/node_modules/mqtt/build/lib/connect/wx.js.map +1 -0
- package/node_modules/mqtt/build/lib/default-message-id-provider.d.ts +16 -0
- package/node_modules/mqtt/build/lib/default-message-id-provider.js +24 -0
- package/node_modules/mqtt/build/lib/default-message-id-provider.js.map +1 -0
- package/node_modules/mqtt/build/lib/get-timer.d.ts +8 -0
- package/node_modules/mqtt/build/lib/get-timer.js +53 -0
- package/node_modules/mqtt/build/lib/get-timer.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/ack.d.ts +48 -0
- package/node_modules/mqtt/build/lib/handlers/ack.js +131 -0
- package/node_modules/mqtt/build/lib/handlers/ack.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/auth.d.ts +3 -0
- package/node_modules/mqtt/build/lib/handlers/auth.js +30 -0
- package/node_modules/mqtt/build/lib/handlers/auth.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/connack.d.ts +3 -0
- package/node_modules/mqtt/build/lib/handlers/connack.js +47 -0
- package/node_modules/mqtt/build/lib/handlers/connack.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/index.d.ts +3 -0
- package/node_modules/mqtt/build/lib/handlers/index.js +68 -0
- package/node_modules/mqtt/build/lib/handlers/index.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/publish.d.ts +3 -0
- package/node_modules/mqtt/build/lib/handlers/publish.js +106 -0
- package/node_modules/mqtt/build/lib/handlers/publish.js.map +1 -0
- package/node_modules/mqtt/build/lib/handlers/pubrel.d.ts +3 -0
- package/node_modules/mqtt/build/lib/handlers/pubrel.js +25 -0
- package/node_modules/mqtt/build/lib/handlers/pubrel.js.map +1 -0
- package/node_modules/mqtt/build/lib/is-browser.d.ts +4 -0
- package/node_modules/mqtt/build/lib/is-browser.js +27 -0
- package/node_modules/mqtt/build/lib/is-browser.js.map +1 -0
- package/node_modules/mqtt/build/lib/shared.d.ts +23 -0
- package/node_modules/mqtt/build/lib/shared.js +41 -0
- package/node_modules/mqtt/build/lib/shared.js.map +1 -0
- package/node_modules/mqtt/build/lib/store.d.ts +24 -0
- package/node_modules/mqtt/build/lib/store.js +80 -0
- package/node_modules/mqtt/build/lib/store.js.map +1 -0
- package/node_modules/mqtt/build/lib/topic-alias-recv.d.ts +9 -0
- package/node_modules/mqtt/build/lib/topic-alias-recv.js +24 -0
- package/node_modules/mqtt/build/lib/topic-alias-recv.js.map +1 -0
- package/node_modules/mqtt/build/lib/topic-alias-send.d.ts +13 -0
- package/node_modules/mqtt/build/lib/topic-alias-send.js +53 -0
- package/node_modules/mqtt/build/lib/topic-alias-send.js.map +1 -0
- package/node_modules/mqtt/build/lib/unique-message-id-provider.d.ts +11 -0
- package/node_modules/mqtt/build/lib/unique-message-id-provider.js +26 -0
- package/node_modules/mqtt/build/lib/unique-message-id-provider.js.map +1 -0
- package/node_modules/mqtt/build/lib/validations.d.ts +2 -0
- package/node_modules/mqtt/build/lib/validations.js +32 -0
- package/node_modules/mqtt/build/lib/validations.js.map +1 -0
- package/node_modules/mqtt/build/mqtt.d.ts +12 -0
- package/node_modules/mqtt/build/mqtt.js +51 -0
- package/node_modules/mqtt/build/mqtt.js.map +1 -0
- package/node_modules/mqtt/build/tsconfig.build.tsbuildinfo +1 -0
- package/node_modules/mqtt/dist/mqtt.esm.js +10 -0
- package/node_modules/mqtt/dist/mqtt.js +21678 -0
- package/node_modules/mqtt/dist/mqtt.min.js +10 -0
- package/node_modules/mqtt/help/help.txt +8 -0
- package/node_modules/mqtt/help/publish.txt +26 -0
- package/node_modules/mqtt/help/subscribe.txt +26 -0
- package/node_modules/mqtt/package.json +171 -0
- package/node_modules/mqtt/src/bin/mqtt.ts +39 -0
- package/node_modules/mqtt/src/bin/pub.ts +174 -0
- package/node_modules/mqtt/src/bin/sub.ts +146 -0
- package/node_modules/mqtt/src/index.ts +4 -0
- package/node_modules/mqtt/src/lib/BufferedDuplex.ts +115 -0
- package/node_modules/mqtt/src/lib/KeepaliveManager.ts +112 -0
- package/node_modules/mqtt/src/lib/TypedEmitter.ts +71 -0
- package/node_modules/mqtt/src/lib/client.ts +2371 -0
- package/node_modules/mqtt/src/lib/connect/ali.ts +127 -0
- package/node_modules/mqtt/src/lib/connect/index.ts +288 -0
- package/node_modules/mqtt/src/lib/connect/tcp.ts +22 -0
- package/node_modules/mqtt/src/lib/connect/tls.ts +54 -0
- package/node_modules/mqtt/src/lib/connect/ws.ts +303 -0
- package/node_modules/mqtt/src/lib/connect/wx.ts +142 -0
- package/node_modules/mqtt/src/lib/default-message-id-provider.ts +99 -0
- package/node_modules/mqtt/src/lib/get-timer.ts +40 -0
- package/node_modules/mqtt/src/lib/handlers/ack.ts +159 -0
- package/node_modules/mqtt/src/lib/handlers/auth.ts +44 -0
- package/node_modules/mqtt/src/lib/handlers/connack.ts +55 -0
- package/node_modules/mqtt/src/lib/handlers/index.ts +74 -0
- package/node_modules/mqtt/src/lib/handlers/publish.ts +183 -0
- package/node_modules/mqtt/src/lib/handlers/pubrel.ts +27 -0
- package/node_modules/mqtt/src/lib/is-browser.ts +46 -0
- package/node_modules/mqtt/src/lib/shared.ts +87 -0
- package/node_modules/mqtt/src/lib/store.ts +166 -0
- package/node_modules/mqtt/src/lib/topic-alias-recv.ts +48 -0
- package/node_modules/mqtt/src/lib/topic-alias-send.ts +96 -0
- package/node_modules/mqtt/src/lib/unique-message-id-provider.ts +64 -0
- package/node_modules/mqtt/src/lib/validations.ts +46 -0
- package/node_modules/mqtt/src/mqtt.ts +28 -0
- package/node_modules/mqtt-packet/.github/workflows/ci.yml +27 -0
- package/node_modules/mqtt-packet/CONTRIBUTING.md +27 -0
- package/node_modules/mqtt-packet/LICENSE.md +13 -0
- package/node_modules/mqtt-packet/README.md +491 -0
- package/node_modules/mqtt-packet/benchmarks/generate.js +26 -0
- package/node_modules/mqtt-packet/benchmarks/generateNet.js +50 -0
- package/node_modules/mqtt-packet/benchmarks/parse.js +19 -0
- package/node_modules/mqtt-packet/benchmarks/writeToStream.js +48 -0
- package/node_modules/mqtt-packet/constants.js +291 -0
- package/node_modules/mqtt-packet/generate.js +57 -0
- package/node_modules/mqtt-packet/mqtt.js +3 -0
- package/node_modules/mqtt-packet/numbers.js +59 -0
- package/node_modules/mqtt-packet/package.json +48 -0
- package/node_modules/mqtt-packet/packet.js +13 -0
- package/node_modules/mqtt-packet/parser.js +809 -0
- package/node_modules/mqtt-packet/test.js +3177 -0
- package/node_modules/mqtt-packet/testRandom.js +86 -0
- package/node_modules/mqtt-packet/types/index.d.ts +257 -0
- package/node_modules/mqtt-packet/writeToStream.js +1127 -0
- package/node_modules/ms/index.js +162 -0
- package/node_modules/ms/license.md +21 -0
- package/node_modules/ms/package.json +37 -0
- package/node_modules/ms/readme.md +60 -0
- package/node_modules/number-allocator/.github/workflows/nodejs.yml +33 -0
- package/node_modules/number-allocator/CHANGELOG.md +47 -0
- package/node_modules/number-allocator/LICENSE +21 -0
- package/node_modules/number-allocator/README.md +203 -0
- package/node_modules/number-allocator/index.js +7 -0
- package/node_modules/number-allocator/karma.conf.js +63 -0
- package/node_modules/number-allocator/lib/number-allocator.js +249 -0
- package/node_modules/number-allocator/package.json +69 -0
- package/node_modules/number-allocator/test/test.js +337 -0
- package/node_modules/number-allocator/test/typescript/test.ts +24 -0
- package/node_modules/number-allocator/test/typescript/tsconfig.json +14 -0
- package/node_modules/number-allocator/types/index.d.ts +1 -0
- package/node_modules/number-allocator/types/lib/number-allocator.d.ts +65 -0
- package/node_modules/process/.eslintrc +21 -0
- package/node_modules/process/LICENSE +22 -0
- package/node_modules/process/README.md +26 -0
- package/node_modules/process/browser.js +184 -0
- package/node_modules/process/index.js +2 -0
- package/node_modules/process/package.json +27 -0
- package/node_modules/process/test.js +199 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +116 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +4 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +4 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +4 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +4 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +4 -0
- package/node_modules/readable-stream/lib/internal/streams/add-abort-signal.js +52 -0
- package/node_modules/readable-stream/lib/internal/streams/buffer_list.js +157 -0
- package/node_modules/readable-stream/lib/internal/streams/compose.js +194 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +290 -0
- package/node_modules/readable-stream/lib/internal/streams/duplex.js +143 -0
- package/node_modules/readable-stream/lib/internal/streams/duplexify.js +378 -0
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +284 -0
- package/node_modules/readable-stream/lib/internal/streams/from.js +98 -0
- package/node_modules/readable-stream/lib/internal/streams/lazy_transform.js +51 -0
- package/node_modules/readable-stream/lib/internal/streams/legacy.js +89 -0
- package/node_modules/readable-stream/lib/internal/streams/operators.js +457 -0
- package/node_modules/readable-stream/lib/internal/streams/passthrough.js +39 -0
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +471 -0
- package/node_modules/readable-stream/lib/internal/streams/readable.js +1288 -0
- package/node_modules/readable-stream/lib/internal/streams/state.js +39 -0
- package/node_modules/readable-stream/lib/internal/streams/transform.js +180 -0
- package/node_modules/readable-stream/lib/internal/streams/utils.js +329 -0
- package/node_modules/readable-stream/lib/internal/streams/writable.js +817 -0
- package/node_modules/readable-stream/lib/internal/validators.js +530 -0
- package/node_modules/readable-stream/lib/ours/browser.js +35 -0
- package/node_modules/readable-stream/lib/ours/errors.js +341 -0
- package/node_modules/readable-stream/lib/ours/index.js +65 -0
- package/node_modules/readable-stream/lib/ours/primordials.js +107 -0
- package/node_modules/readable-stream/lib/ours/util.js +200 -0
- package/node_modules/readable-stream/lib/stream/promises.js +43 -0
- package/node_modules/readable-stream/lib/stream.js +141 -0
- package/node_modules/readable-stream/package.json +86 -0
- package/node_modules/regenerator-runtime/LICENSE +21 -0
- package/node_modules/regenerator-runtime/README.md +31 -0
- package/node_modules/regenerator-runtime/package.json +19 -0
- package/node_modules/regenerator-runtime/path.js +11 -0
- package/node_modules/regenerator-runtime/runtime.js +761 -0
- package/node_modules/reinterval/.npmignore +27 -0
- package/node_modules/reinterval/.travis.yml +20 -0
- package/node_modules/reinterval/LICENSE +22 -0
- package/node_modules/reinterval/README.md +60 -0
- package/node_modules/reinterval/index.js +57 -0
- package/node_modules/reinterval/package.json +32 -0
- package/node_modules/reinterval/tests/test.js +52 -0
- package/node_modules/rfdc/.github/workflows/ci.yml +21 -0
- package/node_modules/rfdc/LICENSE +15 -0
- package/node_modules/rfdc/default.js +3 -0
- package/node_modules/rfdc/index.d.ts +13 -0
- package/node_modules/rfdc/index.js +198 -0
- package/node_modules/rfdc/index.test-d.ts +13 -0
- package/node_modules/rfdc/package.json +73 -0
- package/node_modules/rfdc/readme.md +181 -0
- package/node_modules/rfdc/test/index.js +306 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/split2/LICENSE +13 -0
- package/node_modules/split2/README.md +85 -0
- package/node_modules/split2/bench.js +27 -0
- package/node_modules/split2/index.js +141 -0
- package/node_modules/split2/package.json +39 -0
- package/node_modules/split2/test.js +409 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/string_decoder/node_modules/safe-buffer/package.json +51 -0
- package/node_modules/string_decoder/package.json +34 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/tslib/README.md +164 -0
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +37 -0
- package/node_modules/tslib/modules/index.js +68 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.d.ts +453 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +379 -0
- package/node_modules/tslib/tslib.es6.mjs +378 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +429 -0
- package/node_modules/typedarray/.travis.yml +4 -0
- package/node_modules/typedarray/LICENSE +35 -0
- package/node_modules/typedarray/example/tarray.js +4 -0
- package/node_modules/typedarray/index.js +630 -0
- package/node_modules/typedarray/package.json +55 -0
- package/node_modules/typedarray/readme.markdown +61 -0
- package/node_modules/typedarray/test/server/undef_globals.js +19 -0
- package/node_modules/typedarray/test/tarray.js +10 -0
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/README.md +6 -0
- package/node_modules/undici-types/agent.d.ts +31 -0
- package/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/undici-types/client.d.ts +108 -0
- package/node_modules/undici-types/connector.d.ts +34 -0
- package/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/undici-types/cookies.d.ts +28 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/node_modules/undici-types/dispatcher.d.ts +255 -0
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/undici-types/errors.d.ts +149 -0
- package/node_modules/undici-types/eventsource.d.ts +63 -0
- package/node_modules/undici-types/fetch.d.ts +209 -0
- package/node_modules/undici-types/file.d.ts +39 -0
- package/node_modules/undici-types/filereader.d.ts +54 -0
- package/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/undici-types/handlers.d.ts +15 -0
- package/node_modules/undici-types/header.d.ts +4 -0
- package/node_modules/undici-types/index.d.ts +71 -0
- package/node_modules/undici-types/interceptors.d.ts +15 -0
- package/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/node_modules/undici-types/mock-client.d.ts +25 -0
- package/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/node_modules/undici-types/package.json +55 -0
- package/node_modules/undici-types/patch.d.ts +71 -0
- package/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/node_modules/undici-types/readable.d.ts +60 -0
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/webidl.d.ts +222 -0
- package/node_modules/undici-types/websocket.d.ts +152 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/worker-timers/LICENSE +21 -0
- package/node_modules/worker-timers/README.md +79 -0
- package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.d.ts +2 -0
- package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.d.ts.map +1 -0
- package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.js +15 -0
- package/node_modules/worker-timers/build/es2019/factories/load-or-return-broker.js.map +1 -0
- package/node_modules/worker-timers/build/es2019/module.d.ts +6 -0
- package/node_modules/worker-timers/build/es2019/module.d.ts.map +1 -0
- package/node_modules/worker-timers/build/es2019/module.js +9 -0
- package/node_modules/worker-timers/build/es2019/module.js.map +1 -0
- package/node_modules/worker-timers/build/es2019/worker/worker.d.ts +2 -0
- package/node_modules/worker-timers/build/es2019/worker/worker.d.ts.map +1 -0
- package/node_modules/worker-timers/build/es2019/worker/worker.js +3 -0
- package/node_modules/worker-timers/build/es2019/worker/worker.js.map +1 -0
- package/node_modules/worker-timers/build/es5/bundle.js +50 -0
- package/node_modules/worker-timers/package.json +106 -0
- package/node_modules/worker-timers/src/factories/load-or-return-broker.ts +19 -0
- package/node_modules/worker-timers/src/module.ts +13 -0
- package/node_modules/worker-timers/src/tsconfig.json +6 -0
- package/node_modules/worker-timers/src/worker/worker.ts +2 -0
- package/node_modules/worker-timers-broker/LICENSE +21 -0
- package/node_modules/worker-timers-broker/README.md +5 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.d.ts +3 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.d.ts.map +1 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.js +4 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/call-notification.js.map +1 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.d.ts +3 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.d.ts.map +1 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.js +4 -0
- package/node_modules/worker-timers-broker/build/es2019/guards/clear-response.js.map +1 -0
- package/node_modules/worker-timers-broker/build/es2019/module.d.ts +7 -0
- package/node_modules/worker-timers-broker/build/es2019/module.d.ts.map +1 -0
- package/node_modules/worker-timers-broker/build/es2019/module.js +142 -0
- package/node_modules/worker-timers-broker/build/es2019/module.js.map +1 -0
- package/node_modules/worker-timers-broker/build/es5/bundle.js +162 -0
- package/node_modules/worker-timers-broker/package.json +84 -0
- package/node_modules/worker-timers-broker/src/guards/call-notification.ts +5 -0
- package/node_modules/worker-timers-broker/src/guards/clear-response.ts +5 -0
- package/node_modules/worker-timers-broker/src/module.ts +173 -0
- package/node_modules/worker-timers-broker/src/tsconfig.json +6 -0
- package/node_modules/worker-timers-worker/LICENSE +21 -0
- package/node_modules/worker-timers-worker/README.md +5 -0
- package/node_modules/worker-timers-worker/build/es2019/helpers/timer.d.ts +5 -0
- package/node_modules/worker-timers-worker/build/es2019/helpers/timer.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/helpers/timer.js +50 -0
- package/node_modules/worker-timers-worker/build/es2019/helpers/timer.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.d.ts +5 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/broker-event.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.d.ts +10 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/call-notification.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.d.ts +10 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-request.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.d.ts +5 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/clear-response.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.d.ts +8 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-notification.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.d.ts +8 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/error-response.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/index.d.ts +9 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/index.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/index.js +9 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/index.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.d.ts +12 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/set-notification.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.d.ts +5 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/interfaces/worker-event.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/module.d.ts +3 -0
- package/node_modules/worker-timers-worker/build/es2019/module.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/module.js +50 -0
- package/node_modules/worker-timers-worker/build/es2019/module.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/broker-message.d.ts +3 -0
- package/node_modules/worker-timers-worker/build/es2019/types/broker-message.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/broker-message.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/types/broker-message.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/index.d.ts +4 -0
- package/node_modules/worker-timers-worker/build/es2019/types/index.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/index.js +4 -0
- package/node_modules/worker-timers-worker/build/es2019/types/index.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/timer-type.d.ts +2 -0
- package/node_modules/worker-timers-worker/build/es2019/types/timer-type.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/timer-type.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/types/timer-type.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/worker-message.d.ts +3 -0
- package/node_modules/worker-timers-worker/build/es2019/types/worker-message.d.ts.map +1 -0
- package/node_modules/worker-timers-worker/build/es2019/types/worker-message.js +2 -0
- package/node_modules/worker-timers-worker/build/es2019/types/worker-message.js.map +1 -0
- package/node_modules/worker-timers-worker/build/es5/bundle.js +117 -0
- package/node_modules/worker-timers-worker/package.json +91 -0
- package/node_modules/worker-timers-worker/src/helpers/timer.ts +68 -0
- package/node_modules/worker-timers-worker/src/interfaces/broker-event.ts +5 -0
- package/node_modules/worker-timers-worker/src/interfaces/call-notification.ts +13 -0
- package/node_modules/worker-timers-worker/src/interfaces/clear-request.ts +13 -0
- package/node_modules/worker-timers-worker/src/interfaces/clear-response.ts +5 -0
- package/node_modules/worker-timers-worker/src/interfaces/error-notification.ts +9 -0
- package/node_modules/worker-timers-worker/src/interfaces/error-response.ts +9 -0
- package/node_modules/worker-timers-worker/src/interfaces/index.ts +8 -0
- package/node_modules/worker-timers-worker/src/interfaces/set-notification.ts +17 -0
- package/node_modules/worker-timers-worker/src/interfaces/worker-event.ts +5 -0
- package/node_modules/worker-timers-worker/src/module.ts +54 -0
- package/node_modules/worker-timers-worker/src/tsconfig.json +6 -0
- package/node_modules/worker-timers-worker/src/types/broker-message.ts +3 -0
- package/node_modules/worker-timers-worker/src/types/index.ts +3 -0
- package/node_modules/worker-timers-worker/src/types/timer-type.ts +1 -0
- package/node_modules/worker-timers-worker/src/types/worker-message.ts +3 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +13 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +18 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +514 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +602 -0
- package/node_modules/ws/lib/stream.js +159 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +540 -0
- package/node_modules/ws/lib/websocket.js +1388 -0
- package/node_modules/ws/package.json +69 -0
- package/node_modules/ws/wrapper.mjs +8 -0
- package/package.json +51 -0
|
@@ -0,0 +1,1546 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module LRUCache
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LRUCache = void 0;
|
|
7
|
+
const perf = typeof performance === 'object' &&
|
|
8
|
+
performance &&
|
|
9
|
+
typeof performance.now === 'function'
|
|
10
|
+
? performance
|
|
11
|
+
: Date;
|
|
12
|
+
const warned = new Set();
|
|
13
|
+
/* c8 ignore start */
|
|
14
|
+
const PROCESS = (typeof process === 'object' && !!process ? process : {});
|
|
15
|
+
/* c8 ignore start */
|
|
16
|
+
const emitWarning = (msg, type, code, fn) => {
|
|
17
|
+
typeof PROCESS.emitWarning === 'function'
|
|
18
|
+
? PROCESS.emitWarning(msg, type, code, fn)
|
|
19
|
+
: console.error(`[${code}] ${type}: ${msg}`);
|
|
20
|
+
};
|
|
21
|
+
let AC = globalThis.AbortController;
|
|
22
|
+
let AS = globalThis.AbortSignal;
|
|
23
|
+
/* c8 ignore start */
|
|
24
|
+
if (typeof AC === 'undefined') {
|
|
25
|
+
//@ts-ignore
|
|
26
|
+
AS = class AbortSignal {
|
|
27
|
+
onabort;
|
|
28
|
+
_onabort = [];
|
|
29
|
+
reason;
|
|
30
|
+
aborted = false;
|
|
31
|
+
addEventListener(_, fn) {
|
|
32
|
+
this._onabort.push(fn);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
//@ts-ignore
|
|
36
|
+
AC = class AbortController {
|
|
37
|
+
constructor() {
|
|
38
|
+
warnACPolyfill();
|
|
39
|
+
}
|
|
40
|
+
signal = new AS();
|
|
41
|
+
abort(reason) {
|
|
42
|
+
if (this.signal.aborted)
|
|
43
|
+
return;
|
|
44
|
+
//@ts-ignore
|
|
45
|
+
this.signal.reason = reason;
|
|
46
|
+
//@ts-ignore
|
|
47
|
+
this.signal.aborted = true;
|
|
48
|
+
//@ts-ignore
|
|
49
|
+
for (const fn of this.signal._onabort) {
|
|
50
|
+
fn(reason);
|
|
51
|
+
}
|
|
52
|
+
this.signal.onabort?.(reason);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
|
|
56
|
+
const warnACPolyfill = () => {
|
|
57
|
+
if (!printACPolyfillWarning)
|
|
58
|
+
return;
|
|
59
|
+
printACPolyfillWarning = false;
|
|
60
|
+
emitWarning('AbortController is not defined. If using lru-cache in ' +
|
|
61
|
+
'node 14, load an AbortController polyfill from the ' +
|
|
62
|
+
'`node-abort-controller` package. A minimal polyfill is ' +
|
|
63
|
+
'provided for use by LRUCache.fetch(), but it should not be ' +
|
|
64
|
+
'relied upon in other contexts (eg, passing it to other APIs that ' +
|
|
65
|
+
'use AbortController/AbortSignal might have undesirable effects). ' +
|
|
66
|
+
'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/* c8 ignore stop */
|
|
70
|
+
const shouldWarn = (code) => !warned.has(code);
|
|
71
|
+
const TYPE = Symbol('type');
|
|
72
|
+
const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
|
|
73
|
+
/* c8 ignore start */
|
|
74
|
+
// This is a little bit ridiculous, tbh.
|
|
75
|
+
// The maximum array length is 2^32-1 or thereabouts on most JS impls.
|
|
76
|
+
// And well before that point, you're caching the entire world, I mean,
|
|
77
|
+
// that's ~32GB of just integers for the next/prev links, plus whatever
|
|
78
|
+
// else to hold that many keys and values. Just filling the memory with
|
|
79
|
+
// zeroes at init time is brutal when you get that big.
|
|
80
|
+
// But why not be complete?
|
|
81
|
+
// Maybe in the future, these limits will have expanded.
|
|
82
|
+
const getUintArray = (max) => !isPosInt(max)
|
|
83
|
+
? null
|
|
84
|
+
: max <= Math.pow(2, 8)
|
|
85
|
+
? Uint8Array
|
|
86
|
+
: max <= Math.pow(2, 16)
|
|
87
|
+
? Uint16Array
|
|
88
|
+
: max <= Math.pow(2, 32)
|
|
89
|
+
? Uint32Array
|
|
90
|
+
: max <= Number.MAX_SAFE_INTEGER
|
|
91
|
+
? ZeroArray
|
|
92
|
+
: null;
|
|
93
|
+
/* c8 ignore stop */
|
|
94
|
+
class ZeroArray extends Array {
|
|
95
|
+
constructor(size) {
|
|
96
|
+
super(size);
|
|
97
|
+
this.fill(0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
class Stack {
|
|
101
|
+
heap;
|
|
102
|
+
length;
|
|
103
|
+
// private constructor
|
|
104
|
+
static #constructing = false;
|
|
105
|
+
static create(max) {
|
|
106
|
+
const HeapCls = getUintArray(max);
|
|
107
|
+
if (!HeapCls)
|
|
108
|
+
return [];
|
|
109
|
+
Stack.#constructing = true;
|
|
110
|
+
const s = new Stack(max, HeapCls);
|
|
111
|
+
Stack.#constructing = false;
|
|
112
|
+
return s;
|
|
113
|
+
}
|
|
114
|
+
constructor(max, HeapCls) {
|
|
115
|
+
/* c8 ignore start */
|
|
116
|
+
if (!Stack.#constructing) {
|
|
117
|
+
throw new TypeError('instantiate Stack using Stack.create(n)');
|
|
118
|
+
}
|
|
119
|
+
/* c8 ignore stop */
|
|
120
|
+
this.heap = new HeapCls(max);
|
|
121
|
+
this.length = 0;
|
|
122
|
+
}
|
|
123
|
+
push(n) {
|
|
124
|
+
this.heap[this.length++] = n;
|
|
125
|
+
}
|
|
126
|
+
pop() {
|
|
127
|
+
return this.heap[--this.length];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Default export, the thing you're using this module to get.
|
|
132
|
+
*
|
|
133
|
+
* The `K` and `V` types define the key and value types, respectively. The
|
|
134
|
+
* optional `FC` type defines the type of the `context` object passed to
|
|
135
|
+
* `cache.fetch()` and `cache.memo()`.
|
|
136
|
+
*
|
|
137
|
+
* Keys and values **must not** be `null` or `undefined`.
|
|
138
|
+
*
|
|
139
|
+
* All properties from the options object (with the exception of `max`,
|
|
140
|
+
* `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
|
|
141
|
+
* added as normal public members. (The listed options are read-only getters.)
|
|
142
|
+
*
|
|
143
|
+
* Changing any of these will alter the defaults for subsequent method calls.
|
|
144
|
+
*/
|
|
145
|
+
class LRUCache {
|
|
146
|
+
// options that cannot be changed without disaster
|
|
147
|
+
#max;
|
|
148
|
+
#maxSize;
|
|
149
|
+
#dispose;
|
|
150
|
+
#disposeAfter;
|
|
151
|
+
#fetchMethod;
|
|
152
|
+
#memoMethod;
|
|
153
|
+
/**
|
|
154
|
+
* {@link LRUCache.OptionsBase.ttl}
|
|
155
|
+
*/
|
|
156
|
+
ttl;
|
|
157
|
+
/**
|
|
158
|
+
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
159
|
+
*/
|
|
160
|
+
ttlResolution;
|
|
161
|
+
/**
|
|
162
|
+
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
163
|
+
*/
|
|
164
|
+
ttlAutopurge;
|
|
165
|
+
/**
|
|
166
|
+
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
167
|
+
*/
|
|
168
|
+
updateAgeOnGet;
|
|
169
|
+
/**
|
|
170
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
171
|
+
*/
|
|
172
|
+
updateAgeOnHas;
|
|
173
|
+
/**
|
|
174
|
+
* {@link LRUCache.OptionsBase.allowStale}
|
|
175
|
+
*/
|
|
176
|
+
allowStale;
|
|
177
|
+
/**
|
|
178
|
+
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
179
|
+
*/
|
|
180
|
+
noDisposeOnSet;
|
|
181
|
+
/**
|
|
182
|
+
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
183
|
+
*/
|
|
184
|
+
noUpdateTTL;
|
|
185
|
+
/**
|
|
186
|
+
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
187
|
+
*/
|
|
188
|
+
maxEntrySize;
|
|
189
|
+
/**
|
|
190
|
+
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
191
|
+
*/
|
|
192
|
+
sizeCalculation;
|
|
193
|
+
/**
|
|
194
|
+
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
195
|
+
*/
|
|
196
|
+
noDeleteOnFetchRejection;
|
|
197
|
+
/**
|
|
198
|
+
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
199
|
+
*/
|
|
200
|
+
noDeleteOnStaleGet;
|
|
201
|
+
/**
|
|
202
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
203
|
+
*/
|
|
204
|
+
allowStaleOnFetchAbort;
|
|
205
|
+
/**
|
|
206
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
207
|
+
*/
|
|
208
|
+
allowStaleOnFetchRejection;
|
|
209
|
+
/**
|
|
210
|
+
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
211
|
+
*/
|
|
212
|
+
ignoreFetchAbort;
|
|
213
|
+
// computed properties
|
|
214
|
+
#size;
|
|
215
|
+
#calculatedSize;
|
|
216
|
+
#keyMap;
|
|
217
|
+
#keyList;
|
|
218
|
+
#valList;
|
|
219
|
+
#next;
|
|
220
|
+
#prev;
|
|
221
|
+
#head;
|
|
222
|
+
#tail;
|
|
223
|
+
#free;
|
|
224
|
+
#disposed;
|
|
225
|
+
#sizes;
|
|
226
|
+
#starts;
|
|
227
|
+
#ttls;
|
|
228
|
+
#hasDispose;
|
|
229
|
+
#hasFetchMethod;
|
|
230
|
+
#hasDisposeAfter;
|
|
231
|
+
/**
|
|
232
|
+
* Do not call this method unless you need to inspect the
|
|
233
|
+
* inner workings of the cache. If anything returned by this
|
|
234
|
+
* object is modified in any way, strange breakage may occur.
|
|
235
|
+
*
|
|
236
|
+
* These fields are private for a reason!
|
|
237
|
+
*
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
static unsafeExposeInternals(c) {
|
|
241
|
+
return {
|
|
242
|
+
// properties
|
|
243
|
+
starts: c.#starts,
|
|
244
|
+
ttls: c.#ttls,
|
|
245
|
+
sizes: c.#sizes,
|
|
246
|
+
keyMap: c.#keyMap,
|
|
247
|
+
keyList: c.#keyList,
|
|
248
|
+
valList: c.#valList,
|
|
249
|
+
next: c.#next,
|
|
250
|
+
prev: c.#prev,
|
|
251
|
+
get head() {
|
|
252
|
+
return c.#head;
|
|
253
|
+
},
|
|
254
|
+
get tail() {
|
|
255
|
+
return c.#tail;
|
|
256
|
+
},
|
|
257
|
+
free: c.#free,
|
|
258
|
+
// methods
|
|
259
|
+
isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
|
|
260
|
+
backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
|
|
261
|
+
moveToTail: (index) => c.#moveToTail(index),
|
|
262
|
+
indexes: (options) => c.#indexes(options),
|
|
263
|
+
rindexes: (options) => c.#rindexes(options),
|
|
264
|
+
isStale: (index) => c.#isStale(index),
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
// Protected read-only members
|
|
268
|
+
/**
|
|
269
|
+
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
270
|
+
*/
|
|
271
|
+
get max() {
|
|
272
|
+
return this.#max;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
276
|
+
*/
|
|
277
|
+
get maxSize() {
|
|
278
|
+
return this.#maxSize;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* The total computed size of items in the cache (read-only)
|
|
282
|
+
*/
|
|
283
|
+
get calculatedSize() {
|
|
284
|
+
return this.#calculatedSize;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The number of items stored in the cache (read-only)
|
|
288
|
+
*/
|
|
289
|
+
get size() {
|
|
290
|
+
return this.#size;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
294
|
+
*/
|
|
295
|
+
get fetchMethod() {
|
|
296
|
+
return this.#fetchMethod;
|
|
297
|
+
}
|
|
298
|
+
get memoMethod() {
|
|
299
|
+
return this.#memoMethod;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
303
|
+
*/
|
|
304
|
+
get dispose() {
|
|
305
|
+
return this.#dispose;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
309
|
+
*/
|
|
310
|
+
get disposeAfter() {
|
|
311
|
+
return this.#disposeAfter;
|
|
312
|
+
}
|
|
313
|
+
constructor(options) {
|
|
314
|
+
const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
|
|
315
|
+
if (max !== 0 && !isPosInt(max)) {
|
|
316
|
+
throw new TypeError('max option must be a nonnegative integer');
|
|
317
|
+
}
|
|
318
|
+
const UintArray = max ? getUintArray(max) : Array;
|
|
319
|
+
if (!UintArray) {
|
|
320
|
+
throw new Error('invalid max value: ' + max);
|
|
321
|
+
}
|
|
322
|
+
this.#max = max;
|
|
323
|
+
this.#maxSize = maxSize;
|
|
324
|
+
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
|
325
|
+
this.sizeCalculation = sizeCalculation;
|
|
326
|
+
if (this.sizeCalculation) {
|
|
327
|
+
if (!this.#maxSize && !this.maxEntrySize) {
|
|
328
|
+
throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
|
|
329
|
+
}
|
|
330
|
+
if (typeof this.sizeCalculation !== 'function') {
|
|
331
|
+
throw new TypeError('sizeCalculation set to non-function');
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (memoMethod !== undefined &&
|
|
335
|
+
typeof memoMethod !== 'function') {
|
|
336
|
+
throw new TypeError('memoMethod must be a function if defined');
|
|
337
|
+
}
|
|
338
|
+
this.#memoMethod = memoMethod;
|
|
339
|
+
if (fetchMethod !== undefined &&
|
|
340
|
+
typeof fetchMethod !== 'function') {
|
|
341
|
+
throw new TypeError('fetchMethod must be a function if specified');
|
|
342
|
+
}
|
|
343
|
+
this.#fetchMethod = fetchMethod;
|
|
344
|
+
this.#hasFetchMethod = !!fetchMethod;
|
|
345
|
+
this.#keyMap = new Map();
|
|
346
|
+
this.#keyList = new Array(max).fill(undefined);
|
|
347
|
+
this.#valList = new Array(max).fill(undefined);
|
|
348
|
+
this.#next = new UintArray(max);
|
|
349
|
+
this.#prev = new UintArray(max);
|
|
350
|
+
this.#head = 0;
|
|
351
|
+
this.#tail = 0;
|
|
352
|
+
this.#free = Stack.create(max);
|
|
353
|
+
this.#size = 0;
|
|
354
|
+
this.#calculatedSize = 0;
|
|
355
|
+
if (typeof dispose === 'function') {
|
|
356
|
+
this.#dispose = dispose;
|
|
357
|
+
}
|
|
358
|
+
if (typeof disposeAfter === 'function') {
|
|
359
|
+
this.#disposeAfter = disposeAfter;
|
|
360
|
+
this.#disposed = [];
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
this.#disposeAfter = undefined;
|
|
364
|
+
this.#disposed = undefined;
|
|
365
|
+
}
|
|
366
|
+
this.#hasDispose = !!this.#dispose;
|
|
367
|
+
this.#hasDisposeAfter = !!this.#disposeAfter;
|
|
368
|
+
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
369
|
+
this.noUpdateTTL = !!noUpdateTTL;
|
|
370
|
+
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
371
|
+
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
372
|
+
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
373
|
+
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
374
|
+
// NB: maxEntrySize is set to maxSize if it's set
|
|
375
|
+
if (this.maxEntrySize !== 0) {
|
|
376
|
+
if (this.#maxSize !== 0) {
|
|
377
|
+
if (!isPosInt(this.#maxSize)) {
|
|
378
|
+
throw new TypeError('maxSize must be a positive integer if specified');
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
if (!isPosInt(this.maxEntrySize)) {
|
|
382
|
+
throw new TypeError('maxEntrySize must be a positive integer if specified');
|
|
383
|
+
}
|
|
384
|
+
this.#initializeSizeTracking();
|
|
385
|
+
}
|
|
386
|
+
this.allowStale = !!allowStale;
|
|
387
|
+
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
388
|
+
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
389
|
+
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
390
|
+
this.ttlResolution =
|
|
391
|
+
isPosInt(ttlResolution) || ttlResolution === 0
|
|
392
|
+
? ttlResolution
|
|
393
|
+
: 1;
|
|
394
|
+
this.ttlAutopurge = !!ttlAutopurge;
|
|
395
|
+
this.ttl = ttl || 0;
|
|
396
|
+
if (this.ttl) {
|
|
397
|
+
if (!isPosInt(this.ttl)) {
|
|
398
|
+
throw new TypeError('ttl must be a positive integer if specified');
|
|
399
|
+
}
|
|
400
|
+
this.#initializeTTLTracking();
|
|
401
|
+
}
|
|
402
|
+
// do not allow completely unbounded caches
|
|
403
|
+
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
|
|
404
|
+
throw new TypeError('At least one of max, maxSize, or ttl is required');
|
|
405
|
+
}
|
|
406
|
+
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
|
407
|
+
const code = 'LRU_CACHE_UNBOUNDED';
|
|
408
|
+
if (shouldWarn(code)) {
|
|
409
|
+
warned.add(code);
|
|
410
|
+
const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
|
|
411
|
+
'result in unbounded memory consumption.';
|
|
412
|
+
emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
418
|
+
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
419
|
+
*/
|
|
420
|
+
getRemainingTTL(key) {
|
|
421
|
+
return this.#keyMap.has(key) ? Infinity : 0;
|
|
422
|
+
}
|
|
423
|
+
#initializeTTLTracking() {
|
|
424
|
+
const ttls = new ZeroArray(this.#max);
|
|
425
|
+
const starts = new ZeroArray(this.#max);
|
|
426
|
+
this.#ttls = ttls;
|
|
427
|
+
this.#starts = starts;
|
|
428
|
+
this.#setItemTTL = (index, ttl, start = perf.now()) => {
|
|
429
|
+
starts[index] = ttl !== 0 ? start : 0;
|
|
430
|
+
ttls[index] = ttl;
|
|
431
|
+
if (ttl !== 0 && this.ttlAutopurge) {
|
|
432
|
+
const t = setTimeout(() => {
|
|
433
|
+
if (this.#isStale(index)) {
|
|
434
|
+
this.#delete(this.#keyList[index], 'expire');
|
|
435
|
+
}
|
|
436
|
+
}, ttl + 1);
|
|
437
|
+
// unref() not supported on all platforms
|
|
438
|
+
/* c8 ignore start */
|
|
439
|
+
if (t.unref) {
|
|
440
|
+
t.unref();
|
|
441
|
+
}
|
|
442
|
+
/* c8 ignore stop */
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
this.#updateItemAge = index => {
|
|
446
|
+
starts[index] = ttls[index] !== 0 ? perf.now() : 0;
|
|
447
|
+
};
|
|
448
|
+
this.#statusTTL = (status, index) => {
|
|
449
|
+
if (ttls[index]) {
|
|
450
|
+
const ttl = ttls[index];
|
|
451
|
+
const start = starts[index];
|
|
452
|
+
/* c8 ignore next */
|
|
453
|
+
if (!ttl || !start)
|
|
454
|
+
return;
|
|
455
|
+
status.ttl = ttl;
|
|
456
|
+
status.start = start;
|
|
457
|
+
status.now = cachedNow || getNow();
|
|
458
|
+
const age = status.now - start;
|
|
459
|
+
status.remainingTTL = ttl - age;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
// debounce calls to perf.now() to 1s so we're not hitting
|
|
463
|
+
// that costly call repeatedly.
|
|
464
|
+
let cachedNow = 0;
|
|
465
|
+
const getNow = () => {
|
|
466
|
+
const n = perf.now();
|
|
467
|
+
if (this.ttlResolution > 0) {
|
|
468
|
+
cachedNow = n;
|
|
469
|
+
const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
|
|
470
|
+
// not available on all platforms
|
|
471
|
+
/* c8 ignore start */
|
|
472
|
+
if (t.unref) {
|
|
473
|
+
t.unref();
|
|
474
|
+
}
|
|
475
|
+
/* c8 ignore stop */
|
|
476
|
+
}
|
|
477
|
+
return n;
|
|
478
|
+
};
|
|
479
|
+
this.getRemainingTTL = key => {
|
|
480
|
+
const index = this.#keyMap.get(key);
|
|
481
|
+
if (index === undefined) {
|
|
482
|
+
return 0;
|
|
483
|
+
}
|
|
484
|
+
const ttl = ttls[index];
|
|
485
|
+
const start = starts[index];
|
|
486
|
+
if (!ttl || !start) {
|
|
487
|
+
return Infinity;
|
|
488
|
+
}
|
|
489
|
+
const age = (cachedNow || getNow()) - start;
|
|
490
|
+
return ttl - age;
|
|
491
|
+
};
|
|
492
|
+
this.#isStale = index => {
|
|
493
|
+
const s = starts[index];
|
|
494
|
+
const t = ttls[index];
|
|
495
|
+
return !!t && !!s && (cachedNow || getNow()) - s > t;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
// conditionally set private methods related to TTL
|
|
499
|
+
#updateItemAge = () => { };
|
|
500
|
+
#statusTTL = () => { };
|
|
501
|
+
#setItemTTL = () => { };
|
|
502
|
+
/* c8 ignore stop */
|
|
503
|
+
#isStale = () => false;
|
|
504
|
+
#initializeSizeTracking() {
|
|
505
|
+
const sizes = new ZeroArray(this.#max);
|
|
506
|
+
this.#calculatedSize = 0;
|
|
507
|
+
this.#sizes = sizes;
|
|
508
|
+
this.#removeItemSize = index => {
|
|
509
|
+
this.#calculatedSize -= sizes[index];
|
|
510
|
+
sizes[index] = 0;
|
|
511
|
+
};
|
|
512
|
+
this.#requireSize = (k, v, size, sizeCalculation) => {
|
|
513
|
+
// provisionally accept background fetches.
|
|
514
|
+
// actual value size will be checked when they return.
|
|
515
|
+
if (this.#isBackgroundFetch(v)) {
|
|
516
|
+
return 0;
|
|
517
|
+
}
|
|
518
|
+
if (!isPosInt(size)) {
|
|
519
|
+
if (sizeCalculation) {
|
|
520
|
+
if (typeof sizeCalculation !== 'function') {
|
|
521
|
+
throw new TypeError('sizeCalculation must be a function');
|
|
522
|
+
}
|
|
523
|
+
size = sizeCalculation(v, k);
|
|
524
|
+
if (!isPosInt(size)) {
|
|
525
|
+
throw new TypeError('sizeCalculation return invalid (expect positive integer)');
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
throw new TypeError('invalid size value (must be positive integer). ' +
|
|
530
|
+
'When maxSize or maxEntrySize is used, sizeCalculation ' +
|
|
531
|
+
'or size must be set.');
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return size;
|
|
535
|
+
};
|
|
536
|
+
this.#addItemSize = (index, size, status) => {
|
|
537
|
+
sizes[index] = size;
|
|
538
|
+
if (this.#maxSize) {
|
|
539
|
+
const maxSize = this.#maxSize - sizes[index];
|
|
540
|
+
while (this.#calculatedSize > maxSize) {
|
|
541
|
+
this.#evict(true);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
this.#calculatedSize += sizes[index];
|
|
545
|
+
if (status) {
|
|
546
|
+
status.entrySize = size;
|
|
547
|
+
status.totalCalculatedSize = this.#calculatedSize;
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
#removeItemSize = _i => { };
|
|
552
|
+
#addItemSize = (_i, _s, _st) => { };
|
|
553
|
+
#requireSize = (_k, _v, size, sizeCalculation) => {
|
|
554
|
+
if (size || sizeCalculation) {
|
|
555
|
+
throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
|
|
556
|
+
}
|
|
557
|
+
return 0;
|
|
558
|
+
};
|
|
559
|
+
*#indexes({ allowStale = this.allowStale } = {}) {
|
|
560
|
+
if (this.#size) {
|
|
561
|
+
for (let i = this.#tail; true;) {
|
|
562
|
+
if (!this.#isValidIndex(i)) {
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
if (allowStale || !this.#isStale(i)) {
|
|
566
|
+
yield i;
|
|
567
|
+
}
|
|
568
|
+
if (i === this.#head) {
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
i = this.#prev[i];
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
*#rindexes({ allowStale = this.allowStale } = {}) {
|
|
578
|
+
if (this.#size) {
|
|
579
|
+
for (let i = this.#head; true;) {
|
|
580
|
+
if (!this.#isValidIndex(i)) {
|
|
581
|
+
break;
|
|
582
|
+
}
|
|
583
|
+
if (allowStale || !this.#isStale(i)) {
|
|
584
|
+
yield i;
|
|
585
|
+
}
|
|
586
|
+
if (i === this.#tail) {
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
i = this.#next[i];
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
#isValidIndex(index) {
|
|
596
|
+
return (index !== undefined &&
|
|
597
|
+
this.#keyMap.get(this.#keyList[index]) === index);
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
601
|
+
* in order from most recently used to least recently used.
|
|
602
|
+
*/
|
|
603
|
+
*entries() {
|
|
604
|
+
for (const i of this.#indexes()) {
|
|
605
|
+
if (this.#valList[i] !== undefined &&
|
|
606
|
+
this.#keyList[i] !== undefined &&
|
|
607
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
608
|
+
yield [this.#keyList[i], this.#valList[i]];
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Inverse order version of {@link LRUCache.entries}
|
|
614
|
+
*
|
|
615
|
+
* Return a generator yielding `[key, value]` pairs,
|
|
616
|
+
* in order from least recently used to most recently used.
|
|
617
|
+
*/
|
|
618
|
+
*rentries() {
|
|
619
|
+
for (const i of this.#rindexes()) {
|
|
620
|
+
if (this.#valList[i] !== undefined &&
|
|
621
|
+
this.#keyList[i] !== undefined &&
|
|
622
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
623
|
+
yield [this.#keyList[i], this.#valList[i]];
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Return a generator yielding the keys in the cache,
|
|
629
|
+
* in order from most recently used to least recently used.
|
|
630
|
+
*/
|
|
631
|
+
*keys() {
|
|
632
|
+
for (const i of this.#indexes()) {
|
|
633
|
+
const k = this.#keyList[i];
|
|
634
|
+
if (k !== undefined &&
|
|
635
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
636
|
+
yield k;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Inverse order version of {@link LRUCache.keys}
|
|
642
|
+
*
|
|
643
|
+
* Return a generator yielding the keys in the cache,
|
|
644
|
+
* in order from least recently used to most recently used.
|
|
645
|
+
*/
|
|
646
|
+
*rkeys() {
|
|
647
|
+
for (const i of this.#rindexes()) {
|
|
648
|
+
const k = this.#keyList[i];
|
|
649
|
+
if (k !== undefined &&
|
|
650
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
651
|
+
yield k;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Return a generator yielding the values in the cache,
|
|
657
|
+
* in order from most recently used to least recently used.
|
|
658
|
+
*/
|
|
659
|
+
*values() {
|
|
660
|
+
for (const i of this.#indexes()) {
|
|
661
|
+
const v = this.#valList[i];
|
|
662
|
+
if (v !== undefined &&
|
|
663
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
664
|
+
yield this.#valList[i];
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Inverse order version of {@link LRUCache.values}
|
|
670
|
+
*
|
|
671
|
+
* Return a generator yielding the values in the cache,
|
|
672
|
+
* in order from least recently used to most recently used.
|
|
673
|
+
*/
|
|
674
|
+
*rvalues() {
|
|
675
|
+
for (const i of this.#rindexes()) {
|
|
676
|
+
const v = this.#valList[i];
|
|
677
|
+
if (v !== undefined &&
|
|
678
|
+
!this.#isBackgroundFetch(this.#valList[i])) {
|
|
679
|
+
yield this.#valList[i];
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Iterating over the cache itself yields the same results as
|
|
685
|
+
* {@link LRUCache.entries}
|
|
686
|
+
*/
|
|
687
|
+
[Symbol.iterator]() {
|
|
688
|
+
return this.entries();
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* A String value that is used in the creation of the default string
|
|
692
|
+
* description of an object. Called by the built-in method
|
|
693
|
+
* `Object.prototype.toString`.
|
|
694
|
+
*/
|
|
695
|
+
[Symbol.toStringTag] = 'LRUCache';
|
|
696
|
+
/**
|
|
697
|
+
* Find a value for which the supplied fn method returns a truthy value,
|
|
698
|
+
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
699
|
+
*/
|
|
700
|
+
find(fn, getOptions = {}) {
|
|
701
|
+
for (const i of this.#indexes()) {
|
|
702
|
+
const v = this.#valList[i];
|
|
703
|
+
const value = this.#isBackgroundFetch(v)
|
|
704
|
+
? v.__staleWhileFetching
|
|
705
|
+
: v;
|
|
706
|
+
if (value === undefined)
|
|
707
|
+
continue;
|
|
708
|
+
if (fn(value, this.#keyList[i], this)) {
|
|
709
|
+
return this.get(this.#keyList[i], getOptions);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Call the supplied function on each item in the cache, in order from most
|
|
715
|
+
* recently used to least recently used.
|
|
716
|
+
*
|
|
717
|
+
* `fn` is called as `fn(value, key, cache)`.
|
|
718
|
+
*
|
|
719
|
+
* If `thisp` is provided, function will be called in the `this`-context of
|
|
720
|
+
* the provided object, or the cache if no `thisp` object is provided.
|
|
721
|
+
*
|
|
722
|
+
* Does not update age or recenty of use, or iterate over stale values.
|
|
723
|
+
*/
|
|
724
|
+
forEach(fn, thisp = this) {
|
|
725
|
+
for (const i of this.#indexes()) {
|
|
726
|
+
const v = this.#valList[i];
|
|
727
|
+
const value = this.#isBackgroundFetch(v)
|
|
728
|
+
? v.__staleWhileFetching
|
|
729
|
+
: v;
|
|
730
|
+
if (value === undefined)
|
|
731
|
+
continue;
|
|
732
|
+
fn.call(thisp, value, this.#keyList[i], this);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* The same as {@link LRUCache.forEach} but items are iterated over in
|
|
737
|
+
* reverse order. (ie, less recently used items are iterated over first.)
|
|
738
|
+
*/
|
|
739
|
+
rforEach(fn, thisp = this) {
|
|
740
|
+
for (const i of this.#rindexes()) {
|
|
741
|
+
const v = this.#valList[i];
|
|
742
|
+
const value = this.#isBackgroundFetch(v)
|
|
743
|
+
? v.__staleWhileFetching
|
|
744
|
+
: v;
|
|
745
|
+
if (value === undefined)
|
|
746
|
+
continue;
|
|
747
|
+
fn.call(thisp, value, this.#keyList[i], this);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Delete any stale entries. Returns true if anything was removed,
|
|
752
|
+
* false otherwise.
|
|
753
|
+
*/
|
|
754
|
+
purgeStale() {
|
|
755
|
+
let deleted = false;
|
|
756
|
+
for (const i of this.#rindexes({ allowStale: true })) {
|
|
757
|
+
if (this.#isStale(i)) {
|
|
758
|
+
this.#delete(this.#keyList[i], 'expire');
|
|
759
|
+
deleted = true;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
return deleted;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Get the extended info about a given entry, to get its value, size, and
|
|
766
|
+
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
767
|
+
*
|
|
768
|
+
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
769
|
+
* serialization, the `start` value is always the current timestamp, and the
|
|
770
|
+
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
771
|
+
*
|
|
772
|
+
* Always returns stale values, if their info is found in the cache, so be
|
|
773
|
+
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
774
|
+
* if relevant.
|
|
775
|
+
*/
|
|
776
|
+
info(key) {
|
|
777
|
+
const i = this.#keyMap.get(key);
|
|
778
|
+
if (i === undefined)
|
|
779
|
+
return undefined;
|
|
780
|
+
const v = this.#valList[i];
|
|
781
|
+
const value = this.#isBackgroundFetch(v)
|
|
782
|
+
? v.__staleWhileFetching
|
|
783
|
+
: v;
|
|
784
|
+
if (value === undefined)
|
|
785
|
+
return undefined;
|
|
786
|
+
const entry = { value };
|
|
787
|
+
if (this.#ttls && this.#starts) {
|
|
788
|
+
const ttl = this.#ttls[i];
|
|
789
|
+
const start = this.#starts[i];
|
|
790
|
+
if (ttl && start) {
|
|
791
|
+
const remain = ttl - (perf.now() - start);
|
|
792
|
+
entry.ttl = remain;
|
|
793
|
+
entry.start = Date.now();
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
if (this.#sizes) {
|
|
797
|
+
entry.size = this.#sizes[i];
|
|
798
|
+
}
|
|
799
|
+
return entry;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
803
|
+
* passed to {@link LRLUCache#load}.
|
|
804
|
+
*
|
|
805
|
+
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
806
|
+
* timestamp, even if `performance.now()` is available.
|
|
807
|
+
*
|
|
808
|
+
* Stale entries are always included in the `dump`, even if
|
|
809
|
+
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
810
|
+
*
|
|
811
|
+
* Note: this returns an actual array, not a generator, so it can be more
|
|
812
|
+
* easily passed around.
|
|
813
|
+
*/
|
|
814
|
+
dump() {
|
|
815
|
+
const arr = [];
|
|
816
|
+
for (const i of this.#indexes({ allowStale: true })) {
|
|
817
|
+
const key = this.#keyList[i];
|
|
818
|
+
const v = this.#valList[i];
|
|
819
|
+
const value = this.#isBackgroundFetch(v)
|
|
820
|
+
? v.__staleWhileFetching
|
|
821
|
+
: v;
|
|
822
|
+
if (value === undefined || key === undefined)
|
|
823
|
+
continue;
|
|
824
|
+
const entry = { value };
|
|
825
|
+
if (this.#ttls && this.#starts) {
|
|
826
|
+
entry.ttl = this.#ttls[i];
|
|
827
|
+
// always dump the start relative to a portable timestamp
|
|
828
|
+
// it's ok for this to be a bit slow, it's a rare operation.
|
|
829
|
+
const age = perf.now() - this.#starts[i];
|
|
830
|
+
entry.start = Math.floor(Date.now() - age);
|
|
831
|
+
}
|
|
832
|
+
if (this.#sizes) {
|
|
833
|
+
entry.size = this.#sizes[i];
|
|
834
|
+
}
|
|
835
|
+
arr.unshift([key, entry]);
|
|
836
|
+
}
|
|
837
|
+
return arr;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Reset the cache and load in the items in entries in the order listed.
|
|
841
|
+
*
|
|
842
|
+
* The shape of the resulting cache may be different if the same options are
|
|
843
|
+
* not used in both caches.
|
|
844
|
+
*
|
|
845
|
+
* The `start` fields are assumed to be calculated relative to a portable
|
|
846
|
+
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
847
|
+
*/
|
|
848
|
+
load(arr) {
|
|
849
|
+
this.clear();
|
|
850
|
+
for (const [key, entry] of arr) {
|
|
851
|
+
if (entry.start) {
|
|
852
|
+
// entry.start is a portable timestamp, but we may be using
|
|
853
|
+
// node's performance.now(), so calculate the offset, so that
|
|
854
|
+
// we get the intended remaining TTL, no matter how long it's
|
|
855
|
+
// been on ice.
|
|
856
|
+
//
|
|
857
|
+
// it's ok for this to be a bit slow, it's a rare operation.
|
|
858
|
+
const age = Date.now() - entry.start;
|
|
859
|
+
entry.start = perf.now() - age;
|
|
860
|
+
}
|
|
861
|
+
this.set(key, entry.value, entry);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Add a value to the cache.
|
|
866
|
+
*
|
|
867
|
+
* Note: if `undefined` is specified as a value, this is an alias for
|
|
868
|
+
* {@link LRUCache#delete}
|
|
869
|
+
*
|
|
870
|
+
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
871
|
+
* their corresponding values in the constructor options for the scope
|
|
872
|
+
* of this single `set()` operation.
|
|
873
|
+
*
|
|
874
|
+
* If `start` is provided, then that will set the effective start
|
|
875
|
+
* time for the TTL calculation. Note that this must be a previous
|
|
876
|
+
* value of `performance.now()` if supported, or a previous value of
|
|
877
|
+
* `Date.now()` if not.
|
|
878
|
+
*
|
|
879
|
+
* Options object may also include `size`, which will prevent
|
|
880
|
+
* calling the `sizeCalculation` function and just use the specified
|
|
881
|
+
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
882
|
+
* will prevent calling a `dispose` function in the case of
|
|
883
|
+
* overwrites.
|
|
884
|
+
*
|
|
885
|
+
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
886
|
+
* entry is greater than `maxEntrySize`, then the item will not be
|
|
887
|
+
* added to the cache.
|
|
888
|
+
*
|
|
889
|
+
* Will update the recency of the entry.
|
|
890
|
+
*
|
|
891
|
+
* If the value is `undefined`, then this is an alias for
|
|
892
|
+
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
893
|
+
*/
|
|
894
|
+
set(k, v, setOptions = {}) {
|
|
895
|
+
if (v === undefined) {
|
|
896
|
+
this.delete(k);
|
|
897
|
+
return this;
|
|
898
|
+
}
|
|
899
|
+
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
|
|
900
|
+
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
901
|
+
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
|
902
|
+
// if the item doesn't fit, don't do anything
|
|
903
|
+
// NB: maxEntrySize set to maxSize by default
|
|
904
|
+
if (this.maxEntrySize && size > this.maxEntrySize) {
|
|
905
|
+
if (status) {
|
|
906
|
+
status.set = 'miss';
|
|
907
|
+
status.maxEntrySizeExceeded = true;
|
|
908
|
+
}
|
|
909
|
+
// have to delete, in case something is there already.
|
|
910
|
+
this.#delete(k, 'set');
|
|
911
|
+
return this;
|
|
912
|
+
}
|
|
913
|
+
let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
|
|
914
|
+
if (index === undefined) {
|
|
915
|
+
// addition
|
|
916
|
+
index = (this.#size === 0
|
|
917
|
+
? this.#tail
|
|
918
|
+
: this.#free.length !== 0
|
|
919
|
+
? this.#free.pop()
|
|
920
|
+
: this.#size === this.#max
|
|
921
|
+
? this.#evict(false)
|
|
922
|
+
: this.#size);
|
|
923
|
+
this.#keyList[index] = k;
|
|
924
|
+
this.#valList[index] = v;
|
|
925
|
+
this.#keyMap.set(k, index);
|
|
926
|
+
this.#next[this.#tail] = index;
|
|
927
|
+
this.#prev[index] = this.#tail;
|
|
928
|
+
this.#tail = index;
|
|
929
|
+
this.#size++;
|
|
930
|
+
this.#addItemSize(index, size, status);
|
|
931
|
+
if (status)
|
|
932
|
+
status.set = 'add';
|
|
933
|
+
noUpdateTTL = false;
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
// update
|
|
937
|
+
this.#moveToTail(index);
|
|
938
|
+
const oldVal = this.#valList[index];
|
|
939
|
+
if (v !== oldVal) {
|
|
940
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
|
941
|
+
oldVal.__abortController.abort(new Error('replaced'));
|
|
942
|
+
const { __staleWhileFetching: s } = oldVal;
|
|
943
|
+
if (s !== undefined && !noDisposeOnSet) {
|
|
944
|
+
if (this.#hasDispose) {
|
|
945
|
+
this.#dispose?.(s, k, 'set');
|
|
946
|
+
}
|
|
947
|
+
if (this.#hasDisposeAfter) {
|
|
948
|
+
this.#disposed?.push([s, k, 'set']);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
else if (!noDisposeOnSet) {
|
|
953
|
+
if (this.#hasDispose) {
|
|
954
|
+
this.#dispose?.(oldVal, k, 'set');
|
|
955
|
+
}
|
|
956
|
+
if (this.#hasDisposeAfter) {
|
|
957
|
+
this.#disposed?.push([oldVal, k, 'set']);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
this.#removeItemSize(index);
|
|
961
|
+
this.#addItemSize(index, size, status);
|
|
962
|
+
this.#valList[index] = v;
|
|
963
|
+
if (status) {
|
|
964
|
+
status.set = 'replace';
|
|
965
|
+
const oldValue = oldVal && this.#isBackgroundFetch(oldVal)
|
|
966
|
+
? oldVal.__staleWhileFetching
|
|
967
|
+
: oldVal;
|
|
968
|
+
if (oldValue !== undefined)
|
|
969
|
+
status.oldValue = oldValue;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
else if (status) {
|
|
973
|
+
status.set = 'update';
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
if (ttl !== 0 && !this.#ttls) {
|
|
977
|
+
this.#initializeTTLTracking();
|
|
978
|
+
}
|
|
979
|
+
if (this.#ttls) {
|
|
980
|
+
if (!noUpdateTTL) {
|
|
981
|
+
this.#setItemTTL(index, ttl, start);
|
|
982
|
+
}
|
|
983
|
+
if (status)
|
|
984
|
+
this.#statusTTL(status, index);
|
|
985
|
+
}
|
|
986
|
+
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
|
987
|
+
const dt = this.#disposed;
|
|
988
|
+
let task;
|
|
989
|
+
while ((task = dt?.shift())) {
|
|
990
|
+
this.#disposeAfter?.(...task);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return this;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* Evict the least recently used item, returning its value or
|
|
997
|
+
* `undefined` if cache is empty.
|
|
998
|
+
*/
|
|
999
|
+
pop() {
|
|
1000
|
+
try {
|
|
1001
|
+
while (this.#size) {
|
|
1002
|
+
const val = this.#valList[this.#head];
|
|
1003
|
+
this.#evict(true);
|
|
1004
|
+
if (this.#isBackgroundFetch(val)) {
|
|
1005
|
+
if (val.__staleWhileFetching) {
|
|
1006
|
+
return val.__staleWhileFetching;
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
else if (val !== undefined) {
|
|
1010
|
+
return val;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
finally {
|
|
1015
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
|
1016
|
+
const dt = this.#disposed;
|
|
1017
|
+
let task;
|
|
1018
|
+
while ((task = dt?.shift())) {
|
|
1019
|
+
this.#disposeAfter?.(...task);
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
#evict(free) {
|
|
1025
|
+
const head = this.#head;
|
|
1026
|
+
const k = this.#keyList[head];
|
|
1027
|
+
const v = this.#valList[head];
|
|
1028
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
|
|
1029
|
+
v.__abortController.abort(new Error('evicted'));
|
|
1030
|
+
}
|
|
1031
|
+
else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
1032
|
+
if (this.#hasDispose) {
|
|
1033
|
+
this.#dispose?.(v, k, 'evict');
|
|
1034
|
+
}
|
|
1035
|
+
if (this.#hasDisposeAfter) {
|
|
1036
|
+
this.#disposed?.push([v, k, 'evict']);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
this.#removeItemSize(head);
|
|
1040
|
+
// if we aren't about to use the index, then null these out
|
|
1041
|
+
if (free) {
|
|
1042
|
+
this.#keyList[head] = undefined;
|
|
1043
|
+
this.#valList[head] = undefined;
|
|
1044
|
+
this.#free.push(head);
|
|
1045
|
+
}
|
|
1046
|
+
if (this.#size === 1) {
|
|
1047
|
+
this.#head = this.#tail = 0;
|
|
1048
|
+
this.#free.length = 0;
|
|
1049
|
+
}
|
|
1050
|
+
else {
|
|
1051
|
+
this.#head = this.#next[head];
|
|
1052
|
+
}
|
|
1053
|
+
this.#keyMap.delete(k);
|
|
1054
|
+
this.#size--;
|
|
1055
|
+
return head;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Check if a key is in the cache, without updating the recency of use.
|
|
1059
|
+
* Will return false if the item is stale, even though it is technically
|
|
1060
|
+
* in the cache.
|
|
1061
|
+
*
|
|
1062
|
+
* Check if a key is in the cache, without updating the recency of
|
|
1063
|
+
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
1064
|
+
* to `true` in either the options or the constructor.
|
|
1065
|
+
*
|
|
1066
|
+
* Will return `false` if the item is stale, even though it is technically in
|
|
1067
|
+
* the cache. The difference can be determined (if it matters) by using a
|
|
1068
|
+
* `status` argument, and inspecting the `has` field.
|
|
1069
|
+
*
|
|
1070
|
+
* Will not update item age unless
|
|
1071
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
1072
|
+
*/
|
|
1073
|
+
has(k, hasOptions = {}) {
|
|
1074
|
+
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
|
1075
|
+
const index = this.#keyMap.get(k);
|
|
1076
|
+
if (index !== undefined) {
|
|
1077
|
+
const v = this.#valList[index];
|
|
1078
|
+
if (this.#isBackgroundFetch(v) &&
|
|
1079
|
+
v.__staleWhileFetching === undefined) {
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
if (!this.#isStale(index)) {
|
|
1083
|
+
if (updateAgeOnHas) {
|
|
1084
|
+
this.#updateItemAge(index);
|
|
1085
|
+
}
|
|
1086
|
+
if (status) {
|
|
1087
|
+
status.has = 'hit';
|
|
1088
|
+
this.#statusTTL(status, index);
|
|
1089
|
+
}
|
|
1090
|
+
return true;
|
|
1091
|
+
}
|
|
1092
|
+
else if (status) {
|
|
1093
|
+
status.has = 'stale';
|
|
1094
|
+
this.#statusTTL(status, index);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
else if (status) {
|
|
1098
|
+
status.has = 'miss';
|
|
1099
|
+
}
|
|
1100
|
+
return false;
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Like {@link LRUCache#get} but doesn't update recency or delete stale
|
|
1104
|
+
* items.
|
|
1105
|
+
*
|
|
1106
|
+
* Returns `undefined` if the item is stale, unless
|
|
1107
|
+
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
1108
|
+
*/
|
|
1109
|
+
peek(k, peekOptions = {}) {
|
|
1110
|
+
const { allowStale = this.allowStale } = peekOptions;
|
|
1111
|
+
const index = this.#keyMap.get(k);
|
|
1112
|
+
if (index === undefined ||
|
|
1113
|
+
(!allowStale && this.#isStale(index))) {
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const v = this.#valList[index];
|
|
1117
|
+
// either stale and allowed, or forcing a refresh of non-stale value
|
|
1118
|
+
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
1119
|
+
}
|
|
1120
|
+
#backgroundFetch(k, index, options, context) {
|
|
1121
|
+
const v = index === undefined ? undefined : this.#valList[index];
|
|
1122
|
+
if (this.#isBackgroundFetch(v)) {
|
|
1123
|
+
return v;
|
|
1124
|
+
}
|
|
1125
|
+
const ac = new AC();
|
|
1126
|
+
const { signal } = options;
|
|
1127
|
+
// when/if our AC signals, then stop listening to theirs.
|
|
1128
|
+
signal?.addEventListener('abort', () => ac.abort(signal.reason), {
|
|
1129
|
+
signal: ac.signal,
|
|
1130
|
+
});
|
|
1131
|
+
const fetchOpts = {
|
|
1132
|
+
signal: ac.signal,
|
|
1133
|
+
options,
|
|
1134
|
+
context,
|
|
1135
|
+
};
|
|
1136
|
+
const cb = (v, updateCache = false) => {
|
|
1137
|
+
const { aborted } = ac.signal;
|
|
1138
|
+
const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
|
|
1139
|
+
if (options.status) {
|
|
1140
|
+
if (aborted && !updateCache) {
|
|
1141
|
+
options.status.fetchAborted = true;
|
|
1142
|
+
options.status.fetchError = ac.signal.reason;
|
|
1143
|
+
if (ignoreAbort)
|
|
1144
|
+
options.status.fetchAbortIgnored = true;
|
|
1145
|
+
}
|
|
1146
|
+
else {
|
|
1147
|
+
options.status.fetchResolved = true;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
if (aborted && !ignoreAbort && !updateCache) {
|
|
1151
|
+
return fetchFail(ac.signal.reason);
|
|
1152
|
+
}
|
|
1153
|
+
// either we didn't abort, and are still here, or we did, and ignored
|
|
1154
|
+
const bf = p;
|
|
1155
|
+
if (this.#valList[index] === p) {
|
|
1156
|
+
if (v === undefined) {
|
|
1157
|
+
if (bf.__staleWhileFetching) {
|
|
1158
|
+
this.#valList[index] = bf.__staleWhileFetching;
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
this.#delete(k, 'fetch');
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
else {
|
|
1165
|
+
if (options.status)
|
|
1166
|
+
options.status.fetchUpdated = true;
|
|
1167
|
+
this.set(k, v, fetchOpts.options);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
return v;
|
|
1171
|
+
};
|
|
1172
|
+
const eb = (er) => {
|
|
1173
|
+
if (options.status) {
|
|
1174
|
+
options.status.fetchRejected = true;
|
|
1175
|
+
options.status.fetchError = er;
|
|
1176
|
+
}
|
|
1177
|
+
return fetchFail(er);
|
|
1178
|
+
};
|
|
1179
|
+
const fetchFail = (er) => {
|
|
1180
|
+
const { aborted } = ac.signal;
|
|
1181
|
+
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
|
1182
|
+
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
1183
|
+
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
1184
|
+
const bf = p;
|
|
1185
|
+
if (this.#valList[index] === p) {
|
|
1186
|
+
// if we allow stale on fetch rejections, then we need to ensure that
|
|
1187
|
+
// the stale value is not removed from the cache when the fetch fails.
|
|
1188
|
+
const del = !noDelete || bf.__staleWhileFetching === undefined;
|
|
1189
|
+
if (del) {
|
|
1190
|
+
this.#delete(k, 'fetch');
|
|
1191
|
+
}
|
|
1192
|
+
else if (!allowStaleAborted) {
|
|
1193
|
+
// still replace the *promise* with the stale value,
|
|
1194
|
+
// since we are done with the promise at this point.
|
|
1195
|
+
// leave it untouched if we're still waiting for an
|
|
1196
|
+
// aborted background fetch that hasn't yet returned.
|
|
1197
|
+
this.#valList[index] = bf.__staleWhileFetching;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
if (allowStale) {
|
|
1201
|
+
if (options.status && bf.__staleWhileFetching !== undefined) {
|
|
1202
|
+
options.status.returnedStale = true;
|
|
1203
|
+
}
|
|
1204
|
+
return bf.__staleWhileFetching;
|
|
1205
|
+
}
|
|
1206
|
+
else if (bf.__returned === bf) {
|
|
1207
|
+
throw er;
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
const pcall = (res, rej) => {
|
|
1211
|
+
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
1212
|
+
if (fmp && fmp instanceof Promise) {
|
|
1213
|
+
fmp.then(v => res(v === undefined ? undefined : v), rej);
|
|
1214
|
+
}
|
|
1215
|
+
// ignored, we go until we finish, regardless.
|
|
1216
|
+
// defer check until we are actually aborting,
|
|
1217
|
+
// so fetchMethod can override.
|
|
1218
|
+
ac.signal.addEventListener('abort', () => {
|
|
1219
|
+
if (!options.ignoreFetchAbort ||
|
|
1220
|
+
options.allowStaleOnFetchAbort) {
|
|
1221
|
+
res(undefined);
|
|
1222
|
+
// when it eventually resolves, update the cache.
|
|
1223
|
+
if (options.allowStaleOnFetchAbort) {
|
|
1224
|
+
res = v => cb(v, true);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
};
|
|
1229
|
+
if (options.status)
|
|
1230
|
+
options.status.fetchDispatched = true;
|
|
1231
|
+
const p = new Promise(pcall).then(cb, eb);
|
|
1232
|
+
const bf = Object.assign(p, {
|
|
1233
|
+
__abortController: ac,
|
|
1234
|
+
__staleWhileFetching: v,
|
|
1235
|
+
__returned: undefined,
|
|
1236
|
+
});
|
|
1237
|
+
if (index === undefined) {
|
|
1238
|
+
// internal, don't expose status.
|
|
1239
|
+
this.set(k, bf, { ...fetchOpts.options, status: undefined });
|
|
1240
|
+
index = this.#keyMap.get(k);
|
|
1241
|
+
}
|
|
1242
|
+
else {
|
|
1243
|
+
this.#valList[index] = bf;
|
|
1244
|
+
}
|
|
1245
|
+
return bf;
|
|
1246
|
+
}
|
|
1247
|
+
#isBackgroundFetch(p) {
|
|
1248
|
+
if (!this.#hasFetchMethod)
|
|
1249
|
+
return false;
|
|
1250
|
+
const b = p;
|
|
1251
|
+
return (!!b &&
|
|
1252
|
+
b instanceof Promise &&
|
|
1253
|
+
b.hasOwnProperty('__staleWhileFetching') &&
|
|
1254
|
+
b.__abortController instanceof AC);
|
|
1255
|
+
}
|
|
1256
|
+
async fetch(k, fetchOptions = {}) {
|
|
1257
|
+
const {
|
|
1258
|
+
// get options
|
|
1259
|
+
allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
|
1260
|
+
// set options
|
|
1261
|
+
ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL,
|
|
1262
|
+
// fetch exclusive options
|
|
1263
|
+
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
|
|
1264
|
+
if (!this.#hasFetchMethod) {
|
|
1265
|
+
if (status)
|
|
1266
|
+
status.fetch = 'get';
|
|
1267
|
+
return this.get(k, {
|
|
1268
|
+
allowStale,
|
|
1269
|
+
updateAgeOnGet,
|
|
1270
|
+
noDeleteOnStaleGet,
|
|
1271
|
+
status,
|
|
1272
|
+
});
|
|
1273
|
+
}
|
|
1274
|
+
const options = {
|
|
1275
|
+
allowStale,
|
|
1276
|
+
updateAgeOnGet,
|
|
1277
|
+
noDeleteOnStaleGet,
|
|
1278
|
+
ttl,
|
|
1279
|
+
noDisposeOnSet,
|
|
1280
|
+
size,
|
|
1281
|
+
sizeCalculation,
|
|
1282
|
+
noUpdateTTL,
|
|
1283
|
+
noDeleteOnFetchRejection,
|
|
1284
|
+
allowStaleOnFetchRejection,
|
|
1285
|
+
allowStaleOnFetchAbort,
|
|
1286
|
+
ignoreFetchAbort,
|
|
1287
|
+
status,
|
|
1288
|
+
signal,
|
|
1289
|
+
};
|
|
1290
|
+
let index = this.#keyMap.get(k);
|
|
1291
|
+
if (index === undefined) {
|
|
1292
|
+
if (status)
|
|
1293
|
+
status.fetch = 'miss';
|
|
1294
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
|
1295
|
+
return (p.__returned = p);
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
// in cache, maybe already fetching
|
|
1299
|
+
const v = this.#valList[index];
|
|
1300
|
+
if (this.#isBackgroundFetch(v)) {
|
|
1301
|
+
const stale = allowStale && v.__staleWhileFetching !== undefined;
|
|
1302
|
+
if (status) {
|
|
1303
|
+
status.fetch = 'inflight';
|
|
1304
|
+
if (stale)
|
|
1305
|
+
status.returnedStale = true;
|
|
1306
|
+
}
|
|
1307
|
+
return stale ? v.__staleWhileFetching : (v.__returned = v);
|
|
1308
|
+
}
|
|
1309
|
+
// if we force a refresh, that means do NOT serve the cached value,
|
|
1310
|
+
// unless we are already in the process of refreshing the cache.
|
|
1311
|
+
const isStale = this.#isStale(index);
|
|
1312
|
+
if (!forceRefresh && !isStale) {
|
|
1313
|
+
if (status)
|
|
1314
|
+
status.fetch = 'hit';
|
|
1315
|
+
this.#moveToTail(index);
|
|
1316
|
+
if (updateAgeOnGet) {
|
|
1317
|
+
this.#updateItemAge(index);
|
|
1318
|
+
}
|
|
1319
|
+
if (status)
|
|
1320
|
+
this.#statusTTL(status, index);
|
|
1321
|
+
return v;
|
|
1322
|
+
}
|
|
1323
|
+
// ok, it is stale or a forced refresh, and not already fetching.
|
|
1324
|
+
// refresh the cache.
|
|
1325
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
|
1326
|
+
const hasStale = p.__staleWhileFetching !== undefined;
|
|
1327
|
+
const staleVal = hasStale && allowStale;
|
|
1328
|
+
if (status) {
|
|
1329
|
+
status.fetch = isStale ? 'stale' : 'refresh';
|
|
1330
|
+
if (staleVal && isStale)
|
|
1331
|
+
status.returnedStale = true;
|
|
1332
|
+
}
|
|
1333
|
+
return staleVal ? p.__staleWhileFetching : (p.__returned = p);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
async forceFetch(k, fetchOptions = {}) {
|
|
1337
|
+
const v = await this.fetch(k, fetchOptions);
|
|
1338
|
+
if (v === undefined)
|
|
1339
|
+
throw new Error('fetch() returned undefined');
|
|
1340
|
+
return v;
|
|
1341
|
+
}
|
|
1342
|
+
memo(k, memoOptions = {}) {
|
|
1343
|
+
const memoMethod = this.#memoMethod;
|
|
1344
|
+
if (!memoMethod) {
|
|
1345
|
+
throw new Error('no memoMethod provided to constructor');
|
|
1346
|
+
}
|
|
1347
|
+
const { context, forceRefresh, ...options } = memoOptions;
|
|
1348
|
+
const v = this.get(k, options);
|
|
1349
|
+
if (!forceRefresh && v !== undefined)
|
|
1350
|
+
return v;
|
|
1351
|
+
const vv = memoMethod(k, v, {
|
|
1352
|
+
options,
|
|
1353
|
+
context,
|
|
1354
|
+
});
|
|
1355
|
+
this.set(k, vv, options);
|
|
1356
|
+
return vv;
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Return a value from the cache. Will update the recency of the cache
|
|
1360
|
+
* entry found.
|
|
1361
|
+
*
|
|
1362
|
+
* If the key is not found, get() will return `undefined`.
|
|
1363
|
+
*/
|
|
1364
|
+
get(k, getOptions = {}) {
|
|
1365
|
+
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
|
|
1366
|
+
const index = this.#keyMap.get(k);
|
|
1367
|
+
if (index !== undefined) {
|
|
1368
|
+
const value = this.#valList[index];
|
|
1369
|
+
const fetching = this.#isBackgroundFetch(value);
|
|
1370
|
+
if (status)
|
|
1371
|
+
this.#statusTTL(status, index);
|
|
1372
|
+
if (this.#isStale(index)) {
|
|
1373
|
+
if (status)
|
|
1374
|
+
status.get = 'stale';
|
|
1375
|
+
// delete only if not an in-flight background fetch
|
|
1376
|
+
if (!fetching) {
|
|
1377
|
+
if (!noDeleteOnStaleGet) {
|
|
1378
|
+
this.#delete(k, 'expire');
|
|
1379
|
+
}
|
|
1380
|
+
if (status && allowStale)
|
|
1381
|
+
status.returnedStale = true;
|
|
1382
|
+
return allowStale ? value : undefined;
|
|
1383
|
+
}
|
|
1384
|
+
else {
|
|
1385
|
+
if (status &&
|
|
1386
|
+
allowStale &&
|
|
1387
|
+
value.__staleWhileFetching !== undefined) {
|
|
1388
|
+
status.returnedStale = true;
|
|
1389
|
+
}
|
|
1390
|
+
return allowStale ? value.__staleWhileFetching : undefined;
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
else {
|
|
1394
|
+
if (status)
|
|
1395
|
+
status.get = 'hit';
|
|
1396
|
+
// if we're currently fetching it, we don't actually have it yet
|
|
1397
|
+
// it's not stale, which means this isn't a staleWhileRefetching.
|
|
1398
|
+
// If it's not stale, and fetching, AND has a __staleWhileFetching
|
|
1399
|
+
// value, then that means the user fetched with {forceRefresh:true},
|
|
1400
|
+
// so it's safe to return that value.
|
|
1401
|
+
if (fetching) {
|
|
1402
|
+
return value.__staleWhileFetching;
|
|
1403
|
+
}
|
|
1404
|
+
this.#moveToTail(index);
|
|
1405
|
+
if (updateAgeOnGet) {
|
|
1406
|
+
this.#updateItemAge(index);
|
|
1407
|
+
}
|
|
1408
|
+
return value;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
else if (status) {
|
|
1412
|
+
status.get = 'miss';
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
#connect(p, n) {
|
|
1416
|
+
this.#prev[n] = p;
|
|
1417
|
+
this.#next[p] = n;
|
|
1418
|
+
}
|
|
1419
|
+
#moveToTail(index) {
|
|
1420
|
+
// if tail already, nothing to do
|
|
1421
|
+
// if head, move head to next[index]
|
|
1422
|
+
// else
|
|
1423
|
+
// move next[prev[index]] to next[index] (head has no prev)
|
|
1424
|
+
// move prev[next[index]] to prev[index]
|
|
1425
|
+
// prev[index] = tail
|
|
1426
|
+
// next[tail] = index
|
|
1427
|
+
// tail = index
|
|
1428
|
+
if (index !== this.#tail) {
|
|
1429
|
+
if (index === this.#head) {
|
|
1430
|
+
this.#head = this.#next[index];
|
|
1431
|
+
}
|
|
1432
|
+
else {
|
|
1433
|
+
this.#connect(this.#prev[index], this.#next[index]);
|
|
1434
|
+
}
|
|
1435
|
+
this.#connect(this.#tail, index);
|
|
1436
|
+
this.#tail = index;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Deletes a key out of the cache.
|
|
1441
|
+
*
|
|
1442
|
+
* Returns true if the key was deleted, false otherwise.
|
|
1443
|
+
*/
|
|
1444
|
+
delete(k) {
|
|
1445
|
+
return this.#delete(k, 'delete');
|
|
1446
|
+
}
|
|
1447
|
+
#delete(k, reason) {
|
|
1448
|
+
let deleted = false;
|
|
1449
|
+
if (this.#size !== 0) {
|
|
1450
|
+
const index = this.#keyMap.get(k);
|
|
1451
|
+
if (index !== undefined) {
|
|
1452
|
+
deleted = true;
|
|
1453
|
+
if (this.#size === 1) {
|
|
1454
|
+
this.#clear(reason);
|
|
1455
|
+
}
|
|
1456
|
+
else {
|
|
1457
|
+
this.#removeItemSize(index);
|
|
1458
|
+
const v = this.#valList[index];
|
|
1459
|
+
if (this.#isBackgroundFetch(v)) {
|
|
1460
|
+
v.__abortController.abort(new Error('deleted'));
|
|
1461
|
+
}
|
|
1462
|
+
else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
1463
|
+
if (this.#hasDispose) {
|
|
1464
|
+
this.#dispose?.(v, k, reason);
|
|
1465
|
+
}
|
|
1466
|
+
if (this.#hasDisposeAfter) {
|
|
1467
|
+
this.#disposed?.push([v, k, reason]);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
this.#keyMap.delete(k);
|
|
1471
|
+
this.#keyList[index] = undefined;
|
|
1472
|
+
this.#valList[index] = undefined;
|
|
1473
|
+
if (index === this.#tail) {
|
|
1474
|
+
this.#tail = this.#prev[index];
|
|
1475
|
+
}
|
|
1476
|
+
else if (index === this.#head) {
|
|
1477
|
+
this.#head = this.#next[index];
|
|
1478
|
+
}
|
|
1479
|
+
else {
|
|
1480
|
+
const pi = this.#prev[index];
|
|
1481
|
+
this.#next[pi] = this.#next[index];
|
|
1482
|
+
const ni = this.#next[index];
|
|
1483
|
+
this.#prev[ni] = this.#prev[index];
|
|
1484
|
+
}
|
|
1485
|
+
this.#size--;
|
|
1486
|
+
this.#free.push(index);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
|
1491
|
+
const dt = this.#disposed;
|
|
1492
|
+
let task;
|
|
1493
|
+
while ((task = dt?.shift())) {
|
|
1494
|
+
this.#disposeAfter?.(...task);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
return deleted;
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Clear the cache entirely, throwing away all values.
|
|
1501
|
+
*/
|
|
1502
|
+
clear() {
|
|
1503
|
+
return this.#clear('delete');
|
|
1504
|
+
}
|
|
1505
|
+
#clear(reason) {
|
|
1506
|
+
for (const index of this.#rindexes({ allowStale: true })) {
|
|
1507
|
+
const v = this.#valList[index];
|
|
1508
|
+
if (this.#isBackgroundFetch(v)) {
|
|
1509
|
+
v.__abortController.abort(new Error('deleted'));
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
const k = this.#keyList[index];
|
|
1513
|
+
if (this.#hasDispose) {
|
|
1514
|
+
this.#dispose?.(v, k, reason);
|
|
1515
|
+
}
|
|
1516
|
+
if (this.#hasDisposeAfter) {
|
|
1517
|
+
this.#disposed?.push([v, k, reason]);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
this.#keyMap.clear();
|
|
1522
|
+
this.#valList.fill(undefined);
|
|
1523
|
+
this.#keyList.fill(undefined);
|
|
1524
|
+
if (this.#ttls && this.#starts) {
|
|
1525
|
+
this.#ttls.fill(0);
|
|
1526
|
+
this.#starts.fill(0);
|
|
1527
|
+
}
|
|
1528
|
+
if (this.#sizes) {
|
|
1529
|
+
this.#sizes.fill(0);
|
|
1530
|
+
}
|
|
1531
|
+
this.#head = 0;
|
|
1532
|
+
this.#tail = 0;
|
|
1533
|
+
this.#free.length = 0;
|
|
1534
|
+
this.#calculatedSize = 0;
|
|
1535
|
+
this.#size = 0;
|
|
1536
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
|
1537
|
+
const dt = this.#disposed;
|
|
1538
|
+
let task;
|
|
1539
|
+
while ((task = dt?.shift())) {
|
|
1540
|
+
this.#disposeAfter?.(...task);
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
exports.LRUCache = LRUCache;
|
|
1546
|
+
//# sourceMappingURL=index.js.map
|