Skip to content

Commit

Permalink
Bump the dev-dependencies group with 2 updates (#448)
Browse files Browse the repository at this point in the history
* Bump the dev-dependencies group with 2 updates

Bumps the dev-dependencies group with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `@types/node` from 16.18.106 to 16.18.108
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `typescript-eslint` from 8.0.1 to 8.4.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.4.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: dev-dependencies
- dependency-name: typescript-eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix eslint errors

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Colin Casey <casey.colin@gmail.com>
  • Loading branch information
dependabot[bot] and colincasey authored Sep 5, 2024
1 parent 93d550b commit b72cdb2
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 126 deletions.
22 changes: 11 additions & 11 deletions lib/__tests__/cookieJar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('CookieJar', () => {
cookieJar.setCookie('=b', 'http://example.com/index.html', {
loose: false,
}),
).rejects.toThrowError('Cookie failed to parse')
).rejects.toThrow('Cookie failed to parse')
})

it('should not default to loose: true when using map', () => {
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('CookieJar', () => {
'a=b; Domain=fooxample.com; Path=/',
'http://example.com/index.html',
),
).rejects.toThrowError(
).rejects.toThrow(
"Cookie not in this host's domain. Cookie:fooxample.com Request:example.com",
)
})
Expand All @@ -266,7 +266,7 @@ describe('CookieJar', () => {
'a=b; Domain=www.example.com; Path=/',
'http://example.com/index.html',
),
).rejects.toThrowError(
).rejects.toThrow(
"Cookie not in this host's domain. Cookie:www.example.com Request:example.com",
)
})
Expand Down Expand Up @@ -301,7 +301,7 @@ describe('CookieJar', () => {
'http://example.com/index.html',
{ http: false },
),
).rejects.toThrowError("Cookie is HttpOnly and this isn't an HTTP API")
).rejects.toThrow("Cookie is HttpOnly and this isn't an HTTP API")
})

it('should not fail when using an httpOnly cookie when using a non-HTTP API', async () => {
Expand Down Expand Up @@ -1069,7 +1069,7 @@ describe('setCookie errors', () => {
const cookieJar = new CookieJar()
await expect(
cookieJar.setCookie('i=9; Domain=kyoto.jp; Path=/', 'http://kyoto.jp'),
).rejects.toThrowError('Cookie has domain set to a public suffix')
).rejects.toThrow('Cookie has domain set to a public suffix')
})

it('should throw an error if domains do not match', async () => {
Expand All @@ -1079,7 +1079,7 @@ describe('setCookie errors', () => {
'j=10; Domain=google.com; Path=/',
'http://google.ca',
),
).rejects.toThrowError(
).rejects.toThrow(
`Cookie not in this host's domain. Cookie:google.com Request:google.ca`,
)
})
Expand All @@ -1097,7 +1097,7 @@ describe('setCookie errors', () => {
'http://example.ca',
{ http: false },
),
).rejects.toThrowError("old Cookie is HttpOnly and this isn't an HTTP API")
).rejects.toThrow("old Cookie is HttpOnly and this isn't an HTTP API")

