How to use the objectTypeAnnotation function from babel-types
Find comprehensive JavaScript babel-types.objectTypeAnnotation code examples handpicked from public code repositorys.
131 132 133 134 135 136 137 138 139 140
t.stringLiteral('type'), ), ); } let CSSPropertySetType = t.objectTypeAnnotation(propList); CSSPropertySetType.exact = true; statementList.push( t.exportNamedDeclaration(
10
148
8
+ 5 other calls in file
115 116 117 118 119 120 121 122 123 124
if (!(field.type instanceof GraphQLNonNull)) { property.optional = true; } return property; }); return t.objectTypeAnnotation(props); } else { throw new Error(`Could not convert from GraphQL type ${type.toString()}`); } }
0
10
3
+ 5 other calls in file
19 20 21 22 23 24 25 26 27
* {| * PROPS * |} */ function exactObjectTypeAnnotation(props: Array<BabelAST>) { const typeAnnotation = t.objectTypeAnnotation(props); typeAnnotation.exact = true; return typeAnnotation; }
0
1
3
+ 5 other calls in file
GitHub: pranaygp/relay
68 69 70 71 72 73 74 75 76 77
function transform(node: Fragment | LinkedField): Annotation { return t.exportNamedDeclaration( t.typeAlias( t.identifier(node.name), null, t.objectTypeAnnotation( node.selections .map(selection => transformSelection(selection)) .reduce((prev, curr) => { if (!curr) {
0
1
2
+ 9 other calls in file
92 93 94 95 96 97 98 99 100 101
) ) ) { for (const concreteType in byConcreteType) { types.push( t.objectTypeAnnotation([ ...baseFields.map(selection => makeProp(selection, concreteType)), ...byConcreteType[concreteType].map( selection => makeProp(selection, concreteType) ),
0
0
2
+ 19 other calls in file
128 129 130 131 132 133 134 135 136 137
if (!(field.type instanceof GraphQLNonNull)) { property.optional = true; } return property; }); state.generatedInputObjectTypes[typeIdentifier] = t.objectTypeAnnotation( props, ); return t.identifier(typeIdentifier); } else {
0
0
3
+ 3 other calls in file
babel-types.identifier is the most popular function in babel-types (4076 examples)