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

Add ow.bigint #212

Merged
merged 4 commits into from
Jun 5, 2021
Merged

Add ow.bigint #212

merged 4 commits into from
Jun 5, 2021

Conversation

wafuwafu13
Copy link
Contributor

Resolve: #54

@@ -2,9 +2,9 @@
"extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"outDir": "dist",
"target": "es2018",
"target": "es2020",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change because test failed.

Uncaught exception in test/bigint.ts
 
   test/bigint.ts:12:6 - error TS2737: BigInt literals are not available when targeting lower than ES2020.
 
   12    ow(9007199254740991n, ow.bigint);
            ~~~~~~~~~~~~~~~~~

test/types.ts Outdated
@@ -106,6 +106,8 @@ function typeTests(value: unknown): Array<(() => void)> {
const tests: Tests = {
array: expect => expect.toBeArray(),
arrayBuffer: expect => expect.toEqualTypeOf<ArrayBuffer>(),
// eslint-disable-next-line node/no-unsupported-features/es-builtins, node/no-unsupported-features/es-syntax
bigint: expect => expect.toEqualTypeOf<BigInt>(10n as never),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

スクリーンショット 2021-06-05 10 27 26

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure what the screenshot is trying to illustrate? But it's better to use @ts-expect-error if there's really no way to make it work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I use @ts-expect-error. 83657b6

@wafuwafu13
Copy link
Contributor Author

I don't know why only node10,12 fails the test because of SyntaxError.
Bigint is supported in node10.

@sindresorhus
Copy link
Owner

I don't know why only node10,12 fails the test because of SyntaxError.
Bigint is supported in node10.

It's fine. I'm going to drop Node.js 10 support after merging this PR.

@sindresorhus sindresorhus merged commit 0441b98 into sindresorhus:main Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BigInt validator
2 participants