parent
08454ece46
commit
3951acbff5
@ -828,6 +828,9 @@ export function assertTSTupleType(node: Object, opts?: Object = {}): void {
|
|||||||
export function assertTSOptionalType(node: Object, opts?: Object = {}): void {
|
export function assertTSOptionalType(node: Object, opts?: Object = {}): void {
|
||||||
assert("TSOptionalType", node, opts);
|
assert("TSOptionalType", node, opts);
|
||||||
}
|
}
|
||||||
|
export function assertTSRestType(node: Object, opts?: Object = {}): void {
|
||||||
|
assert("TSRestType", node, opts);
|
||||||
|
}
|
||||||
export function assertTSUnionType(node: Object, opts?: Object = {}): void {
|
export function assertTSUnionType(node: Object, opts?: Object = {}): void {
|
||||||
assert("TSUnionType", node, opts);
|
assert("TSUnionType", node, opts);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -798,6 +798,11 @@ export function TSOptionalType(...args: Array<any>): Object {
|
|||||||
}
|
}
|
||||||
export { TSOptionalType as tsOptionalType };
|
export { TSOptionalType as tsOptionalType };
|
||||||
export { TSOptionalType as tSOptionalType };
|
export { TSOptionalType as tSOptionalType };
|
||||||
|
export function TSRestType(...args: Array<any>): Object {
|
||||||
|
return builder("TSRestType", ...args);
|
||||||
|
}
|
||||||
|
export { TSRestType as tsRestType };
|
||||||
|
export { TSRestType as tSRestType };
|
||||||
export function TSUnionType(...args: Array<any>): Object {
|
export function TSUnionType(...args: Array<any>): Object {
|
||||||
return builder("TSUnionType", ...args);
|
return builder("TSUnionType", ...args);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2686,6 +2686,20 @@ export function isTSOptionalType(node: Object, opts?: Object): boolean {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
export function isTSRestType(node: Object, opts?: Object): boolean {
|
||||||
|
if (!node) return false;
|
||||||
|
|
||||||
|
const nodeType = node.type;
|
||||||
|
if (nodeType === "TSRestType") {
|
||||||
|
if (typeof opts === "undefined") {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return shallowEqual(node, opts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
export function isTSUnionType(node: Object, opts?: Object): boolean {
|
export function isTSUnionType(node: Object, opts?: Object): boolean {
|
||||||
if (!node) return false;
|
if (!node) return false;
|
||||||
|
|
||||||
@ -4164,6 +4178,7 @@ export function isTSType(node: Object, opts?: Object): boolean {
|
|||||||
"TSArrayType" === nodeType ||
|
"TSArrayType" === nodeType ||
|
||||||
"TSTupleType" === nodeType ||
|
"TSTupleType" === nodeType ||
|
||||||
"TSOptionalType" === nodeType ||
|
"TSOptionalType" === nodeType ||
|
||||||
|
"TSRestType" === nodeType ||
|
||||||
"TSUnionType" === nodeType ||
|
"TSUnionType" === nodeType ||
|
||||||
"TSIntersectionType" === nodeType ||
|
"TSIntersectionType" === nodeType ||
|
||||||
"TSConditionalType" === nodeType ||
|
"TSConditionalType" === nodeType ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user