diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a016fe6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +name: Test + +on: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm test diff --git a/.vscode/settings.json b/.vscode/settings.json index 5ac2dcc..4aa7374 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,5 @@ //"src/**/*.js": true, //"test/**/*.js": true }, - "typescript.tsdk": "node_modules/typescript/lib" - + "js/ts.tsdk.path": "node_modules/typescript/lib" } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 9337ec7..1ef2a7b 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,15 +1,17 @@ { - "version": "0.1.0", - "command": "gulp", - "isShellCommand": true, - "args": [ - "--no-color" - ], + "version": "2.0.0", "tasks": [ - { - "taskName": "build", - "isBuildCommand": true, - "showOutput": "always" - } - ] + { + "label": "build", + "type": "npm", + "script": "build", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always" + } + } + ] } diff --git a/dist/lib/sequential-task-queue.js b/dist/lib/sequential-task-queue.js index 5aedd75..d407818 100644 --- a/dist/lib/sequential-task-queue.js +++ b/dist/lib/sequential-task-queue.js @@ -1,4 +1,6 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SequentialTaskQueue = exports.sequentialTaskQueueEvents = exports.cancellationTokenReasons = void 0; /** * Standard cancellation reasons. {@link SequentialTaskQueue} sets {@link CancellationToken.reason} * to one of these values when cancelling a task for a reason other than the user code calling @@ -22,6 +24,10 @@ exports.sequentialTaskQueueEvents = { * FIFO task queue to run tasks in predictable order, without concurrency. */ class SequentialTaskQueue { + /** Indicates if the queue has been closed. Calling {@link SequentialTaskQueue.push} on a closed queue will result in an exception. */ + get isClosed() { + return this._isClosed; + } /** * Creates a new instance of {@link SequentialTaskQueue} * @param options - Configuration options for the task queue. @@ -36,15 +42,11 @@ class SequentialTaskQueue { this.name = options.name || "SequentialTaskQueue"; this.scheduler = options.scheduler || SequentialTaskQueue.defaultScheduler; } - /** Indicates if the queue has been closed. Calling {@link SequentialTaskQueue.push} on a closed queue will result in an exception. */ - get isClosed() { - return this._isClosed; - } /** * Adds a new task to the queue. - * @param task - The function to call when the task is run - * @param timeout - An optional timeout (in milliseconds) for the task, after which it should be cancelled to avoid hanging tasks clogging up the queue. - * @returns A {@link CancellationToken} that may be used to cancel the task before it completes. + * @param {Function} task - The function to call when the task is run + * @param {TaskOptions} options - An object containing arguments and options for the task. + * @returns {CancellablePromiseLike} A promise that can be used to await or cancel the task. */ push(task, options) { if (this._isClosed) @@ -71,15 +73,16 @@ class SequentialTaskQueue { } /** * Cancels the currently running task (if any), and clears the queue. + * @param {any} reason - The reason of the cancellation, see {@link CancellationToken.reason}. Defaults to {@link cancellationTokenReasons.cancel}. * @returns {Promise} A Promise that is fulfilled when the queue is empty and the current task has been cancelled. */ - cancel() { + cancel(reason = exports.cancellationTokenReasons.cancel) { if (this.currentTask) - this.cancelTask(this.currentTask, exports.cancellationTokenReasons.cancel); + this.cancelTask(this.currentTask, reason); var queue = this.queue.splice(0); // Cancel all and emit a drained event if there were tasks waiting in the queue if (queue.length) { - queue.forEach(task => this.cancelTask(task, exports.cancellationTokenReasons.cancel)); + queue.forEach(task => this.cancelTask(task, reason)); this.emit(exports.sequentialTaskQueueEvents.drained); } return this.wait(); @@ -88,13 +91,14 @@ class SequentialTaskQueue { * Closes the queue, preventing new tasks to be added. * Any calls to {@link SequentialTaskQueue.push} after closing the queue will result in an exception. * @param {boolean} cancel - Indicates that the queue should also be cancelled. + * @param {any} reason - The reason of the cancellation, passed to {@link SequentialTaskQueue.cancel} when `cancel` is `true`. * @returns {Promise} A Promise that is fulfilled when the queue has finished executing remaining tasks. */ - close(cancel) { + close(cancel, reason) { if (!this._isClosed) { this._isClosed = true; if (cancel) - return this.cancel(); + return this.cancel(reason); } return this.wait(); } @@ -234,10 +238,10 @@ class SequentialTaskQueue { waiters.forEach(waiter => waiter()); } } +exports.SequentialTaskQueue = SequentialTaskQueue; SequentialTaskQueue.defaultScheduler = { schedule: callback => setTimeout(callback, 0) }; -exports.SequentialTaskQueue = SequentialTaskQueue; function noop() { } function isPromise(obj) { @@ -248,3 +252,4 @@ SequentialTaskQueue.defaultScheduler = { ? callback => setImmediate(callback) : callback => setTimeout(callback, 0) }; +//# sourceMappingURL=sequential-task-queue.js.map \ No newline at end of file diff --git a/dist/lib/sequential-task-queue.js.map b/dist/lib/sequential-task-queue.js.map new file mode 100644 index 0000000..d7c2d03 --- /dev/null +++ b/dist/lib/sequential-task-queue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sequential-task-queue.js","sourceRoot":"","sources":["../../src/sequential-task-queue.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/dist/types/sequential-task-queue.d.ts b/dist/types/sequential-task-queue.d.ts index a74a185..026a9b2 100644 --- a/dist/types/sequential-task-queue.d.ts +++ b/dist/types/sequential-task-queue.d.ts @@ -74,7 +74,9 @@ export interface CancellationToken { * {@link CancellationToken.cancel}. */ export declare var cancellationTokenReasons: { + /** Used when the task was cancelled in response to a call to {@link SequentialTaskQueue.cancel} */ cancel: any; + /** Used when the task was cancelled after its timeout has passed */ timeout: any; }; /** @@ -109,7 +111,7 @@ export declare class SequentialTaskQueue { private events; name: string; /** Indicates if the queue has been closed. Calling {@link SequentialTaskQueue.push} on a closed queue will result in an exception. */ - readonly isClosed: boolean; + get isClosed(): boolean; /** * Creates a new instance of {@link SequentialTaskQueue} * @param options - Configuration options for the task queue. @@ -117,23 +119,25 @@ export declare class SequentialTaskQueue { constructor(options?: SequentialTaskQueueOptions); /** * Adds a new task to the queue. - * @param task - The function to call when the task is run - * @param timeout - An optional timeout (in milliseconds) for the task, after which it should be cancelled to avoid hanging tasks clogging up the queue. - * @returns A {@link CancellationToken} that may be used to cancel the task before it completes. + * @param {Function} task - The function to call when the task is run + * @param {TaskOptions} options - An object containing arguments and options for the task. + * @returns {CancellablePromiseLike} A promise that can be used to await or cancel the task. */ push(task: Function, options?: TaskOptions): CancellablePromiseLike; /** * Cancels the currently running task (if any), and clears the queue. + * @param {any} reason - The reason of the cancellation, see {@link CancellationToken.reason}. Defaults to {@link cancellationTokenReasons.cancel}. * @returns {Promise} A Promise that is fulfilled when the queue is empty and the current task has been cancelled. */ - cancel(): PromiseLike; + cancel(reason?: any): PromiseLike; /** * Closes the queue, preventing new tasks to be added. * Any calls to {@link SequentialTaskQueue.push} after closing the queue will result in an exception. * @param {boolean} cancel - Indicates that the queue should also be cancelled. + * @param {any} reason - The reason of the cancellation, passed to {@link SequentialTaskQueue.cancel} when `cancel` is `true`. * @returns {Promise} A Promise that is fulfilled when the queue has finished executing remaining tasks. */ - close(cancel?: boolean): PromiseLike; + close(cancel?: boolean, reason?: any): PromiseLike; /** * Returns a promise that is fulfilled when the queue is empty. * @returns {Promise} @@ -161,7 +165,7 @@ export declare class SequentialTaskQueue { off(evt: string, handler: Function): void; protected emit(evt: string, ...args: any[]): void; protected next(): void; - private cancelTask(task, reason?); - private doneTask(task, error?); - private callWaiters(); + private cancelTask; + private doneTask; + private callWaiters; } diff --git a/examples/examples.ts b/examples/examples.ts index 94bf3dd..b1282bf 100644 --- a/examples/examples.ts +++ b/examples/examples.ts @@ -1,6 +1,6 @@ -import * as assert from "assert"; +import assert from "assert"; import { SequentialTaskQueue, CancellationToken, cancellationTokenReasons } from "../src/sequential-task-queue"; -import * as sinon from "sinon"; +import sinon from "sinon"; describe("Examples", () => { describe("Basic usage", () => { @@ -34,7 +34,7 @@ describe("Examples", () => { console.log("1"); }); queue.push(() => { - return new Promise(resolve => { + return new Promise(resolve => { setTimeout(() => { console.log("2"); resolve(); @@ -74,10 +74,10 @@ describe("Examples", () => { it("", () => { // --- snippet: Task cancellation --- var queue = new SequentialTaskQueue(); - var task = queue.push(token => { + var task = queue.push((token: CancellationToken) => { return new Promise((resolve, reject) => { setTimeout(resolve, 100); - }).then(() => new Promise((resolve, reject) => { + }).then(() => new Promise((resolve, reject) => { if (token.cancelled) reject(); else @@ -102,21 +102,21 @@ describe("Examples", () => { var resp = []; var timeouts = [20, 2000, 10]; var backend = { - echo: query => new Promise(resolve => { - setTimeout(() => resolve(query), timeouts.shift()); + echo: (query: string) => new Promise(resolve => { + setTimeout(() => resolve(query), timeouts.shift() || 0); }), }; var state = { list: [], - addResponse: function(response) { + addResponse: (response: string) => { this.list.push(response); } }; // --- snip --- var queue = new SequentialTaskQueue(); // ... - function onEcho(query) { - queue.push(token => + function onEcho(query: string) { + queue.push((token: CancellationToken) => backend.echo(query).then(response => { if (!token.cancelled) { state.addResponse("Server responded: " + response); @@ -133,7 +133,7 @@ describe("Examples", () => { describe("Arguments", () => { it("Without using args", function() { - var handler: Function; + var handler!: Function; var backend = { on: (evt: string, cb: Function) => { handler = cb; @@ -142,7 +142,7 @@ describe("Examples", () => { sinon.spy(console, "log"); var queue = new SequentialTaskQueue(); // --- snippet: Arguments 1 --- - backend.on("notification", (data) => { + backend.on("notification", (data: string) => { queue.push(() => { console.log(data); // todo: do something with data @@ -163,7 +163,7 @@ describe("Examples", () => { }); it("With args", function() { - var handler: Function; + var handler!: Function; var backend = { on: (evt: string, cb: Function) => { handler = cb; @@ -172,11 +172,11 @@ describe("Examples", () => { sinon.spy(console, "log"); var queue = new SequentialTaskQueue(); // --- snippet: Arguments 2 --- - backend.on("notification", (data) => { + backend.on("notification", (data: string) => { queue.push(handleNotifiation, { args: data }); }); - function handleNotifiation(data) { + function handleNotifiation(data: string) { console.log(data); // todo: do something with data } @@ -215,12 +215,12 @@ describe("Examples", () => { // --- snippet: Close --- var queue = new SequentialTaskQueue(); // ... - function deactivate(done) { + function deactivate(done: () => void) { queue.close(true).then(done); } // --- snip --- queue.push(() => new Promise(resolve => setTimeout(resolve, 500))); - return new Promise(resolve => { + return new Promise(resolve => { deactivate(resolve); }); }); diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index f8f1ceb..0000000 --- a/gulpfile.js +++ /dev/null @@ -1,123 +0,0 @@ -var gulp = require("gulp"); -var ts = require("gulp-typescript"); -var mocha = require("gulp-mocha"); -var sourceMaps = require("gulp-sourcemaps"); -var snip = require("snip-text"); -var template = require("gulp-template"); -var rename = require("gulp-rename"); -var fs = require("fs"); -var del = require("del"); -var sequence = require("run-sequence"); -var typedoc = require("gulp-typedoc"); -var vinylPaths = require("vinyl-paths"); - -var globs = { - build: ["./src/**/*.ts"], - testSource: ["./src/**/*.ts", "./test/**/*.ts", "./examples/**/*.ts"], - test: ["./test/**/*.js"], - docTemplates: ["./src/*.template.md"] -}; - -gulp.task("doc:readme", function () { - var examples = fs.readFileSync("./examples/examples.ts", "utf8"); - var data = { - examples: snip(examples, { unindent: true }) - }; - return gulp.src(globs.docTemplates) - .pipe(template(data)) - .pipe(rename(path => { - path.basename = path.basename.replace(".template", ""); - return path; - })) - .pipe(gulp.dest(".")); -}); - -gulp.task("clean:api", function () { - return del("./doc/api"); -}); - -gulp.task("doc:api", ["clean:api"], function () { - return gulp.src(globs.build) - .pipe(typedoc({ - target: "es6", - out: "./doc/api", - name: "SequentialTaskQueue", - })); -}); - -gulp.task("doc", ["doc:readme", "doc:api"], () => { }); - -gulp.task("test-compile", () => { - var proj = ts.createProject("tsconfig.json"); - - return gulp.src(globs.testSource) - .pipe(sourceMaps.init()) - .pipe(proj()) - .js - .pipe(sourceMaps.write(".", { includeContent: false, sourceRoot: "." })) - .pipe(gulp.dest(path => { - return path.base; - })); -}); - -gulp.task("test-run", () => { - return gulp.src(globs.test) - .pipe(mocha()); -}); - -gulp.task("test-run-debug", () => { - return gulp.src(globs.test) - .pipe(mocha({ enableTimeouts: false })); -}); - -gulp.task("test-clean", () => { - var p1 = gulp.src(globs.testSource) - .pipe(rename(path => { - if (path.extname == ".ts") - path.extname = ".js"; - })) - .pipe(vinylPaths(del)); - var p2 = gulp.src(globs.testSource) - .pipe(rename(path => { - if (path.extname == ".ts") - path.extname = ".js.map"; - })) - .pipe(vinylPaths(del)); - return Promise.all([p1, p2]); -}); - -gulp.task("test", () => { - return sequence("test-compile", "test-run", "test-clean"); -}); - -gulp.task("test-debug-exit", () => { - process.exit(); -}); - -gulp.task("test-debug", () => { - return sequence("test-compile", "test-run-debug", "test-clean", "test-debug-exit"); -}); - -gulp.task("clean", () => { - return del(["dist/**/*"]); -}); - -gulp.task("build-ts", () => { - var proj = ts.createProject("tsconfig.json"); - var result = gulp.src(globs.build) - .pipe(proj()); - return result.js.pipe(gulp.dest("dist/lib")); -}); - -gulp.task("build-dts", () => { - var proj = ts.createProject("tsconfig.json", { target: "es6" }); - var result = gulp.src(globs.build) - .pipe(proj()); - return result.dts.pipe(gulp.dest("dist/types")); -}); - -gulp.task("build", () => sequence("clean", "build-ts", "build-dts")); - -gulp.task("prepublish", () => { - return sequence("build", "test", "doc"); -}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..9bca057 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2063 @@ +{ + "name": "sequential-task-queue", + "version": "1.3.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sequential-task-queue", + "version": "1.3.0", + "devDependencies": { + "@types/mocha": "^2.2.39", + "@types/node": "^7.0.5", + "@types/sinon": "^1.16.35", + "lodash": "^4.17.21", + "mocha": "^10.0.0", + "rimraf": "^6.1.3", + "sinon": "^1.17.7", + "snip-text": "^1.0.0", + "ts-node": "^10.0.0", + "typedoc": "^0.28.20", + "typedoc-plugin-markdown": "^4.12.0", + "typescript": "^5.4.0" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.23.0.tgz", + "integrity": "sha512-bEMORlG0cqdjVyCEuU0cDQbORWX+kYCeo0kV1lbxF5bt4r7SID2l9bqsxJEM0zndaxpOUT7riCyIVEuqq/Ynxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.23.0", + "@shikijs/langs": "^3.23.0", + "@shikijs/themes": "^3.23.0", + "@shikijs/types": "^3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/types": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mocha": { + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "7.10.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.14.tgz", + "integrity": "sha512-29GS75BE8asnTno3yB6ubOJOO0FboExEqNJy4bpz0GSmW/8wPTNL4h9h63c6s1uTrOopCmJYe/4yJLh5r92ZUA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/sinon": { + "version": "1.16.36", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-1.16.36.tgz", + "integrity": "sha512-kfZ7gxF5TDKgs/P26mms3xvoBOjOPZdNiYm4GVepOaxpx4vYJy75tTn99nAwjovQ9Z61EHAfHLliahB6fkCB0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.4.tgz", + "integrity": "sha512-hGfVzPxthbf3+2yjg/RBs60cB0FhqBS/zvdV/4wn4/BmN0bNMMHPc4V/BbFieqf1TKAGGAHnY4eSjajCl0f2Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/call-bind": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", + "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/diff": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/formatio": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.1.1.tgz", + "integrity": "sha512-cPh7is6k3d8tIUh+pnXXuAbD/uhSXGgqLPw0UrYpv5lfdJ+MMMSjx40JNpqP7Top9Nt25YomWEiRmkHbOvkCaA==", + "deprecated": "This package is unmaintained. Use @sinonjs/formatio instead", + "dev": true, + "dependencies": { + "samsam": "~1.1" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/linkify-it": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz", + "integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lolex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", + "integrity": "sha512-YYp8cqz7/8eruZ15L1mzcPkvLYxipfdsWIDESvNdNmQP9o7TsDitRhNuV2xb7aFu2ofZngao1jiVrVZ842x4BQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/lru-cache": { + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/markdown-it": { + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.3.0.tgz", + "integrity": "sha512-RCEsPjR+sr0x+AuYp601tKTkgFG4YEPLCzHST3cQ/fhlJkqAkz1L2/Qbp1j9qw5SBwQHFBoW8+hoN5xssOF0Tw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/markdown-it" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.5.0", + "linkify-it": "^5.0.2", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mdurl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz", + "integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/samsam": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.1.2.tgz", + "integrity": "sha512-iVL7LibpM3tl4rQPweOXXrmjGegxx27flTOjQEZD3PXe4oZNFzuz6Si4mgleK/JWU/hyCvtV01RUovjvBEpDmw==", + "deprecated": "This package has been deprecated in favour of @sinonjs/samsam", + "dev": true + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/sinon": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.17.7.tgz", + "integrity": "sha512-M9rtyQxKfcTTdB64rpPSRaTzOvunb+HHPv/3PxvNPrEDnFSny95Pi6/3VoD471ody0ay0IHyzT3BErfcLXj6NA==", + "deprecated": "16.1.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "formatio": "1.1.1", + "lolex": "1.3.2", + "samsam": "1.1.2", + "util": ">=0.10.3 <1" + }, + "engines": { + "node": ">=0.1.103" + } + }, + "node_modules/snip-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/snip-text/-/snip-text-1.0.0.tgz", + "integrity": "sha512-iW8zg6dB/VdPlqIYsmIGFoM0//QBOAeb73budXaYP34Vl1Rs8RRcXXP5jLdlR+QsGnXKPKLijtokIoMoB6teyQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/typedoc": { + "version": "0.28.20", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.20.tgz", + "integrity": "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^3.23.0", + "lunr": "^2.3.9", + "markdown-it": "^14.3.0", + "minimatch": "^10.2.5", + "yaml": "^2.9.0" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18", + "pnpm": ">= 10" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" + } + }, + "node_modules/typedoc-plugin-markdown": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/typedoc-plugin-markdown/-/typedoc-plugin-markdown-4.12.0.tgz", + "integrity": "sha512-eJDEMAfxCmede22c/Jw7d0FA13ggAQv+KkwQYKYCdqI02cin6Rc9QRwbG/7XvvHWinuFejySnZVUWDtvGk3Vbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "typedoc": "0.28.x" + } + }, + "node_modules/typedoc/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/typedoc/node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/typedoc/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-typed-array": { + "version": "1.1.22", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.22.tgz", + "integrity": "sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yargs": { + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.2.tgz", + "integrity": "sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index e5beb38..10d2f8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sequential-task-queue", - "version": "1.2.1", + "version": "1.3.0", "description": "FIFO task queue for node and the browser", "author": { "name": "BalassaMarton" @@ -15,25 +15,29 @@ "doc", "index.js" ], + "scripts": { + "clean": "rimraf dist", + "clean:api": "rimraf doc/api", + "build": "npm run clean && tsc -p tsconfig.build.json", + "test": "mocha --require ts-node/register/transpile-only test/**/*.ts", + "test:debug": "mocha --timeout 0 --require ts-node/register/transpile-only test/**/*.ts", + "doc:readme": "node scripts/build-readme.js", + "doc:api": "npm run clean:api && typedoc --plugin typedoc-plugin-markdown --out doc/api --name SequentialTaskQueue src/sequential-task-queue.ts", + "doc": "npm run doc:readme && npm run doc:api", + "prepublishOnly": "npm run build && npm test && npm run doc" + }, "devDependencies": { "@types/mocha": "^2.2.39", "@types/node": "^7.0.5", "@types/sinon": "^1.16.35", - "del": "^2.2.2", - "gulp": "^3.9.1", - "gulp-mocha": "^3.0.1", - "gulp-rename": "^1.2.2", - "gulp-sourcemaps": "^2.4.1", - "gulp-template": "^4.0.0", - "gulp-typedoc": "^2.0.2", - "gulp-typescript": "^3.1.5", - "mocha": "^3.2.0", - "run-sequence": "^1.2.2", + "lodash": "^4.17.21", + "mocha": "^10.0.0", + "rimraf": "^6.1.3", "sinon": "^1.17.7", "snip-text": "^1.0.0", - "typedoc": "^0.5.6", - "typedoc-markdown-theme": "0.0.4", - "typescript": "^2.1.6", - "vinyl-paths": "^2.1.0" + "ts-node": "^10.0.0", + "typedoc": "^0.28.20", + "typedoc-plugin-markdown": "^4.12.0", + "typescript": "^5.4.0" } } diff --git a/readme.md b/readme.md index f4bad4a..acea302 100644 --- a/readme.md +++ b/readme.md @@ -10,12 +10,12 @@ This is especially useful when the application state is frequently mutated in re Use `push` to add tasks to the queue. The method returns a `Promise` that will fulfill when the task has been executed or cancelled. ```js -var queue = new SequentialTaskQueue(); -queue.push(() => { - console.log("first task"); -}); -queue.push(() => { - console.log("second task"); +var queue = new SequentialTaskQueue(); +queue.push(() => { + console.log("first task"); +}); +queue.push(() => { + console.log("second task"); }); ``` @@ -25,35 +25,35 @@ If the function passed to `push` returns a `Promise`, the queue will wait for it Rejected promises don't cause the queue to stop executing tasks, but are reported in the `error` event (see below). ```js -var queue = new SequentialTaskQueue(); -queue.push(() => { - console.log("1"); -}); -queue.push(() => { - return new Promise(resolve => { - setTimeout(() => { - console.log("2"); - resolve(); - }, 500); - }); -}); -queue.push(() => { - return new Promise((resolve, reject) => { - setTimeout(() => { - console.log("3"); - reject(); - }, 100); - }); -}); -queue.push(() => { - console.log("4"); -}); - -// Output: -// 1 -// 2 -// 3 -// 4 +var queue = new SequentialTaskQueue(); +queue.push(() => { + console.log("1"); +}); +queue.push(() => { + return new Promise(resolve => { + setTimeout(() => { + console.log("2"); + resolve(); + }, 500); + }); +}); +queue.push(() => { + return new Promise((resolve, reject) => { + setTimeout(() => { + console.log("3"); + reject(); + }, 100); + }); +}); +queue.push(() => { + console.log("4"); +}); + +// Output: +// 1 +// 2 +// 3 +// 4 ``` @@ -64,21 +64,21 @@ for every task pushed to the queue, and passing it (to the task function) as the has been cancelled. The `Promise` returned by `push` is extended with a `cancel` method so that individual tasks can be cancelled. ```js -var queue = new SequentialTaskQueue(); -var task = queue.push(token => { - return new Promise((resolve, reject) => { - setTimeout(resolve, 100); - }).then(() => new Promise((resolve, reject) => { - if (token.cancelled) - reject(); - else - resolve(); - })).then(() => { - throw new Error("Should not ever get here"); - }); -}); -setTimeout(() => { - task.cancel(); +var queue = new SequentialTaskQueue(); +var task = queue.push((token: CancellationToken) => { + return new Promise((resolve, reject) => { + setTimeout(resolve, 100); + }).then(() => new Promise((resolve, reject) => { + if (token.cancelled) + reject(); + else + resolve(); + })).then(() => { + throw new Error("Should not ever get here"); + }); +}); +setTimeout(() => { + task.cancel(); }, 50); ``` @@ -94,15 +94,15 @@ Tasks can be pushed into the queue with a timeout, after which the queue will ca The timeout value is supplied to `push` in the second argument, which is interpreted as an options object for the task: ```js -var queue = new SequentialTaskQueue(); -// ... -function onEcho(query) { - queue.push(token => - backend.echo(query).then(response => { - if (!token.cancelled) { - state.addResponse("Server responded: " + response); - } - }), { timeout: 1000 }); +var queue = new SequentialTaskQueue(); +// ... +function onEcho(query: string) { + queue.push((token: CancellationToken) => + backend.echo(query).then(response => { + if (!token.cancelled) { + state.addResponse("Server responded: " + response); + } + }), { timeout: 1000 }); } ``` @@ -112,11 +112,11 @@ In most scenarios, you will be using the queue to respond to frequent, asynchron coming from a server: ```js -backend.on("notification", (data) => { - queue.push(() => { - console.log(data); - // todo: do something with data - }); +backend.on("notification", (data: string) => { + queue.push(() => { + console.log(data); + // todo: do something with data + }); }); ``` @@ -124,13 +124,13 @@ Every time the event handler is called, it creates a new function (and a closure Let's rewrite this, now using the `args` property of the task options: ```js -backend.on("notification", (data) => { - queue.push(handleNotifiation, { args: data }); -}); - -function handleNotifiation(data) { - console.log(data); - // todo: do something with data +backend.on("notification", (data: string) => { + queue.push(handleNotifiation, { args: data }); +}); + +function handleNotifiation(data: string) { + console.log(data); + // todo: do something with data } ``` @@ -144,10 +144,10 @@ since the cancellation token would be appended. Use the `wait` method to obtain a `Promise` that fulfills when the queue is empty: ```js -var queue = new SequentialTaskQueue(); -queue.push(task1); -queue.push(task2); -queue.push(task3); +var queue = new SequentialTaskQueue(); +queue.push(task1); +queue.push(task2); +queue.push(task3); queue.wait().then(() => { /*...*/ }); ``` @@ -159,10 +159,10 @@ Calling `push` on a closed queue will throw an exception. Optionally, `close` ca to do so, pass a truthful value as its first parameter. ```js -var queue = new SequentialTaskQueue(); -// ... -function deactivate(done) { - queue.close(true).then(done); +var queue = new SequentialTaskQueue(); +// ... +function deactivate(done: () => void) { + queue.close(true).then(done); } ``` @@ -193,6 +193,10 @@ The `timeout` event is emitted when a task is cancelled due to an expired timeou --- ## Changelog +### 1.3.0 + +`SequentialTaskQueue.cancel` and `SequentialTaskQueue.close` now accept an optional `reason` argument, used as the cancellation reason for any tasks cancelled as a result, mirroring the existing per-task `CancellationToken.cancel(reason)` behavior. + ### 1.2.1 `next` and `emit` are now protected instead of private. @@ -202,4 +206,4 @@ The `timeout` event is emitted when a task is cancelled due to an expired timeou `SequentialTaskQueue.push` now returns a `Promise`. Earlier versions only returned a cancellation token. --- -This file was generated using [gulp-template](http://github.com/sindresorhus/gulp-template) and [snip-text](http://github.com/BalassaMarton/snip-text) \ No newline at end of file +This file was generated using [lodash templates](https://lodash.com/docs/#template) and [snip-text](http://github.com/BalassaMarton/snip-text) \ No newline at end of file diff --git a/scripts/build-readme.js b/scripts/build-readme.js new file mode 100644 index 0000000..760a915 --- /dev/null +++ b/scripts/build-readme.js @@ -0,0 +1,16 @@ +// Renders src/readme.template.md -> readme.md, injecting labeled code +// snippets extracted from examples/examples.ts (marked with +// "--- snippet: ---" / "--- snip ---" comments, see snip-text). +var fs = require("fs"); +var path = require("path"); +var snip = require("snip-text"); +var template = require("lodash/template"); + +var examplesSource = fs.readFileSync(path.join(__dirname, "../examples/examples.ts"), "utf8"); +var examples = snip(examplesSource, { unindent: true }); + +var templatePath = path.join(__dirname, "../src/readme.template.md"); +var outPath = path.join(__dirname, "../readme.md"); + +var render = template(fs.readFileSync(templatePath, "utf8")); +fs.writeFileSync(outPath, render({ examples: examples })); diff --git a/src/readme.template.md b/src/readme.template.md index 88ed661..6b977f6 100644 --- a/src/readme.template.md +++ b/src/readme.template.md @@ -114,9 +114,17 @@ The `timeout` event is emitted when a task is cancelled due to an expired timeou --- ## Changelog +### 1.3.0 + +`SequentialTaskQueue.cancel` and `SequentialTaskQueue.close` now accept an optional `reason` argument, used as the cancellation reason for any tasks cancelled as a result, mirroring the existing per-task `CancellationToken.cancel(reason)` behavior. + +### 1.2.1 + +`next` and `emit` are now protected instead of private. + ### 1.2.0 `SequentialTaskQueue.push` now returns a `Promise`. Earlier versions only returned a cancellation token. --- -This file was generated using [gulp-template](http://github.com/sindresorhus/gulp-template) and [snip-text](http://github.com/BalassaMarton/snip-text) \ No newline at end of file +This file was generated using [lodash templates](https://lodash.com/docs/#template) and [snip-text](http://github.com/BalassaMarton/snip-text) \ No newline at end of file diff --git a/src/sequential-task-queue.ts b/src/sequential-task-queue.ts index 5d02542..3f629f6 100644 --- a/src/sequential-task-queue.ts +++ b/src/sequential-task-queue.ts @@ -70,7 +70,7 @@ export interface CancellationToken { * Cancels the task for which the cancellation token was created. * @param reason - The reason of the cancellation, see {@link CancellationToken.reason} */ - cancel(reason?: any); + cancel(reason?: any): void; } /** @@ -117,10 +117,10 @@ export class SequentialTaskQueue { private queue: TaskEntry[] = []; private _isClosed: boolean = false; private waiters: Function[] = []; - private defaultTimeout: number; - private currentTask: TaskEntry; + private defaultTimeout?: number; + private currentTask?: TaskEntry; private scheduler: Scheduler; - private events: { [key: string]: Function[] }; + private events: { [key: string]: Function[] } = {}; name: string; @@ -148,8 +148,10 @@ export class SequentialTaskQueue { * @returns {CancellablePromiseLike} A promise that can be used to await or cancel the task. */ push(task: Function, options?: TaskOptions): CancellablePromiseLike { - if (this._isClosed) + if (this._isClosed) { throw new Error(`${this.name} has been previously closed`); + } + var taskEntry: TaskEntry = { callback: task, args: options && options.args ? (Array.isArray(options.args) ? options.args.slice() : [options.args]) : [], @@ -173,15 +175,16 @@ export class SequentialTaskQueue { /** * Cancels the currently running task (if any), and clears the queue. + * @param {any} reason - The reason of the cancellation, see {@link CancellationToken.reason}. Defaults to {@link cancellationTokenReasons.cancel}. * @returns {Promise} A Promise that is fulfilled when the queue is empty and the current task has been cancelled. */ - cancel(): PromiseLike { + cancel(reason: any = cancellationTokenReasons.cancel): PromiseLike { if (this.currentTask) - this.cancelTask(this.currentTask, cancellationTokenReasons.cancel); + this.cancelTask(this.currentTask, reason); var queue = this.queue.splice(0); // Cancel all and emit a drained event if there were tasks waiting in the queue if (queue.length) { - queue.forEach(task => this.cancelTask(task, cancellationTokenReasons.cancel)); + queue.forEach(task => this.cancelTask(task, reason)); this.emit(sequentialTaskQueueEvents.drained); } return this.wait(); @@ -191,13 +194,14 @@ export class SequentialTaskQueue { * Closes the queue, preventing new tasks to be added. * Any calls to {@link SequentialTaskQueue.push} after closing the queue will result in an exception. * @param {boolean} cancel - Indicates that the queue should also be cancelled. + * @param {any} reason - The reason of the cancellation, passed to {@link SequentialTaskQueue.cancel} when `cancel` is `true`. * @returns {Promise} A Promise that is fulfilled when the queue has finished executing remaining tasks. */ - close(cancel?: boolean): PromiseLike { + close(cancel?: boolean, reason?: any): PromiseLike { if (!this._isClosed) { this._isClosed = true; if (cancel) - return this.cancel(); + return this.cancel(reason); } return this.wait(); } @@ -263,53 +267,65 @@ export class SequentialTaskQueue { } protected emit(evt: string, ...args: any[]) { - if (this.events && this.events[evt]) - try { - this.events[evt].forEach(fn => fn.apply(this, args)); - } catch (e) { - console.error(`${this.name}: Exception in '${evt}' event handler`, e); - } + if (!this.events || !this.events[evt]) { + return; + } + + try { + this.events[evt].forEach(fn => fn.apply(this, args)); + } catch (e) { + console.error(`${this.name}: Exception in '${evt}' event handler`, e); + } } protected next() { // Try running the next task, if not currently running one - if (!this.currentTask) { - var task = this.queue.shift(); - // skip cancelled tasks - while (task && task.cancellationToken.cancelled) - task = this.queue.shift(); - if (task) { - try { - this.currentTask = task; - if (task.timeout) { - task.timeoutHandle = setTimeout( - () => { - this.emit(sequentialTaskQueueEvents.timeout); - this.cancelTask(task, cancellationTokenReasons.timeout); - }, - task.timeout); - } - let res = task.callback.apply(undefined, task.args); - if (res && isPromise(res)) { - res.then(result => { - task.result = result; - this.doneTask(task); - }, - err => { - this.doneTask(task, err); - }); - } else { - task.result = res; - this.doneTask(task); - } + if (this.currentTask) { + return; + } + + var tempTask = this.queue.shift(); + // skip cancelled tasks + while (tempTask && tempTask.cancellationToken.cancelled) { + tempTask = this.queue.shift(); + } - } catch (e) { - this.doneTask(task, e); - } + if (!tempTask) { + // queue is empty, call waiters + this.callWaiters(); + return; + } + + const task = tempTask; + + try { + this.currentTask = task; + + if (task.timeout) { + task.timeoutHandle = setTimeout( + () => { + this.emit(sequentialTaskQueueEvents.timeout); + this.cancelTask(task, cancellationTokenReasons.timeout); + }, + task.timeout); + } + + const res = task.callback.apply(undefined, task.args); + + if (res && isPromise(res)) { + res.then( + result => { + task.result = result; + this.doneTask(task); + }, + err => this.doneTask(task, err) + ); } else { - // queue is empty, call waiters - this.callWaiters(); + task.result = res; + this.doneTask(task); } + } catch (e) { + this.doneTask(task, e); } } @@ -320,25 +336,29 @@ export class SequentialTaskQueue { } private doneTask(task: TaskEntry, error?: any) { - if (task.timeoutHandle) + if (task.timeoutHandle) { clearTimeout(task.timeoutHandle); + } + task.cancellationToken.cancel = noop; + if (error) { this.emit(sequentialTaskQueueEvents.error, error); - task.reject.call(undefined, error); - } else if (task.cancellationToken.cancelled) - task.reject.call(undefined, task.cancellationToken.reason) - else - task.resolve.call(undefined, task.result); - + task.reject!.call(undefined, error); + } else if (task.cancellationToken.cancelled) { + task.reject!.call(undefined, task.cancellationToken.reason) + } else { + task.resolve!.call(undefined, task.result); + } + if (this.currentTask === task) { this.currentTask = undefined; if (!this.queue.length) { this.emit(sequentialTaskQueueEvents.drained); this.callWaiters(); - } - else + } else { this.scheduler.schedule(() => this.next()); + } } } @@ -355,11 +375,11 @@ interface TaskEntry { timeoutHandle?: any; cancellationToken: CancellationToken; result?: any; - resolve: (value: any | PromiseLike) => void; - reject: (reason?: any) => void; + resolve?: (value: any | PromiseLike) => void; + reject?: (reason?: any) => void; } -function noop() { +function noop(): void { } function isPromise(obj: any): obj is PromiseLike { diff --git a/test/sequential-task-queue-spec.ts b/test/sequential-task-queue-spec.ts index 07dabf6..99bc86c 100644 --- a/test/sequential-task-queue-spec.ts +++ b/test/sequential-task-queue-spec.ts @@ -1,8 +1,8 @@ -import * as assert from "assert"; +import assert from "assert"; import { SequentialTaskQueue, CancellationToken, cancellationTokenReasons } from "../src/sequential-task-queue"; -import * as sinon from "sinon"; +import sinon from "sinon"; -process.on('unhandledRejection', (err, p) => { +process.on('unhandledRejection', () => { console.log('Suppressed unhandled rejection'); }); @@ -43,7 +43,7 @@ describe("SequentialTaskQueue", () => { this.timeout(0); - var results = []; + var results: number[] = []; function createTask(id: number) { return () => { @@ -52,14 +52,14 @@ describe("SequentialTaskQueue", () => { } function createAsyncTask(id: number) { - return () => new Promise(resolve => { + return () => new Promise(resolve => { results.push(id); resolve(); }); } function createScheduledTask(id: number) { - return () => new Promise(resolve => { + return () => new Promise(resolve => { setTimeout(() => { results.push(id); resolve(); @@ -71,7 +71,7 @@ describe("SequentialTaskQueue", () => { var queue = new SequentialTaskQueue(); var count = 10; - var expected = []; + var expected: number[] = []; var idx = 0; while (idx < count) { for (let i = 0; i < functions.length; i++) { @@ -147,7 +147,7 @@ describe("SequentialTaskQueue", () => { it("should resolve after resolved Promise", () => { var queue = new SequentialTaskQueue(); - queue.push(() => new Promise(resolve => { resolve(); })); + queue.push(() => new Promise(resolve => { resolve(); })); return queue.wait(); }); @@ -289,7 +289,7 @@ describe("SequentialTaskQueue", () => { queue.push(() => { spy(1); }); - queue.push(() => new Promise(resolve => { + queue.push(() => new Promise(resolve => { setTimeout(() => { spy(2); resolve(); @@ -323,7 +323,7 @@ describe("SequentialTaskQueue", () => { var queue = new SequentialTaskQueue(); var spy = sinon.spy(); queue.on("timeout", () => spy("timeout")); - queue.push((ct: CancellationToken) => new Promise(resolve => { + queue.push((ct: CancellationToken) => new Promise(resolve => { setTimeout(() => { if (!ct.cancelled) { spy("hello"); @@ -339,15 +339,15 @@ describe("SequentialTaskQueue", () => { it("should prevent queued tasks from running", () => { var queue = new SequentialTaskQueue(); - var res = []; + var res: number[] = []; queue.push(() => res.push(1)); - queue.push(() => new Promise(resolve => { + queue.push(() => new Promise(resolve => { setTimeout(() => { res.push(2); resolve(); }, 50); })); - queue.push(() => new Promise(resolve => { + queue.push(() => new Promise(resolve => { setTimeout(() => { res.push(3); resolve(); @@ -371,12 +371,23 @@ describe("SequentialTaskQueue", () => { return queue.wait().then(() => assert(spy.notCalled)); }); + it("should reject queued tasks with the given reason", () => { + var queue = new SequentialTaskQueue(); + var p = queue.push(() => new Promise(resolve => setTimeout(resolve, 200))); + var p2 = queue.push(() => { }); + queue.cancel("meh"); + return Promise.all([ + p.then(() => assert.ok(false), reason => assert.equal(reason, "meh")), + p2.then(() => assert.ok(false), reason => assert.equal(reason, "meh")) + ]); + }); + it("should cancel current deferred task", () => { var queue = new SequentialTaskQueue(); var spy = sinon.spy(); queue.push((ct: CancellationToken) => - new Promise((resolve, reject) => { + new Promise((resolve, reject) => { setTimeout(() => { // cancel() should not have been cancelled at this point if (ct.cancelled) @@ -387,7 +398,7 @@ describe("SequentialTaskQueue", () => { } }, 10); - }).then(() => new Promise((resolve, reject) => { + }).then(() => new Promise((resolve, reject) => { setTimeout(() => { // cancel() should have been cancelled at this point if (ct.cancelled) @@ -415,8 +426,8 @@ describe("SequentialTaskQueue", () => { var err = sinon.spy(); var timeouts = [50, 500, 50]; - function pushTask(id, delay) { - queue.push((ct: CancellationToken) => new Promise(resolve => { + function pushTask(id: number, delay: number) { + queue.push((ct: CancellationToken) => new Promise(resolve => { setTimeout(() => { if (!ct.cancelled) spy(id); @@ -451,7 +462,7 @@ describe("SequentialTaskQueue", () => { it("should execute remaining tasks", () => { var queue = new SequentialTaskQueue(); - var res = []; + var res: number[] = []; queue.push(() => res.push(1)); queue.push(() => res.push(2)); queue.close(); @@ -483,7 +494,7 @@ describe("CancellationToken", () => { describe("# cancel", () => { it("should prevent task from running", () => { var queue = new SequentialTaskQueue(); - var res = []; + var res: number[] = []; queue.push(() => res.push(1)); var ct = queue.push(() => res.push(2)); queue.push(() => res.push(3)); @@ -497,9 +508,9 @@ describe("CancellationToken", () => { var clock = sinon.useFakeTimers(); try { var queue = new SequentialTaskQueue(); - var res = []; + var res: number[] = []; queue.push(() => res.push(1)); - var ct = queue.push(token => new Promise((resolve, reject) => { + var ct = queue.push((token: CancellationToken) => new Promise((resolve, reject) => { if (token.cancelled) reject(); setTimeout(() => { diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..c002794 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "types": [ + "node" + ], + "rootDir": "src", + "outDir": "dist/lib", + "declarationDir": "dist/types" + }, + "files": [ + "src/sequential-task-queue.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 5678f53..00c318a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "module": "commonjs", "sourceMap": true, "declaration": true, + "esModuleInterop": true, "lib": [ "es5", "es6"