How to use the anyTypeAnnotation function from babel-types

Find comprehensive JavaScript babel-types.anyTypeAnnotation code examples handpicked from public code repositorys.

76
77
78
79
80
81
82
83
84
85
    case 'Int':
      return t.numberTypeAnnotation();
    case 'Boolean':
      return t.booleanTypeAnnotation();
    default:
      return t.anyTypeAnnotation();
  }
}

function transformGraphQLEnumType(type: GraphQLEnumType, state: State) {
fork icon0
star icon10
watch icon3

+ 5 other calls in file

102
103
104
105
106
107
108
109
110
111

function transformInputObjectField(name: string, type: GraphQLInputType, state: State) {
  const { generatedTypes } = state;
  const id = t.identifier(name);
  if (generatedTypes.indexOf(getRawType(type).toString()) > -1) {
    const anyType = t.anyTypeAnnotation();
    if (type instanceof GraphQLList)
      return t.objectTypeProperty(id, readOnlyArrayOfType(anyType));
    else
      return t.objectTypeProperty(id, anyType);
fork icon0
star icon0
watch icon2

+ 11 other calls in file

86
87
88
89
90
91
92
93
94
      return t.numberTypeAnnotation();
    case 'Boolean':
      return t.booleanTypeAnnotation();
    default:
      return customType == null
        ? t.anyTypeAnnotation()
        : t.genericTypeAnnotation(t.identifier(customType));
  }
}
fork icon0
star icon0
watch icon2

+ 3 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 (4076 examples)