How to use the booleanTypeAnnotation function from @babel/types
Find comprehensive JavaScript @babel/types.booleanTypeAnnotation code examples handpicked from public code repositorys.
168 169 170 171 172 173 174 175 176 177
* get object type annotation * @param {string} type field type */ function getObjectTypeAnnotation(type) { if (type.indexOf('DataTypes.BOOLEAN') > -1) { return t.booleanTypeAnnotation(); } if (type.indexOf('DataTypes.INTEGER') > -1) { return t.numberTypeAnnotation(); }
+ 15 other calls in file
82 83 84 85 86 87 88 89 90 91
buildString() { return bt.stringTypeAnnotation() } buildBoolean() { return bt.booleanTypeAnnotation() } buildBooleanLiteral(value/*: boolean*/) { const ast = bt.booleanLiteralTypeAnnotation(false)
+ 11 other calls in file
GitHub: deecewan/jsroutes-types

73 74 75 76 77 78 79 80 81 82
validValueId, null, t.unionTypeAnnotation([ t.stringTypeAnnotation(), t.numberTypeAnnotation(), t.booleanTypeAnnotation(), stringableValue, ]), ); const validValue = t.genericTypeAnnotation(validValueId);
+ 30 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)