Sha256: f81b9ec56de2e863b9ec0aa9708cf04e29aeff90e27e0b4ce55a31b6fa33f1e4

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createTypeAnnotationBasedOnTypeof;

var _generated = require("../generated");

function createTypeAnnotationBasedOnTypeof(type) {
  if (type === "string") {
    return (0, _generated.stringTypeAnnotation)();
  } else if (type === "number") {
    return (0, _generated.numberTypeAnnotation)();
  } else if (type === "undefined") {
    return (0, _generated.voidTypeAnnotation)();
  } else if (type === "boolean") {
    return (0, _generated.booleanTypeAnnotation)();
  } else if (type === "function") {
    return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Function"));
  } else if (type === "object") {
    return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Object"));
  } else if (type === "symbol") {
    return (0, _generated.genericTypeAnnotation)((0, _generated.identifier)("Symbol"));
  } else if (type === "bigint") {
    return (0, _generated.anyTypeAnnotation)();
  } else {
    throw new Error("Invalid typeof value: " + type);
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.15.2 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.4 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.1 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.14.0 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js