const cookies = await cookieJar.getCookies('http://example.ca', {
http: true,
Expand Down Expand Up @@ -1149,7 +1149,7 @@ it('should fix issue #132', async () => {
await expect(
// @ts-expect-error test case is explicitly testing invalid input
cookieJar.setCookie({ key: 'x', value: 'y' }, 'http://example.com/'),
).rejects.toThrowError(
).rejects.toThrow(
'First argument to setCookie must be a Cookie object or string',
)
})
Expand Down Expand Up @@ -1186,9 +1186,9 @@ it('should fix issue #145 - missing 2nd url parameter', async () => {

it('should fix issue #197 - CookieJar().setCookie throws an error when empty cookie is passed', async () => {
const cookieJar = new CookieJar()
await expect(
cookieJar.setCookie('', 'https://google.com'),
).rejects.toThrowError('Cookie failed to parse')
await expect(cookieJar.setCookie('', 'https://google.com')).rejects.toThrow(
'Cookie failed to parse',
)
})

it('should fix issue #282 - Prototype pollution when setting a cookie with the domain __proto__', () => {
Expand Down
4 changes: 2 additions & 2 deletions lib/__tests__/cookiePrefixes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ describe('When `prefixSecurity` is enabled for `CookieJar`', () => {
insecureUrl,
{},
),
).rejects.toThrowError(
).rejects.toThrow(
'Cookie has __Secure prefix but Secure attribute is not set',
)
})
Expand Down Expand Up @@ -161,7 +161,7 @@ describe('When `prefixSecurity` is enabled for `CookieJar`', () => {
secureUrl,
{},
),
).rejects.toThrowError(
).rejects.toThrow(
`Cookie has __Host prefix but either Secure or HostOnly attribute is not set or Path is not '/'`,
)
})
Expand Down
6 changes: 3 additions & 3 deletions lib/__tests__/jarSerialization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('cookieJar serialization', () => {
store.synchronous = true

const jar = new CookieJar(store)
expect(() => jar.toJSON()).toThrowError(
expect(() => jar.toJSON()).toThrow(
'getAllCookies is not implemented (therefore jar cannot be serialized)',
)
})
Expand All @@ -76,7 +76,7 @@ describe('cookieJar serialization', () => {
const store = new MemoryCookieStore()
store.synchronous = false
const jar = new CookieJar(store)
expect(() => jar.toJSON()).toThrowError(
expect(() => jar.toJSON()).toThrow(
'CookieJar store is not synchronous; use async API instead.',
)
})
Expand Down Expand Up @@ -165,7 +165,7 @@ describe('cookieJar serialization', () => {
it('should raise an error when attempting to synchronously clone to an async store', () => {
const newStore = new MemoryCookieStore()
newStore.synchronous = false
expect(() => jar.cloneSync(newStore)).toThrowError(
expect(() => jar.cloneSync(newStore)).toThrow(
'CookieJar clone destination store is not synchronous; use async API instead.',
)
})
Expand Down
2 changes: 1 addition & 1 deletion lib/__tests__/removeAll.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('store removeAllCookies API', () => {
_removeCookie.call(store, domain, path, key, callback)
})

await expect(jar.removeAllCookies()).rejects.toThrowError(
await expect(jar.removeAllCookies()).rejects.toThrow(
'something happened 1',
)

Expand Down
4 changes: 2 additions & 2 deletions lib/__tests__/sameSite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@ describe('Same-Site Cookies', function () {
it('should not allow strict cookie to be set', async () => {
await expect(
cookieJar.setCookie(strict, url, { sameSiteContext: 'none' }),
).rejects.toThrowError(
).rejects.toThrow(
'Cookie is SameSite but this is a cross-origin request',
)
})

it('should not allow lax cookie to be set', async () => {
await expect(
cookieJar.setCookie(lax, url, { sameSiteContext: 'none' }),
).rejects.toThrowError(
).rejects.toThrow(
'Cookie is SameSite but this is a cross-origin request',
)
})
Expand Down
5 changes: 2 additions & 3 deletions lib/cookie/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function parseCookiePair(
if (looseMode) {
if (firstEq === 0) {
// '=' is immediately at start
cookiePair = cookiePair.substr(1)
cookiePair = cookiePair.substring(1)
firstEq = cookiePair.indexOf('=') // might still need to split on '='
}
} else {
Expand Down Expand Up @@ -284,8 +284,7 @@ function fromJSON(str: unknown): Cookie | undefined {
if (typeof str === 'string') {
try {
obj = JSON.parse(str)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
} catch {
return undefined
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/cookie/cookieJar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ export class CookieJar {
): Promise<void> {
return this.putCookie(newCookie).then(
() => cb?.(null),
(error: Error) => cb?.(error),
(error: unknown) => cb?.(error as Error),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/cookie/domainMatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function domainMatch(

/* " * The last character of the string that is not included in the
* domain string is a %x2E (".") character." */
if (_str.substr(idx - 1, 1) !== '.') {
if (_str.substring(idx - 1, idx) !== '.') {
return false // doesn't align on "."
}

Expand Down
Loading

0 comments on commit b72cdb2

Please sign in to comment.