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

fix: support use on Node.js 16 #550

Merged
merged 2 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { LRU } from 'ylru';
import { patchForNode16 } from './utils.js';

patchForNode16();
fengmk2 marked this conversation as resolved.
Show resolved Hide resolved

import { HttpClient, HEADER_USER_AGENT } from './HttpClient.js';
import { RequestOptions, RequestURL } from './Request.js';

Expand Down
28 changes: 28 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { randomBytes, createHash } from 'node:crypto';
import { Readable } from 'node:stream';
import { performance } from 'node:perf_hooks';
import { ReadableStream } from 'node:stream/web';
import { Blob } from 'node:buffer';
import type { FixJSONCtlChars } from './Request.js';
import { SocketInfo } from './Response.js';
import symbols from './symbols.js';
Expand Down Expand Up @@ -205,3 +207,29 @@
}
return res;
}

// support require from Node.js 16
export function patchForNode16() {
if (typeof global.ReadableStream === 'undefined') {
// @ts-ignore

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 214 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
global.ReadableStream = ReadableStream;
}
if (typeof global.Blob === 'undefined') {
// @ts-ignore

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 218 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
global.Blob = Blob;
}
if (typeof global.DOMException === 'undefined') {
// @ts-ignore

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 222 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
global.DOMException = getDOMExceptionClass();
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace @ts-ignore with @ts-expect-error

The static analysis tools correctly flag the usage of @ts-ignore. Using @ts-expect-error is preferred as it will error if the type error is fixed, preventing stale suppressions.

-    // @ts-ignore
+    // @ts-expect-error
     global.ReadableStream = ReadableStream;
-    // @ts-ignore
+    // @ts-expect-error
     global.Blob = Blob;
-    // @ts-ignore
+    // @ts-expect-error
     global.DOMException = getDOMExceptionClass();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function patchForNode16() {
if (typeof global.ReadableStream === 'undefined') {
// @ts-ignore
global.ReadableStream = ReadableStream;
}
if (typeof global.Blob === 'undefined') {
// @ts-ignore
global.Blob = Blob;
}
if (typeof global.DOMException === 'undefined') {
// @ts-ignore
global.DOMException = getDOMExceptionClass();
}
}
export function patchForNode16() {
if (typeof global.ReadableStream === 'undefined') {
// @ts-expect-error
global.ReadableStream = ReadableStream;
}
if (typeof global.Blob === 'undefined') {
// @ts-expect-error
global.Blob = Blob;
}
if (typeof global.DOMException === 'undefined') {
// @ts-expect-error
global.DOMException = getDOMExceptionClass();
}
}
🧰 Tools
🪛 eslint

[error] 214-214: Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free.

(@typescript-eslint/ban-ts-comment)


[error] 218-218: Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free.

(@typescript-eslint/ban-ts-comment)


[error] 222-222: Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free.

(@typescript-eslint/ban-ts-comment)

🪛 GitHub Check: Node.js / Test (windows-latest, 23)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (windows-latest, 22)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (windows-latest, 20)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (windows-latest, 18.19.0)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (windows-latest, 18)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 23)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 22)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 20)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 18.19.0)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (ubuntu-latest, 18)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (macos-latest, 23)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (macos-latest, 22)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (macos-latest, 18.19.0)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (macos-latest, 18)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

🪛 GitHub Check: Node.js / Test (macos-latest, 20)

[failure] 214-214:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 218-218:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


[failure] 222-222:
Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free


// https://github.com/jimmywarting/node-domexception/blob/main/index.js
function getDOMExceptionClass() {
try {
// @ts-ignore

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (ubuntu-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (macos-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 23)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 22)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18.19.0)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 20)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 230 in src/utils.ts

View workflow job for this annotation

GitHub Actions / Node.js / Test (windows-latest, 18)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
atob(0);
} catch (err: any) {
return err.constructor;
}
}
Loading