Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev deps #45

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,036 changes: 1,574 additions & 462 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@
},
"prettier": "@github/prettier-config",
"devDependencies": {
"@github/prettier-config": "^0.0.4",
"@types/node": "^20.3.1",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"chai": "^4.3.0",
"@github/prettier-config": "^0.0.6",
"@types/node": "^20.5.7",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"chai": "^4.3.8",
"chromium": "^3.0.3",
"eslint": "^8.8.0",
"eslint-plugin-github": "^4.1.1",
"karma": "^6.1.1",
"eslint": "^8.48.0",
"eslint-plugin-github": "^4.10.0",
"karma": "^6.4.2",
"karma-chai": "^0.1.0",
"karma-chai-spies": "^0.1.4",
"karma-chrome-launcher": "^3.1.0",
"karma-chrome-launcher": "^3.2.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"mocha": "^9.2.0",
"tslib": "^2.1.0",
"typescript": "^5.1.3"
"mocha": "^10.2.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
}
}
4 changes: 2 additions & 2 deletions src/aggregateerror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export class AggregateError extends Error {
Object.defineProperty(this, 'errors', {
value: Array.from(errors),
configurable: true,
writable: true
writable: true,
})
if (options.cause) {
Object.defineProperty(this, 'cause', {
value: options.cause,
configurable: true,
writable: true
writable: true,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/array-findlast.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function arrayFindLast<T>(
this: T[],
pred: (this: T[], value: T, i: number, array: T[]) => boolean,
recv = this
recv = this,
): T | void {
for (let i = this.length - 1; i >= 0; i -= 1) {
if (pred.call(recv, this[i], i, this)) return this[i]
Expand Down
4 changes: 2 additions & 2 deletions src/array-findlastindex.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function arrayFindLastIndex<T>(
this: T[],
pred: (this: T[], value: T, i: number, array: T[]) => boolean,
recv = this
recv = this,
): number {
for (let i = this.length - 1; i >= 0; i -= 1) {
if (pred.call(recv, this[i], i, this)) return i
Expand All @@ -24,7 +24,7 @@ export function apply(): void {
const defn = {
value: arrayFindLastIndex,
writable: true,
configurable: true
configurable: true,
}
Object.defineProperty(Array.prototype, 'findLastIndex', defn)
}
Expand Down
4 changes: 2 additions & 2 deletions src/event-abortsignal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function addEventListenerWithAbortSignal(
this: EventTarget,
type: string,
callback: EventListenerOrEventListenerObject | null,
options?: AddEventListenerOptions | boolean
options?: AddEventListenerOptions | boolean,
): void {
if (typeof options === 'object' && 'signal' in options && options.signal instanceof AbortSignal) {
if (options.signal.aborted) return
Expand All @@ -23,7 +23,7 @@ declare global {
export function isSupported(): boolean {
let signalSupported = false
const setSignalSupported = () => (signalSupported = true)
// eslint-disable-next-line @typescript-eslint/no-empty-function

function noop() {}
const options = Object.create({}, {signal: {get: setSignalSupported}})
try {
Expand Down
4 changes: 2 additions & 2 deletions src/form-requestsubmit.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function requestSubmit(
this: HTMLFormElement,
submitter: HTMLButtonElement | HTMLInputElement | null = null
submitter: HTMLButtonElement | HTMLInputElement | null = null,
): void {
const event = new SubmitEvent('submit', {bubbles: true, cancelable: true, submitter})
let input
Expand All @@ -9,7 +9,7 @@ export function requestSubmit(
type: 'hidden',
hidden: true,
name: submitter.name,
value: submitter.value
value: submitter.value,
})
this.append(input)
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const polyfills = {
requestIdleCallback,
stringReplaceAll,
arrayFindLast,
arrayFindLastIndex
arrayFindLastIndex,
}

export function isSupported() {
Expand Down
2 changes: 1 addition & 1 deletion src/object-hasown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function apply(): void {
Object.defineProperty(Object, 'hasOwn', {
value: objectHasOwn,
configurable: true,
writable: true
writable: true,
})
}
}
8 changes: 4 additions & 4 deletions src/promise-allsettled.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export function promiseAllSettled<T extends readonly unknown[] | []>(
values: T
values: T,
): Promise<{-readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>}> {
return Promise.all(
values.map(p =>
// eslint-disable-next-line github/no-then
Promise.resolve(p).then(
(value: unknown) => ({status: 'fulfilled', value}),
(reason: unknown) => ({status: 'rejected', reason})
)
)
(reason: unknown) => ({status: 'rejected', reason}),
),
),
) as unknown as Promise<{-readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>>}>
}

Expand Down
6 changes: 3 additions & 3 deletions src/requestidlecallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export function requestIdleCallback(callback: IdleRequestCallback, options: Idle
didTimeout: false,
timeRemaining() {
return Math.max(0, maxDeadline - (Date.now() - start))
}
},
},
'didTimeout',
{
get() {
return Date.now() - start > timeout
}
}
},
},
)
return window.setTimeout(() => {
callback(deadline)
Expand Down
2 changes: 1 addition & 1 deletion src/string-replaceall.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function stringReplaceAll(
this: string,
searchValue: RegExp | string,
replaceValue: ((substring: string, ...args: unknown[]) => string) | string
replaceValue: ((substring: string, ...args: unknown[]) => string) | string,
): string {
if (searchValue instanceof RegExp) return this.replace(searchValue, replaceValue as unknown as string)
let pos = -1
Expand Down
4 changes: 2 additions & 2 deletions test/array-findlast.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe('arrayFindLast', () => {
expect(_arr).to.equal(arr)
expect(v).to.equal(arr[i])
},
recv
)
recv,
),
)
})
})
4 changes: 2 additions & 2 deletions test/array-findlastindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe('arrayFindLastIndex', () => {
expect(_arr).to.equal(arr)
expect(v).to.equal(arr[i])
},
recv
)
recv,
),
)
})
})
2 changes: 1 addition & 1 deletion test/crypto-randomuuid.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('randomUUID', () => {

it('returns a UUID string', async () => {
expect(randomUUID()).to.match(
/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/
/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
)
expect(randomUUID()).to.not.equal(randomUUID())
})
Expand Down
8 changes: 4 additions & 4 deletions test/karma.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (config) {
frameworks: ['mocha', 'chai'],
files: [
{pattern: 'lib/*.js', type: 'module', included: false},
{pattern: 'test/*', type: 'module', included: true}
{pattern: 'test/*', type: 'module', included: true},
],
reporters: ['mocha'],
reportSlowerThan: 50,
Expand All @@ -19,8 +19,8 @@ module.exports = function (config) {
concurrency: Infinity,
client: {
mocha: {
timeout: 100
}
}
timeout: 100,
},
},
})
}
10 changes: 5 additions & 5 deletions test/navigator-clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe('navigator clipboard', () => {
await clipboardWrite([
new globalThis.ClipboardItem({
'foo/bar': 'horrible',
'text/plain': Promise.resolve('foo')
})
'text/plain': Promise.resolve('foo'),
}),
])
expect(calls).to.have.lengthOf(1)
expect(calls[0]).to.eql(['foo'])
Expand All @@ -40,12 +40,12 @@ describe('navigator clipboard', () => {
await clipboardWrite([
new globalThis.ClipboardItem({
'foo/bar': 'horrible',
'text/plain': Promise.resolve('multiple-pass')
'text/plain': Promise.resolve('multiple-pass'),
}),
new globalThis.ClipboardItem({
'foo/bar': 'multiple-fail',
'text/plain': Promise.resolve('multiple-fail')
})
'text/plain': Promise.resolve('multiple-fail'),
}),
])
expect(calls).to.have.lengthOf(1)
expect(calls[0]).to.eql(['multiple-pass'])
Expand Down
4 changes: 2 additions & 2 deletions test/promise-allsettled.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe('Promise.allSettled', () => {
it('returns list of Promise value/rejections', async () => {
expect(
// eslint-disable-next-line prefer-promise-reject-errors
await promiseAllSettled([Promise.resolve(1), Promise.reject(2), Promise.resolve(3), Promise.reject(4)])
await promiseAllSettled([Promise.resolve(1), Promise.reject(2), Promise.resolve(3), Promise.reject(4)]),
).to.eql([
{status: 'fulfilled', value: 1},
{status: 'rejected', reason: 2},
{status: 'fulfilled', value: 3},
{status: 'rejected', reason: 4}
{status: 'rejected', reason: 4},
])
})
})