From 9cf1d7a862a00ef43db7a99784a4e3b6ddf52f0c Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Mon, 18 Mar 2024 11:17:17 +0800 Subject: [PATCH] Update dependencies (#51) --- .github/workflows/ci.yml | 1 - delegate.ts | 6 +++--- one-event.ts | 1 - package.json | 14 +++++++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d6b2d8..b5c7195 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: npm install - - run: npm run build - run: npx vitest diff --git a/delegate.ts b/delegate.ts index 0ea558b..34659f0 100644 --- a/delegate.ts +++ b/delegate.ts @@ -113,13 +113,13 @@ function delegate< // Handle the regular Element usage const capture = Boolean(typeof options === 'object' ? options.capture : options); - const listenerFn = (event: Event): void => { + const listenerFunction = (event: Event): void => { const delegateTarget = safeClosest(event, selector); if (delegateTarget) { const delegateEvent = Object.assign(event, {delegateTarget}); callback.call(baseElement, delegateEvent as DelegateEvent); if (once) { - baseElement.removeEventListener(type, listenerFn, nativeListenerOptions); + baseElement.removeEventListener(type, listenerFunction, nativeListenerOptions); editLedger(false, baseElement, callback, setup); } } @@ -128,7 +128,7 @@ function delegate< const setup = JSON.stringify({selector, type, capture}); const isAlreadyListening = editLedger(true, baseElement, callback, setup); if (!isAlreadyListening) { - baseElement.addEventListener(type, listenerFn, nativeListenerOptions); + baseElement.addEventListener(type, listenerFunction, nativeListenerOptions); } signal?.addEventListener('abort', () => { diff --git a/one-event.ts b/one-event.ts index d07ae32..fb62414 100644 --- a/one-event.ts +++ b/one-event.ts @@ -50,7 +50,6 @@ async function oneEvent< delegate( selector, type, - // @ts-expect-error Seems to work fine resolve, options, ); diff --git a/package.json b/package.json index 57f74e5..852aa7b 100644 --- a/package.json +++ b/package.json @@ -48,14 +48,14 @@ } }, "dependencies": { - "typed-query-selector": "^2.10.0" + "typed-query-selector": "^2.11.2" }, "devDependencies": { - "@sindresorhus/tsconfig": "^3.0.1", - "@types/jsdom": "^21.1.1", - "jsdom": "^21.1.1", - "typescript": "^5.0.4", - "vitest": "^0.30.1", - "xo": "^0.54.1" + "@sindresorhus/tsconfig": "^5.0.0", + "@types/jsdom": "^21.1.6", + "jsdom": "^24.0.0", + "typescript": "^5.4.2", + "vitest": "^1.3.1", + "xo": "^0.58.0" } }