Update types (BigInt)
This commit is contained in:
@@ -125,6 +125,19 @@ Aliases: `Expression`, `Terminatorless`
|
||||
|
||||
---
|
||||
|
||||
### bigIntLiteral
|
||||
```javascript
|
||||
t.bigIntLiteral(value)
|
||||
```
|
||||
|
||||
See also `t.isBigIntLiteral(node, opts)` and `t.assertBigIntLiteral(node, opts)`.
|
||||
|
||||
Aliases: `Expression`, `Pureish`, `Literal`, `Immutable`
|
||||
|
||||
- `value`: `string` (required)
|
||||
|
||||
---
|
||||
|
||||
### binaryExpression
|
||||
```javascript
|
||||
t.binaryExpression(operator, left, right)
|
||||
|
||||
@@ -711,6 +711,9 @@ export function assertExportNamespaceSpecifier(
|
||||
export function assertPrivateName(node: Object, opts?: Object = {}): void {
|
||||
assert("PrivateName", node, opts);
|
||||
}
|
||||
export function assertBigIntLiteral(node: Object, opts?: Object = {}): void {
|
||||
assert("BigIntLiteral", node, opts);
|
||||
}
|
||||
export function assertTSParameterProperty(
|
||||
node: Object,
|
||||
opts?: Object = {},
|
||||
|
||||
@@ -644,6 +644,10 @@ export function PrivateName(...args: Array<any>): Object {
|
||||
return builder("PrivateName", ...args);
|
||||
}
|
||||
export { PrivateName as privateName };
|
||||
export function BigIntLiteral(...args: Array<any>): Object {
|
||||
return builder("BigIntLiteral", ...args);
|
||||
}
|
||||
export { BigIntLiteral as bigIntLiteral };
|
||||
export function TSParameterProperty(...args: Array<any>): Object {
|
||||
return builder("TSParameterProperty", ...args);
|
||||
}
|
||||
|
||||
@@ -2246,6 +2246,20 @@ export function isPrivateName(node: Object, opts?: Object): boolean {
|
||||
|
||||
return false;
|
||||
}
|
||||
export function isBigIntLiteral(node: Object, opts?: Object): boolean {
|
||||
if (!node) return false;
|
||||
|
||||
const nodeType = node.type;
|
||||
if (nodeType === "BigIntLiteral") {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
} else {
|
||||
return shallowEqual(node, opts);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
export function isTSParameterProperty(node: Object, opts?: Object): boolean {
|
||||
if (!node) return false;
|
||||
|
||||
@@ -3097,6 +3111,7 @@ export function isExpression(node: Object, opts?: Object): boolean {
|
||||
"OptionalCallExpression" === nodeType ||
|
||||
"Import" === nodeType ||
|
||||
"DoExpression" === nodeType ||
|
||||
"BigIntLiteral" === nodeType ||
|
||||
"TSAsExpression" === nodeType ||
|
||||
"TSTypeAssertion" === nodeType ||
|
||||
"TSNonNullExpression" === nodeType
|
||||
@@ -3481,7 +3496,8 @@ export function isPureish(node: Object, opts?: Object): boolean {
|
||||
"BooleanLiteral" === nodeType ||
|
||||
"ArrowFunctionExpression" === nodeType ||
|
||||
"ClassDeclaration" === nodeType ||
|
||||
"ClassExpression" === nodeType
|
||||
"ClassExpression" === nodeType ||
|
||||
"BigIntLiteral" === nodeType
|
||||
) {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
@@ -3606,7 +3622,8 @@ export function isLiteral(node: Object, opts?: Object): boolean {
|
||||
"NullLiteral" === nodeType ||
|
||||
"BooleanLiteral" === nodeType ||
|
||||
"RegExpLiteral" === nodeType ||
|
||||
"TemplateLiteral" === nodeType
|
||||
"TemplateLiteral" === nodeType ||
|
||||
"BigIntLiteral" === nodeType
|
||||
) {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
@@ -3636,7 +3653,8 @@ export function isImmutable(node: Object, opts?: Object): boolean {
|
||||
"JSXText" === nodeType ||
|
||||
"JSXFragment" === nodeType ||
|
||||
"JSXOpeningFragment" === nodeType ||
|
||||
"JSXClosingFragment" === nodeType
|
||||
"JSXClosingFragment" === nodeType ||
|
||||
"BigIntLiteral" === nodeType
|
||||
) {
|
||||
if (typeof opts === "undefined") {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user