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 bigint to the primitive type #87

Merged
merged 5 commits into from
Jun 23, 2019
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ Issues can be funded by anyone and the money will be transparently distributed t

### `Primitive`

Type representing primitive types in TypeScript: `number | boolean | string | symbol`
Type representing primitive types in JavaScript, and thus TypeScript: `number | bigint | boolean | string | symbol`

You can test for singular of these types with [`typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof)

[⇧ back to top](#table-of-contents)

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"ci-check": "npm run prettier && npm run lint && npm run tsc && npm run test",
"reinstall": "rm -rf node_modules/ dist/ && npm install",
"prettier": "prettier --list-different 'src/**/*.ts' || (echo '\nPlease fix code formatting by running:\nnpm run prettier:fix\n'; exit 1)",
"prettier:fix": "prettier --write 'src/**/*.ts'",
"lint": "tslint --project './tsconfig.json'",
"prettier:fix": "prettier --write src/**/*.ts",
"lint": "tslint --project ./tsconfig.json",
"tsc": "tsc -p . --noEmit",
"tsc:watch": "tsc -p . --noEmit -w",
"test": "jest --config jest.config.json",
"test:watch": "jest --config jest.config.json --watch",
"test:update": "jest --config jest.config.json --no-cache -u && dts-jest-remap ./src/*.spec.ts --rename '{{basename}}.snap.{{extname}}'",
"test:update": "jest --config jest.config.json --no-cache -u && dts-jest-remap ./src/*.spec.ts --rename {{basename}}.snap.{{extname}}",
"prebuild": "rm -rf dist/",
"build": "tsc -p ./tsconfig.build.json --outDir dist/",
"prepublishOnly": "npm run reinstall && npm run ci-check && npm run build"
Expand Down
8 changes: 4 additions & 4 deletions src/mapped-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

/**
* Primitive
* @desc Type representing primitive types in TypeScript: `number | boolean | string | symbol`
* @desc Type representing primitive types in TypeScript: `number | bigint | boolean | string | symbol`
* @example
* type Various = number | boolean | string | symbol | object;
* type Various = number | string | object;
*
* // Expect: object
* Exclude<Various, Primitive>
* type Cleaned = Exclude<Various, Primitive>
*/
export type Primitive = number | boolean | string | symbol;
export type Primitive = number | bigint | boolean | string | symbol;

/**
* Falsey
Expand Down