Skip to content

Commit

Permalink
Update dependencies (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Mar 18, 2024
1 parent a4d6f5d commit 9cf1d7a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run build
- run: npx vitest
6 changes: 3 additions & 3 deletions delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GlobalEventHandlersEventMap[TEventType], TElement>);
if (once) {
baseElement.removeEventListener(type, listenerFn, nativeListenerOptions);
baseElement.removeEventListener(type, listenerFunction, nativeListenerOptions);
editLedger(false, baseElement, callback, setup);
}
}
Expand All @@ -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', () => {
Expand Down
1 change: 0 additions & 1 deletion one-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ async function oneEvent<
delegate(
selector,
type,
// @ts-expect-error Seems to work fine
resolve,
options,
);
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 9cf1d7a

Please sign in to comment.