diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..ca63ba5 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +.github +dist +coverage \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..530aa29 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "rules": {} +} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9ddc1b..7db0c65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,5 +14,9 @@ jobs: node-version: 20 - name: Install run: npm ci - - name: Test - run: npm test \ No newline at end of file + - name: Run tests + run: npx vitest run --coverage + - name: Run linting + run: npm run lint + - name: Check formatting + run: npx prettier . --check \ No newline at end of file diff --git a/.gitignore b/.gitignore index eec701f..06c3eac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ coverage/ dist/ -.tern-port diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6224aff --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +.github +dist +coverage +package.json +package-lock.json \ No newline at end of file diff --git a/README.md b/README.md index 61595d2..a53e844 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ $ npm install --save esm-itter After installation the only thing you need to do is import the module: ```js -import { ESMitter } from 'esm-itter' +import { ESMitter } from "esm-itter"; ``` ### Tests and benchmarks diff --git a/benchmarks/run/add-remove.js b/benchmarks/run/add-remove.js index 252e780..d2bc080 100644 --- a/benchmarks/run/add-remove.js +++ b/benchmarks/run/add-remove.js @@ -1,60 +1,69 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , fe = new FE() - , ce = CE() - , ee = EE(); + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + fe = new FE(), + ce = CE(), + ee = EE(); - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.on('foo', handle); - ee1.removeListener('foo', handle); - }).add('EventEmitter2', function() { - ee2.on('foo', handle); - ee2.removeListener('foo', handle); - }).add('EventEmitter3@5.0.1', function() { - ee3.on('foo', handle); - ee3.removeListener('foo', handle); - }).add('ESMitter(main)', function() { - master.on('foo', handle); - master.removeListener('foo', handle); - }).add('Drip', function() { - drip.on('foo', handle); - drip.removeListener('foo', handle); - }).add('fastemitter', function() { - fe.on('foo', handle); - fe.removeListener('foo', handle); - }).add('event-emitter', function() { - ee.on('foo', handle); - ee.off('foo', handle); - }).add('contra/emitter', function() { - ce.on('foo', handle); - ce.off('foo', handle); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new Suite() + .add("EventEmitter1", function () { + ee1.on("foo", handle); + ee1.removeListener("foo", handle); + }) + .add("EventEmitter2", function () { + ee2.on("foo", handle); + ee2.removeListener("foo", handle); + }) + .add("EventEmitter3@5.0.1", function () { + ee3.on("foo", handle); + ee3.removeListener("foo", handle); + }) + .add("ESMitter(main)", function () { + master.on("foo", handle); + master.removeListener("foo", handle); + }) + .add("Drip", function () { + drip.on("foo", handle); + drip.removeListener("foo", handle); + }) + .add("fastemitter", function () { + fe.on("foo", handle); + fe.removeListener("foo", handle); + }) + .add("event-emitter", function () { + ee.on("foo", handle); + ee.off("foo", handle); + }) + .add("contra/emitter", function () { + ce.on("foo", handle); + ce.off("foo", handle); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/run/context.js b/benchmarks/run/context.js index 4ca01fe..30f6ce1 100644 --- a/benchmarks/run/context.js +++ b/benchmarks/run/context.js @@ -1,87 +1,96 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; - var ctx = { foo: 'bar' }; + var ctx = { foo: "bar" }; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , fe = new FE() - , ce = CE() - , ee = EE(); + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + fe = new FE(), + ce = CE(), + ee = EE(); - ee3.on('foo', handle, ctx); - ee2.on('foo', handle.bind(ctx)); - ee1.on('foo', handle.bind(ctx)); - drip.on('foo', handle.bind(ctx)); - master.on('foo', handle, ctx); - ee.on('foo', handle.bind(ctx)); - fe.on('foo', handle.bind(ctx)); - ce.on('foo', handle.bind(ctx)); + ee3.on("foo", handle, ctx); + ee2.on("foo", handle.bind(ctx)); + ee1.on("foo", handle.bind(ctx)); + drip.on("foo", handle.bind(ctx)); + master.on("foo", handle, ctx); + ee.on("foo", handle.bind(ctx)); + fe.on("foo", handle.bind(ctx)); + ce.on("foo", handle.bind(ctx)); - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.emit('foo'); - ee1.emit('foo', 'bar'); - ee1.emit('foo', 'bar', 'baz'); - ee1.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter2', function() { - ee2.emit('foo'); - ee2.emit('foo', 'bar'); - ee2.emit('foo', 'bar', 'baz'); - ee2.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter3@5.0.1', function() { - ee3.emit('foo'); - ee3.emit('foo', 'bar'); - ee3.emit('foo', 'bar', 'baz'); - ee3.emit('foo', 'bar', 'baz', 'boom'); - }).add('ESMitter(main)', function() { - master.emit('foo'); - master.emit('foo', 'bar'); - master.emit('foo', 'bar', 'baz'); - master.emit('foo', 'bar', 'baz', 'boom'); - }).add('Drip', function() { - drip.emit('foo'); - drip.emit('foo', 'bar'); - drip.emit('foo', 'bar', 'baz'); - drip.emit('foo', 'bar', 'baz', 'boom'); - }).add('fastemitter', function() { - fe.emit('foo'); - fe.emit('foo', 'bar'); - fe.emit('foo', 'bar', 'baz'); - fe.emit('foo', 'bar', 'baz', 'boom'); - }).add('event-emitter', function() { - ee.emit('foo'); - ee.emit('foo', 'bar'); - ee.emit('foo', 'bar', 'baz'); - ee.emit('foo', 'bar', 'baz', 'boom'); - }).add('contra/emitter', function() { - ce.emit('foo'); - ce.emit('foo', 'bar'); - ce.emit('foo', 'bar', 'baz'); - ce.emit('foo', 'bar', 'baz', 'boom'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); + new Suite() + .add("EventEmitter1", function () { + ee1.emit("foo"); + ee1.emit("foo", "bar"); + ee1.emit("foo", "bar", "baz"); + ee1.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter2", function () { + ee2.emit("foo"); + ee2.emit("foo", "bar"); + ee2.emit("foo", "bar", "baz"); + ee2.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter3@5.0.1", function () { + ee3.emit("foo"); + ee3.emit("foo", "bar"); + ee3.emit("foo", "bar", "baz"); + ee3.emit("foo", "bar", "baz", "boom"); + }) + .add("ESMitter(main)", function () { + master.emit("foo"); + master.emit("foo", "bar"); + master.emit("foo", "bar", "baz"); + master.emit("foo", "bar", "baz", "boom"); + }) + .add("Drip", function () { + drip.emit("foo"); + drip.emit("foo", "bar"); + drip.emit("foo", "bar", "baz"); + drip.emit("foo", "bar", "baz", "boom"); + }) + .add("fastemitter", function () { + fe.emit("foo"); + fe.emit("foo", "bar"); + fe.emit("foo", "bar", "baz"); + fe.emit("foo", "bar", "baz", "boom"); + }) + .add("event-emitter", function () { + ee.emit("foo"); + ee.emit("foo", "bar"); + ee.emit("foo", "bar", "baz"); + ee.emit("foo", "bar", "baz", "boom"); + }) + .add("contra/emitter", function () { + ce.emit("foo"); + ce.emit("foo", "bar"); + ce.emit("foo", "bar", "baz"); + ce.emit("foo", "bar", "baz", "boom"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); }); diff --git a/benchmarks/run/emit-multiple-listeners.js b/benchmarks/run/emit-multiple-listeners.js index 440f93f..2ad0511 100644 --- a/benchmarks/run/emit-multiple-listeners.js +++ b/benchmarks/run/emit-multiple-listeners.js @@ -1,96 +1,104 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') - , Master = import('../../dist/index.js').ESMitter; +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; +var Master = import("../../dist/index.js").ESMitter; function foo() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); return 1; } function bar() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); return false; } function baz() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); return true; } -var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , fe = new FE() - , ce = CE() - , ee = EE(); +var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + fe = new FE(), + ce = CE(), + ee = EE(); -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const master = new ESMitter.ESMitter(); - ce.on('foo', foo).on('foo', bar).on('foo', baz); - ee.on('foo', foo).on('foo', bar).on('foo', baz); - fe.on('foo', foo).on('foo', bar).on('foo', baz); - ee3.on('foo', foo).on('foo', bar).on('foo', baz); - ee2.on('foo', foo).on('foo', bar).on('foo', baz); - ee1.on('foo', foo).on('foo', bar).on('foo', baz); - Master.on('foo', foo).on('foo', bar).on('foo', baz); + ce.on("foo", foo).on("foo", bar).on("foo", baz); + ee.on("foo", foo).on("foo", bar).on("foo", baz); + fe.on("foo", foo).on("foo", bar).on("foo", baz); + ee3.on("foo", foo).on("foo", bar).on("foo", baz); + ee2.on("foo", foo).on("foo", bar).on("foo", baz); + ee1.on("foo", foo).on("foo", bar).on("foo", baz); + Master.on("foo", foo).on("foo", bar).on("foo", baz); // // Drip is omitted as it throws an error. // Ref: https://github.com/qualiancy/drip/pull/4 // - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.emit('foo'); - ee1.emit('foo', 'bar'); - ee1.emit('foo', 'bar', 'baz'); - ee1.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter2', function() { - ee2.emit('foo'); - ee2.emit('foo', 'bar'); - ee2.emit('foo', 'bar', 'baz'); - ee2.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter3@5.0.1', function() { - ee3.emit('foo'); - ee3.emit('foo', 'bar'); - ee3.emit('foo', 'bar', 'baz'); - ee3.emit('foo', 'bar', 'baz', 'boom'); - }).add('ESMitter(main)', function() { - master.emit('foo'); - master.emit('foo', 'bar'); - master.emit('foo', 'bar', 'baz'); - master.emit('foo', 'bar', 'baz', 'boom'); - }).add('fastemitter', function() { - fe.emit('foo'); - fe.emit('foo', 'bar'); - fe.emit('foo', 'bar', 'baz'); - fe.emit('foo', 'bar', 'baz', 'boom'); - }).add('event-emitter', function() { - ee.emit('foo'); - ee.emit('foo', 'bar'); - ee.emit('foo', 'bar', 'baz'); - ee.emit('foo', 'bar', 'baz', 'boom'); - }).add('contra/emitter', function() { - ce.emit('foo'); - ce.emit('foo', 'bar'); - ce.emit('foo', 'bar', 'baz'); - ce.emit('foo', 'bar', 'baz', 'boom'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); + new Suite() + .add("EventEmitter1", function () { + ee1.emit("foo"); + ee1.emit("foo", "bar"); + ee1.emit("foo", "bar", "baz"); + ee1.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter2", function () { + ee2.emit("foo"); + ee2.emit("foo", "bar"); + ee2.emit("foo", "bar", "baz"); + ee2.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter3@5.0.1", function () { + ee3.emit("foo"); + ee3.emit("foo", "bar"); + ee3.emit("foo", "bar", "baz"); + ee3.emit("foo", "bar", "baz", "boom"); + }) + .add("ESMitter(main)", function () { + master.emit("foo"); + master.emit("foo", "bar"); + master.emit("foo", "bar", "baz"); + master.emit("foo", "bar", "baz", "boom"); + }) + .add("fastemitter", function () { + fe.emit("foo"); + fe.emit("foo", "bar"); + fe.emit("foo", "bar", "baz"); + fe.emit("foo", "bar", "baz", "boom"); + }) + .add("event-emitter", function () { + ee.emit("foo"); + ee.emit("foo", "bar"); + ee.emit("foo", "bar", "baz"); + ee.emit("foo", "bar", "baz", "boom"); + }) + .add("contra/emitter", function () { + ce.emit("foo"); + ce.emit("foo", "bar"); + ce.emit("foo", "bar", "baz"); + ce.emit("foo", "bar", "baz", "boom"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); }); diff --git a/benchmarks/run/emit.js b/benchmarks/run/emit.js index 736d3bd..ebd356e 100644 --- a/benchmarks/run/emit.js +++ b/benchmarks/run/emit.js @@ -1,85 +1,94 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , fe = new FE() - , ce = CE() - , ee = EE(); + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + fe = new FE(), + ce = CE(), + ee = EE(); - ee.on('foo', handle); - fe.on('foo', handle); - ee3.on('foo', handle); - ee2.on('foo', handle); - ee1.on('foo', handle); - drip.on('foo', handle); - master.on('foo', handle); - ce.on('foo', handle); + ee.on("foo", handle); + fe.on("foo", handle); + ee3.on("foo", handle); + ee2.on("foo", handle); + ee1.on("foo", handle); + drip.on("foo", handle); + master.on("foo", handle); + ce.on("foo", handle); - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.emit('foo'); - ee1.emit('foo', 'bar'); - ee1.emit('foo', 'bar', 'baz'); - ee1.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter2', function() { - ee2.emit('foo'); - ee2.emit('foo', 'bar'); - ee2.emit('foo', 'bar', 'baz'); - ee2.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter3@5.0.1', function() { - ee3.emit('foo'); - ee3.emit('foo', 'bar'); - ee3.emit('foo', 'bar', 'baz'); - ee3.emit('foo', 'bar', 'baz', 'boom'); - }).add('ESMitter(main)', function() { - master.emit('foo'); - master.emit('foo', 'bar'); - master.emit('foo', 'bar', 'baz'); - master.emit('foo', 'bar', 'baz', 'boom'); - }).add('Drip', function() { - drip.emit('foo'); - drip.emit('foo', 'bar'); - drip.emit('foo', 'bar', 'baz'); - drip.emit('foo', 'bar', 'baz', 'boom'); - }).add('fastemitter', function() { - fe.emit('foo'); - fe.emit('foo', 'bar'); - fe.emit('foo', 'bar', 'baz'); - fe.emit('foo', 'bar', 'baz', 'boom'); - }).add('event-emitter', function() { - ee.emit('foo'); - ee.emit('foo', 'bar'); - ee.emit('foo', 'bar', 'baz'); - ee.emit('foo', 'bar', 'baz', 'boom'); - }).add('contra/emitter', function() { - ce.emit('foo'); - ce.emit('foo', 'bar'); - ce.emit('foo', 'bar', 'baz'); - ce.emit('foo', 'bar', 'baz', 'boom'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); + new Suite() + .add("EventEmitter1", function () { + ee1.emit("foo"); + ee1.emit("foo", "bar"); + ee1.emit("foo", "bar", "baz"); + ee1.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter2", function () { + ee2.emit("foo"); + ee2.emit("foo", "bar"); + ee2.emit("foo", "bar", "baz"); + ee2.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter3@5.0.1", function () { + ee3.emit("foo"); + ee3.emit("foo", "bar"); + ee3.emit("foo", "bar", "baz"); + ee3.emit("foo", "bar", "baz", "boom"); + }) + .add("ESMitter(main)", function () { + master.emit("foo"); + master.emit("foo", "bar"); + master.emit("foo", "bar", "baz"); + master.emit("foo", "bar", "baz", "boom"); + }) + .add("Drip", function () { + drip.emit("foo"); + drip.emit("foo", "bar"); + drip.emit("foo", "bar", "baz"); + drip.emit("foo", "bar", "baz", "boom"); + }) + .add("fastemitter", function () { + fe.emit("foo"); + fe.emit("foo", "bar"); + fe.emit("foo", "bar", "baz"); + fe.emit("foo", "bar", "baz", "boom"); + }) + .add("event-emitter", function () { + ee.emit("foo"); + ee.emit("foo", "bar"); + ee.emit("foo", "bar", "baz"); + ee.emit("foo", "bar", "baz", "boom"); + }) + .add("contra/emitter", function () { + ce.emit("foo"); + ce.emit("foo", "bar"); + ce.emit("foo", "bar", "baz"); + ce.emit("foo", "bar", "baz", "boom"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); }); diff --git a/benchmarks/run/hundreds.js b/benchmarks/run/hundreds.js index 439a330..89545bd 100644 --- a/benchmarks/run/hundreds.js +++ b/benchmarks/run/hundreds.js @@ -1,84 +1,94 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; function foo() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); return 1; } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , fe = new FE() - , ce = CE() - , ee = EE() - , j, i; + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + fe = new FE(), + ce = CE(), + ee = EE(), + j, + i; for (i = 0; i < 10; i++) { for (j = 0; j < 10; j++) { - ce.on('event:' + i, foo); - ee.on('event:' + i, foo); - fe.on('event:' + i, foo); - ee1.on('event:' + i, foo); - ee2.on('event:' + i, foo); - ee3.on('event:' + i, foo); - drip.on('event:' + i, foo); - master.on('event:' + i, foo); + ce.on("event:" + i, foo); + ee.on("event:" + i, foo); + fe.on("event:" + i, foo); + ee1.on("event:" + i, foo); + ee2.on("event:" + i, foo); + ee3.on("event:" + i, foo); + drip.on("event:" + i, foo); + master.on("event:" + i, foo); } } - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - for (i = 0; i < 10; i++) { - ee1.emit('event:' + i); - } - }).add('EventEmitter2', function() { - for (i = 0; i < 10; i++) { - ee2.emit('event:' + i); - } - }).add('EventEmitter3@0.1.6', function() { - for (i = 0; i < 10; i++) { - ee3.emit('event:' + i); - } - }).add('ESMitter(main)', function() { - for (i = 0; i < 10; i++) { - master.emit('event:' + i); - } - }).add('Drip', function() { - for (i = 0; i < 10; i++) { - drip.emit('event:' + i); - } - }).add('fastemitter', function() { - for (i = 0; i < 10; i++) { - fe.emit('event:' + i); - } - }).add('event-emitter', function() { - for (i = 0; i < 10; i++) { - ee.emit('event:' + i); - } - }).add('contra/emitter', function() { - for (i = 0; i < 10; i++) { - ce.emit('event:' + i); - } - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new Suite() + .add("EventEmitter1", function () { + for (i = 0; i < 10; i++) { + ee1.emit("event:" + i); + } + }) + .add("EventEmitter2", function () { + for (i = 0; i < 10; i++) { + ee2.emit("event:" + i); + } + }) + .add("EventEmitter3@0.1.6", function () { + for (i = 0; i < 10; i++) { + ee3.emit("event:" + i); + } + }) + .add("ESMitter(main)", function () { + for (i = 0; i < 10; i++) { + master.emit("event:" + i); + } + }) + .add("Drip", function () { + for (i = 0; i < 10; i++) { + drip.emit("event:" + i); + } + }) + .add("fastemitter", function () { + for (i = 0; i < 10; i++) { + fe.emit("event:" + i); + } + }) + .add("event-emitter", function () { + for (i = 0; i < 10; i++) { + ee.emit("event:" + i); + } + }) + .add("contra/emitter", function () { + for (i = 0; i < 10; i++) { + ce.emit("event:" + i); + } + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/run/init.js b/benchmarks/run/init.js index 48857bc..c78a469 100644 --- a/benchmarks/run/init.js +++ b/benchmarks/run/init.js @@ -1,45 +1,55 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; // // This is used to prevent the functions below from being transformed into // noops. // - var emitter; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + let emitter; - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - emitter = new EventEmitter1(); - }).add('EventEmitter2', function() { - emitter = new EventEmitter2(); - }).add('EventEmitter3@0.1.6', function() { - emitter = new EventEmitter3(); - }).add('ESMitter(main)', function() { - emitter = new Master(); - }).add('Drip', function() { - emitter = new Drip(); - }).add('fastemitter', function() { - emitter = new FE(); - }).add('event-emitter', function() { - emitter = EE(); - }).add('contra/emitter', function() { - emitter = CE(); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new Suite() + .add("EventEmitter1", function () { + emitter = new EventEmitter1(); + }) + .add("EventEmitter2", function () { + emitter = new EventEmitter2(); + }) + .add("EventEmitter3@0.1.6", function () { + emitter = new EventEmitter3(); + }) + .add("ESMitter(main)", function () { + emitter = new Master(); + }) + .add("Drip", function () { + emitter = new Drip(); + }) + .add("fastemitter", function () { + emitter = new FE(); + }) + .add("event-emitter", function () { + emitter = EE(); + }) + .add("contra/emitter", function () { + emitter = CE(); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/run/listeners.js b/benchmarks/run/listeners.js index a618b4c..6f621fd 100644 --- a/benchmarks/run/listeners.js +++ b/benchmarks/run/listeners.js @@ -1,33 +1,33 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , FE = require('fastemitter') +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; var MAX_LISTENERS = Math.pow(2, 32) - 1; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee3 = new EventEmitter3() - , master = new Master() - , fe = new FE(); + var ee1 = new EventEmitter1(), + ee3 = new EventEmitter3(), + master = new Master(), + fe = new FE(); ee1.setMaxListeners(MAX_LISTENERS); fe.setMaxListeners(MAX_LISTENERS); for (var i = 0; i < 25; i++) { - ee1.on('event', handle); - ee3.on('event', handle); - master.on('event', handle); - fe.on('event', handle); + ee1.on("event", handle); + ee3.on("event", handle); + master.on("event", handle); + fe.on("event", handle); } // @@ -37,19 +37,24 @@ import('../../dist/index.js').then((ESMitter) => { // event-emitter and contra/emitter do not implement `listeners`. // - ( - new benchmark.Suite() - ).add('EventEmitter1', function () { - ee1.listeners('event'); - }).add('EventEmitter3@0.1.6', function() { - ee3.listeners('event'); - }).add('ESMitter(main)', function() { - master.listeners('event'); - }).add('fastemitter', function() { - fe.listeners('event'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new Suite() + .add("EventEmitter1", function () { + ee1.listeners("event"); + }) + .add("EventEmitter3@0.1.6", function () { + ee3.listeners("event"); + }) + .add("ESMitter(main)", function () { + master.listeners("event"); + }) + .add("fastemitter", function () { + fe.listeners("event"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/run/once.js b/benchmarks/run/once.js index dbd8a56..be18a19 100644 --- a/benchmarks/run/once.js +++ b/benchmarks/run/once.js @@ -1,52 +1,61 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +import { Suite } from "benchmark"; -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') - , FE = require('fastemitter') +import { EventEmitter2 } from "eventemitter2"; +import { EventEmitter as EventEmitter1 } from "events"; +import EventEmitter3 from "eventemitter3"; +import { EventEmitter as Drip } from "drip"; +import CE from "contra/emitter"; +import EE from "event-emitter"; +import FE from "fastemitter"; -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , fe = new FE() - , ce = CE() - , ee = EE(); + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + fe = new FE(), + ce = CE(), + ee = EE(); - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.once('foo', handle).emit('foo'); - }).add('EventEmitter2', function() { - ee2.once('foo', handle).emit('foo'); - }).add('EventEmitter3@0.1.6', function() { - ee3.once('foo', handle).emit('foo'); - }).add('ESMitter(main)', function() { - master.once('foo', handle).emit('foo'); - }).add('Drip', function() { - drip.once('foo', handle).emit('foo'); - }).add('fastemitter', function() { - fe.once('foo', handle).emit('foo'); - }).add('event-emitter', function() { - ee.once('foo', handle).emit('foo'); - }).add('contra/emitter', function() { - ce.once('foo', handle).emit('foo'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new Suite() + .add("EventEmitter1", function () { + ee1.once("foo", handle).emit("foo"); + }) + .add("EventEmitter2", function () { + ee2.once("foo", handle).emit("foo"); + }) + .add("EventEmitter3@0.1.6", function () { + ee3.once("foo", handle).emit("foo"); + }) + .add("ESMitter(main)", function () { + master.once("foo", handle).emit("foo"); + }) + .add("Drip", function () { + drip.once("foo", handle).emit("foo"); + }) + .add("fastemitter", function () { + fe.once("foo", handle).emit("foo"); + }) + .add("event-emitter", function () { + ee.once("foo", handle).emit("foo"); + }) + .add("contra/emitter", function () { + ce.once("foo", handle).emit("foo"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/run/remove-emit.js b/benchmarks/run/remove-emit.js index 9f81f1c..755a73c 100644 --- a/benchmarks/run/remove-emit.js +++ b/benchmarks/run/remove-emit.js @@ -1,86 +1,94 @@ -'use strict'; +"use strict"; -var benchmark = require('benchmark'); +var benchmark = require("benchmark"); -var EventEmitter2 = require('eventemitter2').EventEmitter2 - , EventEmitter1 = require('events').EventEmitter - , EventEmitter3 = require('eventemitter3') - , Drip = require('drip').EventEmitter - , CE = require('contra/emitter') - , EE = require('event-emitter') +var EventEmitter2 = require("eventemitter2").EventEmitter2, + EventEmitter1 = require("events").EventEmitter, + EventEmitter3 = require("eventemitter3"), + Drip = require("drip").EventEmitter, + CE = require("contra/emitter"), + EE = require("event-emitter"); -import('../../dist/index.js').then((ESMitter) => { +import("../../dist/index.js").then((ESMitter) => { const Master = ESMitter.ESMitter; function handle() { - if (arguments.length > 100) console.log('damn'); + if (arguments.length > 100) console.log("damn"); } - var ee1 = new EventEmitter1() - , ee2 = new EventEmitter2() - , ee3 = new EventEmitter3() - , master = new Master() - , drip = new Drip() - , ce = CE() - , ee = EE(); + var ee1 = new EventEmitter1(), + ee2 = new EventEmitter2(), + ee3 = new EventEmitter3(), + master = new Master(), + drip = new Drip(), + ce = CE(), + ee = EE(); [ee1, ee2, ee3, master, drip, ee, ce].forEach(function ohai(emitter) { - emitter.on('foo', handle); + emitter.on("foo", handle); // // We add and remove a listener to see if the event emitter implementation is // de-optimized because it deletes items from an object etc. // - emitter.on('ohai', ohai); - if (emitter.removeListener) emitter.removeListener('ohai', ohai); - else if (emitter.off) emitter.off('ohai', ohai); - else throw new Error('No proper remove implementation'); + emitter.on("ohai", ohai); + if (emitter.removeListener) emitter.removeListener("ohai", ohai); + else if (emitter.off) emitter.off("ohai", ohai); + else throw new Error("No proper remove implementation"); }); // // FastEmitter is omitted as it throws an error. // - ( - new benchmark.Suite() - ).add('EventEmitter1', function() { - ee1.emit('foo'); - ee1.emit('foo', 'bar'); - ee1.emit('foo', 'bar', 'baz'); - ee1.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter2', function() { - ee2.emit('foo'); - ee2.emit('foo', 'bar'); - ee2.emit('foo', 'bar', 'baz'); - ee2.emit('foo', 'bar', 'baz', 'boom'); - }).add('EventEmitter3@0.1.6', function() { - ee3.emit('foo'); - ee3.emit('foo', 'bar'); - ee3.emit('foo', 'bar', 'baz'); - ee3.emit('foo', 'bar', 'baz', 'boom'); - }).add('ESMitter(main)', function() { - master.emit('foo'); - master.emit('foo', 'bar'); - master.emit('foo', 'bar', 'baz'); - master.emit('foo', 'bar', 'baz', 'boom'); - }).add('Drip', function() { - drip.emit('foo'); - drip.emit('foo', 'bar'); - drip.emit('foo', 'bar', 'baz'); - drip.emit('foo', 'bar', 'baz', 'boom'); - }).add('event-emitter', function() { - ee.emit('foo'); - ee.emit('foo', 'bar'); - ee.emit('foo', 'bar', 'baz'); - ee.emit('foo', 'bar', 'baz', 'boom'); - }).add('contra/emitter', function() { - ce.emit('foo'); - ce.emit('foo', 'bar'); - ce.emit('foo', 'bar', 'baz'); - ce.emit('foo', 'bar', 'baz', 'boom'); - }).on('cycle', function cycle(e) { - console.log(e.target.toString()); - }).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); - }).run({ async: true }); -}); \ No newline at end of file + new benchmark.Suite() + .add("EventEmitter1", function () { + ee1.emit("foo"); + ee1.emit("foo", "bar"); + ee1.emit("foo", "bar", "baz"); + ee1.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter2", function () { + ee2.emit("foo"); + ee2.emit("foo", "bar"); + ee2.emit("foo", "bar", "baz"); + ee2.emit("foo", "bar", "baz", "boom"); + }) + .add("EventEmitter3@0.1.6", function () { + ee3.emit("foo"); + ee3.emit("foo", "bar"); + ee3.emit("foo", "bar", "baz"); + ee3.emit("foo", "bar", "baz", "boom"); + }) + .add("ESMitter(main)", function () { + master.emit("foo"); + master.emit("foo", "bar"); + master.emit("foo", "bar", "baz"); + master.emit("foo", "bar", "baz", "boom"); + }) + .add("Drip", function () { + drip.emit("foo"); + drip.emit("foo", "bar"); + drip.emit("foo", "bar", "baz"); + drip.emit("foo", "bar", "baz", "boom"); + }) + .add("event-emitter", function () { + ee.emit("foo"); + ee.emit("foo", "bar"); + ee.emit("foo", "bar", "baz"); + ee.emit("foo", "bar", "baz", "boom"); + }) + .add("contra/emitter", function () { + ce.emit("foo"); + ce.emit("foo", "bar"); + ce.emit("foo", "bar", "baz"); + ce.emit("foo", "bar", "baz", "boom"); + }) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); +}); diff --git a/benchmarks/template.js b/benchmarks/template.js index 95f10ce..6ca46e8 100644 --- a/benchmarks/template.js +++ b/benchmarks/template.js @@ -1,22 +1,21 @@ -'use strict'; +"use strict"; /** * Benchmark related modules. */ -var benchmark = require('benchmark'); +var benchmark = require("benchmark"); /** * Preparation code. */ -( - new benchmark.Suite() -).add('', function() { - -}).add('', function() { - -}).on('cycle', function cycle(e) { - console.log(e.target.toString()); -}).on('complete', function completed() { - console.log('Fastest is %s', this.filter('fastest').map('name')); -}).run({ async: true }); +new benchmark.Suite() + .add("", function () {}) + .add("", function () {}) + .on("cycle", function cycle(e) { + console.log(e.target.toString()); + }) + .on("complete", function completed() { + console.log("Fastest is %s", this.filter("fastest").map("name")); + }) + .run({ async: true }); diff --git a/package-lock.json b/package-lock.json index 6d458a1..37dfb83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,18 @@ { "name": "esm-itter", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "esm-itter", - "version": "0.1.0", + "version": "0.2.0", "license": "MIT", "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "eslint": "^8.57.0", + "prettier": "3.2.5", "typescript": "^5.4.2", "vitest": "^1.4.0" }, @@ -19,6 +23,15 @@ "@rollup/rollup-linux-x64-gnu": "^4.13.0" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@esbuild/darwin-arm64": { "version": "0.20.2", "cpu": [ @@ -34,6 +47,139 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, "node_modules/@jest/schemas": { "version": "29.6.3", "dev": true, @@ -50,6 +196,41 @@ "dev": true, "license": "MIT" }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.13.0", "cpu": [ @@ -84,6 +265,214 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", + "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/type-utils": "7.3.1", + "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", + "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", + "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", + "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/utils": "7.3.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", + "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", + "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", + "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "semver": "^7.5.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", + "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.3.1", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@vitest/expect": { "version": "1.4.0", "dev": true, @@ -159,6 +548,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.3.2", "dev": true, @@ -167,6 +565,31 @@ "node": ">=0.4.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "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, + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "5.2.0", "dev": true, @@ -178,6 +601,21 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "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 + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "dev": true, @@ -186,6 +624,33 @@ "node": "*" } }, + "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 + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cac": { "version": "6.7.14", "dev": true, @@ -194,6 +659,15 @@ "node": ">=8" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/chai": { "version": "4.4.1", "dev": true, @@ -211,6 +685,37 @@ "node": ">=4" } }, + "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, + "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/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, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/check-error": { "version": "1.0.3", "dev": true, @@ -222,6 +727,30 @@ "node": "*" } }, + "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, + "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 + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "dev": true, @@ -262,6 +791,12 @@ "node": ">=6" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/diff-sequences": { "version": "29.6.3", "dev": true, @@ -270,6 +805,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/esbuild": { "version": "0.20.2", "dev": true, @@ -307,6 +866,173 @@ "@esbuild/win32-x64": "0.20.2" } }, + "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, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "3.0.3", "dev": true, @@ -315,6 +1041,15 @@ "@types/estree": "^1.0.0" } }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/execa": { "version": "8.0.1", "dev": true, @@ -337,6 +1072,127 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/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, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "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, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "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 + }, "node_modules/fsevents": { "version": "2.3.3", "dev": true, @@ -368,6 +1224,110 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "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, + "engines": { + "node": ">=8" + } + }, "node_modules/human-signals": { "version": "5.0.0", "dev": true, @@ -376,6 +1336,95 @@ "node": ">=16.17.0" } }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "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==", + "dev": true, + "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 + }, + "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, + "engines": { + "node": ">=0.10.0" + } + }, + "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, + "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, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "3.0.0", "dev": true, @@ -397,10 +1446,62 @@ "dev": true, "license": "MIT" }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/jsonc-parser": { "version": "3.2.1", "dev": true, - "license": "MIT" + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } }, "node_modules/local-pkg": { "version": "0.5.0", @@ -417,6 +1518,27 @@ "url": "https://github.com/sponsors/antfu" } }, + "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, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/loupe": { "version": "2.3.7", "dev": true, @@ -425,6 +1547,18 @@ "get-func-name": "^2.0.1" } }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/magic-string": { "version": "0.30.8", "dev": true, @@ -441,6 +1575,28 @@ "dev": true, "license": "MIT" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "dev": true, @@ -452,6 +1608,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mlly": { "version": "1.6.1", "dev": true, @@ -485,6 +1656,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/npm-run-path": { "version": "5.3.0", "dev": true, @@ -510,6 +1687,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/onetime": { "version": "6.0.0", "dev": true, @@ -524,6 +1710,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "5.0.0", "dev": true, @@ -538,6 +1741,78 @@ "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, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/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, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/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, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "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, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "dev": true, @@ -546,6 +1821,15 @@ "node": ">=8" } }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pathe": { "version": "1.1.2", "dev": true, @@ -564,6 +1848,18 @@ "dev": true, "license": "ISC" }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/pkg-types": { "version": "1.0.3", "dev": true, @@ -601,6 +1897,30 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "dev": true, @@ -614,11 +1934,74 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "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" + } + ] + }, "node_modules/react-is": { "version": "18.2.0", "dev": true, "license": "MIT" }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/rollup": { "version": "4.13.0", "dev": true, @@ -650,6 +2033,44 @@ "fsevents": "~2.3.2" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "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" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "dev": true, @@ -685,6 +2106,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/source-map-js": { "version": "1.2.0", "dev": true, @@ -703,6 +2133,18 @@ "dev": true, "license": "MIT" }, + "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, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-final-newline": { "version": "3.0.0", "dev": true, @@ -714,6 +2156,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-literal": { "version": "2.0.0", "dev": true, @@ -725,6 +2179,24 @@ "url": "https://github.com/sponsors/antfu" } }, + "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, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tinybench": { "version": "2.6.0", "dev": true, @@ -746,6 +2218,42 @@ "node": ">=14.0.0" } }, + "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, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "dev": true, @@ -754,6 +2262,18 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "5.4.2", "dev": true, @@ -771,6 +2291,15 @@ "dev": true, "license": "MIT" }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/vite": { "version": "5.2.2", "dev": true, @@ -940,6 +2469,18 @@ "node": ">=8" } }, + "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 + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/yocto-queue": { "version": "1.0.0", "dev": true, diff --git a/package.json b/package.json index b7fa31d..9c0c6ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "esm-itter", - "version": "0.1.0", + "version": "0.2.0", "description": "ESMitter is an event emitter compatible with Node.js and browsers. It is a fork of EventEmitter3, but natively TypeScript, ESM-only and with more modern tooling.", "type": "module", "exports": { @@ -16,7 +16,9 @@ "scripts": { "build": "tsc", "benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;", - "test": "vitest run" + "test": "vitest run", + "lint": "eslint . --ext .ts", + "prettier": "prettier --write ." }, "files": [ "dist" @@ -49,6 +51,10 @@ "url": "https://github.com/tillsanders/esm-itter/issues" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "eslint": "^8.57.0", + "prettier": "3.2.5", "typescript": "^5.4.2", "vitest": "^1.4.0" }, diff --git a/src/ESMitter.ts b/src/ESMitter.ts index a754f96..5dcf099 100644 --- a/src/ESMitter.ts +++ b/src/ESMitter.ts @@ -2,19 +2,23 @@ import { ESMitterListener } from "./ESMitterListener.js"; export type ESMitterEventName = string | symbol; -export interface ESMitterEvent{ +export interface ESMitterEvent< + EventArguments extends unknown[], + EventContext = undefined, +> { arguments: EventArguments; fn: (this: EventContext, ...args: EventArguments) => void; context: EventContext; } export interface ESMitterEvents { + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: ESMitterEventName]: ESMitterEvent; } export class ESMitter { - private events = {} as Record - private eventsCount = 0 + private events = {} as Record; + private eventsCount = 0; constructor() {} @@ -27,10 +31,19 @@ export class ESMitter { * @param {Boolean} once Specify if the listener is a one-time listener. * @returns {EventEmitter} */ - public addListener(event: EventName, fn: Events[EventName]["fn"], context?: ESMitterEvents[EventName]["context"], once = false) { - const listener = new ESMitterListener(fn as () => unknown, context || this, once) + public addListener( + event: EventName, + fn: Events[EventName]["fn"], + context?: ESMitterEvents[EventName]["context"], + once = false, + ) { + const listener = new ESMitterListener( + fn as () => unknown, + context || this, + once, + ); if (this.events[event] === undefined) { - this.events[event] = [] + this.events[event] = []; this.eventsCount++; } this.events[event].push(listener); @@ -53,10 +66,10 @@ export class ESMitter { * @returns {Array} */ public eventNames() { - const names: (ESMitterEventName)[] = []; + const names: ESMitterEventName[] = []; if (this.eventsCount === 0) return names; - return Object.keys(this.events) - }; + return Object.keys(this.events); + } /** * Return the listeners registered for a given event. @@ -69,7 +82,7 @@ export class ESMitter { if (handlers === undefined) return []; return handlers.map((handler) => handler.fn); - }; + } /** * Return the number of listeners listening to a given event. @@ -82,7 +95,7 @@ export class ESMitter { if (listeners === undefined) return 0; return listeners.length; - }; + } /** * Calls each of the listeners registered for a given event. @@ -90,7 +103,10 @@ export class ESMitter { * @param {(String|Symbol)} event The event name. * @returns {Boolean} `true` if the event had listeners, else `false`. */ - public emit(event: EventName, ...args: Events[EventName]["arguments"]) { + public emit( + event: EventName, + ...args: Events[EventName]["arguments"] + ) { if (this.events[event] === undefined) return false; const listeners = [...this.events[event]]; @@ -100,9 +116,9 @@ export class ESMitter { this.removeListener(event, listener.fn, undefined, true); } listener.fn.apply(listener.context, args as []); - }) + }); return true; - }; + } /** * Add a listener for a given event. @@ -112,9 +128,13 @@ export class ESMitter { * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. */ - public on(event: EventName, fn: Events[EventName]["fn"], context?: Events[EventName]["context"]) { + public on( + event: EventName, + fn: Events[EventName]["fn"], + context?: Events[EventName]["context"], + ) { return this.addListener(event, fn, context, false); - }; + } /** * Add a one-time listener for a given event. @@ -124,9 +144,13 @@ export class ESMitter { * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. */ - public once(event: EventName, fn: Events[EventName]["fn"], context?: Events[EventName]["context"]) { + public once( + event: EventName, + fn: Events[EventName]["fn"], + context?: Events[EventName]["context"], + ) { return this.addListener(event, fn, context, true); - }; + } /** * Remove the listeners of a given event. @@ -137,7 +161,12 @@ export class ESMitter { * @param {Boolean} once Only remove one-time listeners. * @returns {EventEmitter} `this`. */ - public removeListener(event: EventName, fn?: Events[EventName]["fn"], context?: Events[EventName]["context"], once?: boolean) { + public removeListener( + event: EventName, + fn?: Events[EventName]["fn"], + context?: Events[EventName]["context"], + once?: boolean, + ) { if (this.events[event] === undefined) return this; if (fn === undefined) { this.clearEvent(event); @@ -153,14 +182,14 @@ export class ESMitter { ) { this.events[event].splice(index, 1); } - }) + }); if (this.events[event].length === 0) { this.clearEvent(event); } return this; - }; + } /** * Remove the listeners of a given event. Alias of removeListener(). @@ -189,4 +218,4 @@ export class ESMitter { return this; } -}; +} diff --git a/src/ESMitterListener.ts b/src/ESMitterListener.ts index 9f5204a..f34c7f5 100644 --- a/src/ESMitterListener.ts +++ b/src/ESMitterListener.ts @@ -9,6 +9,6 @@ export class ESMitterListener { constructor( public fn: () => unknown, public context: unknown, - public once = false + public once = false, ) {} -} \ No newline at end of file +} diff --git a/src/index.ts b/src/index.ts index 46bb91b..d5ffaa0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export { ESMitter } from './ESMitter.js'; -export { ESMitterListener } from './ESMitterListener.js'; -export type { ESMitterEvents, ESMitterEventName } from './ESMitter.js'; \ No newline at end of file +export { ESMitter } from "./ESMitter.js"; +export { ESMitterListener } from "./ESMitterListener.js"; +export type { ESMitterEvents, ESMitterEventName } from "./ESMitter.js"; diff --git a/test/test.spec.ts b/test/test.spec.ts index 0219198..6ee8fea 100644 --- a/test/test.spec.ts +++ b/test/test.spec.ts @@ -1,523 +1,539 @@ -import { describe, it, expect } from 'vitest' -import { ESMitter, ESMitterEvent } from '../src/ESMitter.js'; +import { describe, it, expect } from "vitest"; +import { ESMitter, ESMitterEvent } from "../src/ESMitter.js"; -describe('ESMitter', function tests() { - describe('emit', function () { - it('should return false when there are not events to emit', function () { +describe("ESMitter", function tests() { + describe("emit", function () { + it("should return false when there are not events to emit", function () { const e = new ESMitter(); - expect(e.emit('foo')).equals(false); - expect(e.emit('bar')).equals(false); + expect(e.emit("foo")).equals(false); + expect(e.emit("bar")).equals(false); }); - it('emits with context', function () { - const context = { bar: 'baz' } + it("emits with context", function () { + const context = { bar: "baz" }; const e = new ESMitter<{ foo: ESMitterEvent<[string], { bar: string }>; }>(); - e.on('foo', function (bar) { - expect(bar).equals('bar'); - expect(this).equals(context); - }, context).emit('foo', 'bar'); + e.on( + "foo", + function (bar) { + expect(bar).equals("bar"); + expect(this).equals(context); + }, + context, + ).emit("foo", "bar"); }); - it('can emit the function with multiple arguments, multiple listeners', function () { + it("can emit the function with multiple arguments, multiple listeners", function () { const e = new ESMitter<{ foo: ESMitterEvent<[string]>; }>(); - e.on('foo', function (bar) { - expect(bar).equals('bar'); - }) + e.on("foo", function (bar) { + expect(bar).equals("bar"); + }); - e.on('foo', function (bar) { - expect(bar).equals('bar'); - }) + e.on("foo", function (bar) { + expect(bar).equals("bar"); + }); - e.on('foo', function (bar) { - expect(bar).equals('bar'); - }) + e.on("foo", function (bar) { + expect(bar).equals("bar"); + }); - expect(e.listenerCount('foo')).toBe(3); + expect(e.listenerCount("foo")).toBe(3); - e.emit('foo', 'bar'); + e.emit("foo", "bar"); }); - it('can emit the function with multiple arguments, multiple listeners and context', function () { + it("can emit the function with multiple arguments, multiple listeners and context", function () { const e = new ESMitter<{ foo: ESMitterEvent<[string], { bar: string }>; }>(); - e.on('foo', function (bar) { - expect(bar).equals('bar'); - expect(this.bar).equals('baz1'); - }, { bar: 'baz1' }) - - e.on('foo', function (bar) { - expect(bar).equals('bar'); - expect(this.bar).equals('baz2'); - }, { bar: 'baz2' }) - - e.on('foo', function (bar) { - expect(bar).equals('bar'); - expect(this.bar).equals('baz3'); - }, { bar: 'baz3' }) - - expect(e.listenerCount('foo')).toBe(3); - - e.emit('foo', 'bar'); + e.on( + "foo", + function (bar) { + expect(bar).equals("bar"); + expect(this.bar).equals("baz1"); + }, + { bar: "baz1" }, + ); + + e.on( + "foo", + function (bar) { + expect(bar).equals("bar"); + expect(this.bar).equals("baz2"); + }, + { bar: "baz2" }, + ); + + e.on( + "foo", + function (bar) { + expect(bar).equals("bar"); + expect(this.bar).equals("baz3"); + }, + { bar: "baz3" }, + ); + + expect(e.listenerCount("foo")).toBe(3); + + e.emit("foo", "bar"); }); - it('should return true when there are events to emit', function () { + it("should return true when there are events to emit", function () { const e = new ESMitter<{ foo: ESMitterEvent<[string]>; }>(); - expect(e.emit('foo', 'bar')).toBe(false); - e.on('foo', function () {}) - expect(e.emit('foo', 'bar')).toBe(true); + expect(e.emit("foo", "bar")).toBe(false); + e.on("foo", function () {}); + expect(e.emit("foo", "bar")).toBe(true); }); - // it('receives the emitted events', function (done) { - // const e = new ESMitter(); + // it('receives the emitted events', function (done) { + // const e = new ESMitter(); - // e.on('data', function (a, b, c, d, undef) { - // expect(a).equals('foo'); - // expect(b).equals(e); - // expect(c).is.instanceOf(Date); - // expect(undef).equals(undefined); - // expect(arguments.length).equals(3); + // e.on('data', function (a, b, c, d, undef) { + // expect(a).equals('foo'); + // expect(b).equals(e); + // expect(c).is.instanceOf(Date); + // expect(undef).equals(undefined); + // expect(arguments.length).equals(3); - // done(); - // }); + // done(); + // }); - // e.emit('data', 'foo', e, new Date()); - // }); + // e.emit('data', 'foo', e, new Date()); + // }); - // it('emits to all event listeners', function () { - // const e = new ESMitter() - // , pattern = []; + // it('emits to all event listeners', function () { + // const e = new ESMitter() + // , pattern = []; - // e.on('foo', function () { - // pattern.push('foo1'); - // }); + // e.on('foo', function () { + // pattern.push('foo1'); + // }); - // e.on('foo', function () { - // pattern.push('foo2'); - // }); + // e.on('foo', function () { + // pattern.push('foo2'); + // }); - // e.emit('foo'); + // e.emit('foo'); - // expect(pattern.join(';')).equals('foo1;foo2'); - // }); + // expect(pattern.join(';')).equals('foo1;foo2'); + // }); - // (function each(keys) { - // const key = keys.shift(); - - // if (!key) return; + // (function each(keys) { + // const key = keys.shift(); + + // if (!key) return; - // it('can store event which is a known property: '+ key, function (next) { - // const e = new ESMitter(); + // it('can store event which is a known property: '+ key, function (next) { + // const e = new ESMitter(); - // e.on(key, function (k) { - // expect(k).equals(key); - // next(); - // }).emit(key, key); - // }); - - // each(keys); - // })([ - // 'hasOwnProperty', - // 'constructor', - // '__proto__', - // 'toString', - // 'toValue', - // 'unwatch', - // 'watch' - // ]); - // }); - - // describe('listeners', function () { - // it('returns an empty array if no listeners are specified', function () { - // const e = new ESMitter(); - - // expect(e.listeners('foo')).is.a('array'); - // expect(e.listeners('foo').length).equals(0); - // }); - - // it('returns an array of function', function () { - // const e = new ESMitter(); - - // function foo() {} - - // e.on('foo', foo); - // expect(e.listeners('foo')).is.a('array'); - // expect(e.listeners('foo').length).equals(1); - // expect(e.listeners('foo')).deep.equals([foo]); - // }); - - // it('is not vulnerable to modifications', function () { - // const e = new ESMitter(); - - // function foo() {} - - // e.on('foo', foo); - - // expect(e.listeners('foo')).deep.equals([foo]); - - // e.listeners('foo').length = 0; - // expect(e.listeners('foo')).deep.equals([foo]); - // }); - // }); - - // describe('listenerCount', function () { - // it('returns the number of listeners for a given event', function () { - // const e = new ESMitter(); - - // expect(e.listenerCount()).equals(0); - // expect(e.listenerCount('foo')).equals(0); - - // e.on('foo', function () {}); - // expect(e.listenerCount('foo')).equals(1); - // e.on('foo', function () {}); - // expect(e.listenerCount('foo')).equals(2); - // }); - // }); - - // describe('on', function () { - // it('throws an error if the listener is not a function', function () { - // const e = new ESMitter(); - - // try { - // e.on('foo', 'bar'); - // } catch (ex) { - // expect(ex).is.instanceOf(TypeError); - // expect(ex.message).equals('The listener must be a function'); - // return; - // } - - // throw new Error('oops'); - // }); - // }); - - // describe('once', function () { - // it('only emits it once', function () { - // const e = new ESMitter() - // , calls = 0; - - // e.once('foo', function () { - // calls++; - // }); - - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - - // expect(e.listeners('foo').length).equals(0); - // expect(calls).equals(1); - // }); - - // it('only emits once if emits are nested inside the listener', function () { - // const e = new ESMitter() - // , calls = 0; - - // e.once('foo', function () { - // calls++; - // e.emit('foo'); - // }); - - // e.emit('foo'); - // expect(e.listeners('foo').length).equals(0); - // expect(calls).equals(1); - // }); - - // it('only emits once for multiple events', function () { - // const e = new ESMitter() - // , multi = 0 - // , foo = 0 - // , bar = 0; - - // e.once('foo', function () { - // foo++; - // }); - - // e.once('foo', function () { - // bar++; - // }); - - // e.on('foo', function () { - // multi++; - // }); - - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - // e.emit('foo'); - - // expect(e.listeners('foo').length).equals(1); - // expect(multi).equals(5); - // expect(foo).equals(1); - // expect(bar).equals(1); - // }); - - // it('only emits once with context', function (done) { - // const context = { foo: 'bar' } - // , e = new ESMitter(); - - // e.once('foo', function (bar) { - // expect(this).equals(context); - // expect(bar).equals('bar'); - - // done(); - // }, context).emit('foo', 'bar'); - // }); - // }); - - // describe('removeListener', function () { - // it('removes all listeners when the listener is not specified', function () { - // const e = new ESMitter(); - - // e.on('foo', function () {}); - // e.on('foo', function () {}); - - // expect(e.removeListener('foo')).equals(e); - // expect(e.listeners('foo')).eql([]); - // }); - - // it('removes only the listeners matching the specified listener', function () { - // const e = new ESMitter(); - - // function foo() {} - // function bar() {} - // function baz() {} - - // e.on('foo', foo); - // e.on('bar', bar); - // e.on('bar', baz); + // e.on(key, function (k) { + // expect(k).equals(key); + // next(); + // }).emit(key, key); + // }); + + // each(keys); + // })([ + // 'hasOwnProperty', + // 'constructor', + // '__proto__', + // 'toString', + // 'toValue', + // 'unwatch', + // 'watch' + // ]); + // }); + + // describe('listeners', function () { + // it('returns an empty array if no listeners are specified', function () { + // const e = new ESMitter(); + + // expect(e.listeners('foo')).is.a('array'); + // expect(e.listeners('foo').length).equals(0); + // }); + + // it('returns an array of function', function () { + // const e = new ESMitter(); + + // function foo() {} + + // e.on('foo', foo); + // expect(e.listeners('foo')).is.a('array'); + // expect(e.listeners('foo').length).equals(1); + // expect(e.listeners('foo')).deep.equals([foo]); + // }); + + // it('is not vulnerable to modifications', function () { + // const e = new ESMitter(); + + // function foo() {} + + // e.on('foo', foo); + + // expect(e.listeners('foo')).deep.equals([foo]); + + // e.listeners('foo').length = 0; + // expect(e.listeners('foo')).deep.equals([foo]); + // }); + // }); + + // describe('listenerCount', function () { + // it('returns the number of listeners for a given event', function () { + // const e = new ESMitter(); + + // expect(e.listenerCount()).equals(0); + // expect(e.listenerCount('foo')).equals(0); + + // e.on('foo', function () {}); + // expect(e.listenerCount('foo')).equals(1); + // e.on('foo', function () {}); + // expect(e.listenerCount('foo')).equals(2); + // }); + // }); + + // describe('on', function () { + // it('throws an error if the listener is not a function', function () { + // const e = new ESMitter(); + + // try { + // e.on('foo', 'bar'); + // } catch (ex) { + // expect(ex).is.instanceOf(TypeError); + // expect(ex.message).equals('The listener must be a function'); + // return; + // } + + // throw new Error('oops'); + // }); + // }); + + // describe('once', function () { + // it('only emits it once', function () { + // const e = new ESMitter() + // , calls = 0; + + // e.once('foo', function () { + // calls++; + // }); + + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + + // expect(e.listeners('foo').length).equals(0); + // expect(calls).equals(1); + // }); + + // it('only emits once if emits are nested inside the listener', function () { + // const e = new ESMitter() + // , calls = 0; + + // e.once('foo', function () { + // calls++; + // e.emit('foo'); + // }); + + // e.emit('foo'); + // expect(e.listeners('foo').length).equals(0); + // expect(calls).equals(1); + // }); + + // it('only emits once for multiple events', function () { + // const e = new ESMitter() + // , multi = 0 + // , foo = 0 + // , bar = 0; + + // e.once('foo', function () { + // foo++; + // }); + + // e.once('foo', function () { + // bar++; + // }); + + // e.on('foo', function () { + // multi++; + // }); + + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + // e.emit('foo'); + + // expect(e.listeners('foo').length).equals(1); + // expect(multi).equals(5); + // expect(foo).equals(1); + // expect(bar).equals(1); + // }); + + // it('only emits once with context', function (done) { + // const context = { foo: 'bar' } + // , e = new ESMitter(); + + // e.once('foo', function (bar) { + // expect(this).equals(context); + // expect(bar).equals('bar'); + + // done(); + // }, context).emit('foo', 'bar'); + // }); + // }); + + // describe('removeListener', function () { + // it('removes all listeners when the listener is not specified', function () { + // const e = new ESMitter(); + + // e.on('foo', function () {}); + // e.on('foo', function () {}); + + // expect(e.removeListener('foo')).equals(e); + // expect(e.listeners('foo')).eql([]); + // }); + + // it('removes only the listeners matching the specified listener', function () { + // const e = new ESMitter(); + + // function foo() {} + // function bar() {} + // function baz() {} + + // e.on('foo', foo); + // e.on('bar', bar); + // e.on('bar', baz); - // expect(e.removeListener('foo', bar)).equals(e); - // expect(e.listeners('bar')).eql([bar, baz]); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(2); + // expect(e.removeListener('foo', bar)).equals(e); + // expect(e.listeners('bar')).eql([bar, baz]); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(2); - // expect(e.removeListener('foo', foo)).equals(e); - // expect(e.listeners('bar')).eql([bar, baz]); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('foo', foo)).equals(e); + // expect(e.listeners('bar')).eql([bar, baz]); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(1); - // expect(e.removeListener('bar', bar)).equals(e); - // expect(e.listeners('bar')).eql([baz]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('bar', bar)).equals(e); + // expect(e.listeners('bar')).eql([baz]); + // expect(e.eventsCount).equals(1); - // expect(e.removeListener('bar', baz)).equals(e); - // expect(e.listeners('bar')).eql([]); - // expect(e.eventsCount).equals(0); - - // e.on('foo', foo); - // e.on('foo', foo); - // e.on('bar', bar); - - // expect(e.removeListener('foo', foo)).equals(e); - // expect(e.listeners('bar')).eql([bar]); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(1); - // }); - - // it('removes only the once listeners when using the once flag', function () { - // const e = new ESMitter(); - - // function foo() {} + // expect(e.removeListener('bar', baz)).equals(e); + // expect(e.listeners('bar')).eql([]); + // expect(e.eventsCount).equals(0); + + // e.on('foo', foo); + // e.on('foo', foo); + // e.on('bar', bar); + + // expect(e.removeListener('foo', foo)).equals(e); + // expect(e.listeners('bar')).eql([bar]); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(1); + // }); + + // it('removes only the once listeners when using the once flag', function () { + // const e = new ESMitter(); + + // function foo() {} - // e.on('foo', foo); + // e.on('foo', foo); - // expect(e.removeListener('foo', function () {}, undefined, true)).equals(e); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('foo', function () {}, undefined, true)).equals(e); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(1); - // expect(e.removeListener('foo', foo, undefined, true)).equals(e); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(1); - - // expect(e.removeListener('foo', foo)).equals(e); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(0); - - // e.once('foo', foo); - // e.on('foo', foo); - - // expect(e.removeListener('foo', function () {}, undefined, true)).equals(e); - // expect(e.listeners('foo')).eql([foo, foo]); - // expect(e.eventsCount).equals(1); - - // expect(e.removeListener('foo', foo, undefined, true)).equals(e); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('foo', foo, undefined, true)).equals(e); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(1); + + // expect(e.removeListener('foo', foo)).equals(e); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(0); + + // e.once('foo', foo); + // e.on('foo', foo); + + // expect(e.removeListener('foo', function () {}, undefined, true)).equals(e); + // expect(e.listeners('foo')).eql([foo, foo]); + // expect(e.eventsCount).equals(1); + + // expect(e.removeListener('foo', foo, undefined, true)).equals(e); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(1); - // e.once('foo', foo); + // e.once('foo', foo); - // expect(e.removeListener('foo', foo)).equals(e); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(0); - // }); + // expect(e.removeListener('foo', foo)).equals(e); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(0); + // }); - // it('removes only the listeners matching the correct context', function () { - // const context = { foo: 'bar' } - // , e = new ESMitter(); + // it('removes only the listeners matching the correct context', function () { + // const context = { foo: 'bar' } + // , e = new ESMitter(); - // function foo() {} - // function bar() {} + // function foo() {} + // function bar() {} - // e.on('foo', foo, context); + // e.on('foo', foo, context); - // expect(e.removeListener('foo', function () {}, context)).equals(e); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('foo', function () {}, context)).equals(e); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(1); - // expect(e.removeListener('foo', foo, { baz: 'quux' })).equals(e); - // expect(e.listeners('foo')).eql([foo]); - // expect(e.eventsCount).equals(1); + // expect(e.removeListener('foo', foo, { baz: 'quux' })).equals(e); + // expect(e.listeners('foo')).eql([foo]); + // expect(e.eventsCount).equals(1); - // expect(e.removeListener('foo', foo, context)).equals(e); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(0); - - // e.on('foo', foo, context); - // e.on('foo', bar); - - // expect(e.removeListener('foo', foo, { baz: 'quux' })).equals(e); - // expect(e.listeners('foo')).eql([foo, bar]); - // expect(e.eventsCount).equals(1); - - // expect(e.removeListener('foo', foo, context)).equals(e); - // expect(e.listeners('foo')).eql([bar]); - // expect(e.eventsCount).equals(1); - - // e.on('foo', bar, context); - - // expect(e.removeListener('foo', bar)).equals(e); - // expect(e.listeners('foo')).eql([]); - // expect(e.eventsCount).equals(0); - // }); - // }); + // expect(e.removeListener('foo', foo, context)).equals(e); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(0); + + // e.on('foo', foo, context); + // e.on('foo', bar); + + // expect(e.removeListener('foo', foo, { baz: 'quux' })).equals(e); + // expect(e.listeners('foo')).eql([foo, bar]); + // expect(e.eventsCount).equals(1); + + // expect(e.removeListener('foo', foo, context)).equals(e); + // expect(e.listeners('foo')).eql([bar]); + // expect(e.eventsCount).equals(1); + + // e.on('foo', bar, context); + + // expect(e.removeListener('foo', bar)).equals(e); + // expect(e.listeners('foo')).eql([]); + // expect(e.eventsCount).equals(0); + // }); + // }); - // describe('removeAllListeners', function () { - // it('removes all events for the specified events', function () { - // const e = new ESMitter(); + // describe('removeAllListeners', function () { + // it('removes all events for the specified events', function () { + // const e = new ESMitter(); - // e.on('foo', function () { throw new Error('oops'); }); - // e.on('foo', function () { throw new Error('oops'); }); - // e.on('bar', function () { throw new Error('oops'); }); - // e.on('aaa', function () { throw new Error('oops'); }); + // e.on('foo', function () { throw new Error('oops'); }); + // e.on('foo', function () { throw new Error('oops'); }); + // e.on('bar', function () { throw new Error('oops'); }); + // e.on('aaa', function () { throw new Error('oops'); }); - // expect(e.removeAllListeners('foo')).equals(e); - // expect(e.listeners('foo').length).equals(0); - // expect(e.listeners('bar').length).equals(1); - // expect(e.listeners('aaa').length).equals(1); - // expect(e.eventsCount).equals(2); + // expect(e.removeAllListeners('foo')).equals(e); + // expect(e.listeners('foo').length).equals(0); + // expect(e.listeners('bar').length).equals(1); + // expect(e.listeners('aaa').length).equals(1); + // expect(e.eventsCount).equals(2); - // expect(e.removeAllListeners('bar')).equals(e); - // expect(e.eventsCount).equals(1); - // expect(e.removeAllListeners('aaa')).equals(e); - // expect(e.eventsCount).equals(0); + // expect(e.removeAllListeners('bar')).equals(e); + // expect(e.eventsCount).equals(1); + // expect(e.removeAllListeners('aaa')).equals(e); + // expect(e.eventsCount).equals(0); - // expect(e.emit('foo')).equals(false); - // expect(e.emit('bar')).equals(false); - // expect(e.emit('aaa')).equals(false); - // }); + // expect(e.emit('foo')).equals(false); + // expect(e.emit('bar')).equals(false); + // expect(e.emit('aaa')).equals(false); + // }); - // it('just nukes the fuck out of everything', function () { - // const e = new ESMitter(); + // it('just nukes the fuck out of everything', function () { + // const e = new ESMitter(); - // e.on('foo', function () { throw new Error('oops'); }); - // e.on('foo', function () { throw new Error('oops'); }); - // e.on('bar', function () { throw new Error('oops'); }); - // e.on('aaa', function () { throw new Error('oops'); }); + // e.on('foo', function () { throw new Error('oops'); }); + // e.on('foo', function () { throw new Error('oops'); }); + // e.on('bar', function () { throw new Error('oops'); }); + // e.on('aaa', function () { throw new Error('oops'); }); - // expect(e.removeAllListeners()).equals(e); - // expect(e.listeners('foo').length).equals(0); - // expect(e.listeners('bar').length).equals(0); - // expect(e.listeners('aaa').length).equals(0); - // expect(e.eventsCount).equals(0); + // expect(e.removeAllListeners()).equals(e); + // expect(e.listeners('foo').length).equals(0); + // expect(e.listeners('bar').length).equals(0); + // expect(e.listeners('aaa').length).equals(0); + // expect(e.eventsCount).equals(0); - // expect(e.emit('foo')).equals(false); - // expect(e.emit('bar')).equals(false); - // expect(e.emit('aaa')).equals(false); - // }); - // }); + // expect(e.emit('foo')).equals(false); + // expect(e.emit('bar')).equals(false); + // expect(e.emit('aaa')).equals(false); + // }); + // }); - // describe('eventNames', function () { - // it('returns an empty array when there are no events', function () { - // const e = new ESMitter(); + // describe('eventNames', function () { + // it('returns an empty array when there are no events', function () { + // const e = new ESMitter(); - // expect(e.eventNames()).eql([]); + // expect(e.eventNames()).eql([]); - // e.on('foo', function () {}); - // e.removeAllListeners('foo'); + // e.on('foo', function () {}); + // e.removeAllListeners('foo'); - // expect(e.eventNames()).eql([]); - // }); + // expect(e.eventNames()).eql([]); + // }); - // it('returns an array listing the events that have listeners', function () { - // const e = new ESMitter() - // , original; + // it('returns an array listing the events that have listeners', function () { + // const e = new ESMitter() + // , original; - // function bar() {} + // function bar() {} - // if (Object.getOwnPropertySymbols) { - // // - // // Monkey patch `Object.getOwnPropertySymbols()` to increase coverage - // // on Node.js > 0.10. - // // - // original = Object.getOwnPropertySymbols; - // Object.getOwnPropertySymbols = undefined; - // } - - // e.on('foo', function () {}); - // e.on('bar', bar); - - // try { - // expect(e.eventNames()).eql(['foo', 'bar']); - // e.removeListener('bar', bar); - // expect(e.eventNames()).eql(['foo']); - // } catch (ex) { - // throw ex; - // } finally { - // if (original) Object.getOwnPropertySymbols = original; - // } - // }); - - // it('does not return inherited property identifiers', function () { - // const e = new ESMitter(); - - // function Collection() {} - // Collection.prototype.foo = function () { - // return 'foo'; - // }; - - // e._events = new Collection(); - - // expect(e._events.foo()).equal('foo'); - // expect(e.eventNames()).eql([]); - // }); - - // if ('undefined' !== typeof Symbol) it('includes ES6 symbols', function () { - // const e = new ESMitter() - // , s = Symbol('s'); - - // function foo() {} - - // e.on('foo', foo); - // e.on(s, function () {}); + // if (Object.getOwnPropertySymbols) { + // // + // // Monkey patch `Object.getOwnPropertySymbols()` to increase coverage + // // on Node.js > 0.10. + // // + // original = Object.getOwnPropertySymbols; + // Object.getOwnPropertySymbols = undefined; + // } + + // e.on('foo', function () {}); + // e.on('bar', bar); + + // try { + // expect(e.eventNames()).eql(['foo', 'bar']); + // e.removeListener('bar', bar); + // expect(e.eventNames()).eql(['foo']); + // } catch (ex) { + // throw ex; + // } finally { + // if (original) Object.getOwnPropertySymbols = original; + // } + // }); + + // it('does not return inherited property identifiers', function () { + // const e = new ESMitter(); + + // function Collection() {} + // Collection.prototype.foo = function () { + // return 'foo'; + // }; + + // e._events = new Collection(); + + // expect(e._events.foo()).equal('foo'); + // expect(e.eventNames()).eql([]); + // }); + + // if ('undefined' !== typeof Symbol) it('includes ES6 symbols', function () { + // const e = new ESMitter() + // , s = Symbol('s'); + + // function foo() {} + + // e.on('foo', foo); + // e.on(s, function () {}); - // expect(e.eventNames()).eql(['foo', s]); - - // e.removeListener('foo', foo); + // expect(e.eventNames()).eql(['foo', s]); + + // e.removeListener('foo', foo); - // expect(e.eventNames()).eql([s]); - // }); + // expect(e.eventNames()).eql([s]); + // }); }); }); diff --git a/tsconfig.json b/tsconfig.json index fb3f063..00884d9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,5 @@ "skipLibCheck": true, "declaration": true }, - "include": [ - "src/index.ts" - ] + "include": ["src/index.ts"] }