How to use the isTSUnknownKeyword function from @babel/types
Find comprehensive JavaScript @babel/types.isTSUnknownKeyword code examples handpicked from public code repositorys.
GitHub: vhfmag/tsguard.macro
16 17 18 19 20 21 22 23 24 25
* @returns {string} */ function typeToPartialGuard(type, tg) { if (t.isTSNeverKeyword(type)) { return "(() => false)"; } else if (t.isTSAnyKeyword(type) || t.isTSUnknownKeyword(type)) { return "(() => true)"; } else if (t.isTSUndefinedKeyword(type)) { return `${tg}.isUndefined`; } else if (t.isTSNullKeyword(type)) {
0
12
0
+ 4 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)