How to use the nullableTypeAnnotation function from @babel/types

Find comprehensive JavaScript @babel/types.nullableTypeAnnotation code examples handpicked from public code repositorys.

94
95
96
97
98
99
100
101
102
103
    t.stringTypeAnnotation(),
    t.mixedTypeAnnotation(),
  );
  return t.functionTypeParam(
    t.identifier('options'),
    t.nullableTypeAnnotation(t.objectTypeAnnotation(properties, [indexer])),
  );
}

// create type declarations
fork icon1
star icon3
watch icon2

+ 30 other calls in file

99
100
101
102
103
104
105
106
107
108

function transformInputType(type: GraphQLInputType, state: State) {
  if (type instanceof GraphQLNonNull) {
    return transformNonNullableInputType(type.ofType, state);
  } else {
    return t.nullableTypeAnnotation(transformNonNullableInputType(type, state));
  }
}

function transformNonNullableInputType(type: GraphQLInputType, state: State) {
fork icon0
star icon1
watch icon9

+ 19 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)