How to use the tsUnknownKeyword function from @babel/types
Find comprehensive JavaScript @babel/types.tsUnknownKeyword code examples handpicked from public code repositorys.
20 21 22 23 24 25 26 27 28 29
}); if (schema.additionalProperties) { const index = schema.additionalProperties === true ? t.tsUnknownKeyword() : createInterface(schema.additionalProperties); const stringKey = t.identifier('key'); stringKey.typeAnnotation = t.tsTypeAnnotation(t.tsStringKeyword());
+ 23 other calls in file
GitHub: dfreeman/declgen
![dfreeman profile picture](/dfreeman.png?size=40)
87 88 89 90 91 92 93 94
} else if (typeof value === 'boolean') { return t.tsBooleanKeyword(); } else if (value === null || value === undefined) { return t.tsNullKeyword(); } else { return t.tsUnknownKeyword(); } }
+ 11 other calls in file
GitHub: groupon/esfixup
![groupon profile picture](/groupon.png?size=40)
49 50 51 52 53 54 55 56 57 58
parse(`type X = ${code}`, { plugins: ['typescript'] }) ); const { body } = parseResult.program; return t.isTSTypeAliasDeclaration(body[0]) ? body[0].typeAnnotation : t.tsUnknownKeyword(); } catch (err) { debug(`Failed to parse type string "${code}"`, err); return t.tsUnknownKeyword(); }
+ 11 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)