Sha256: 53b782c9c97ff03881706944808c6119f8c286f370d8d65437a09b7e5807e17f

Contents?: true

Size: 995 Bytes

Versions: 63

Compression:

Stored size: 995 Bytes

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 {
    throw new Error("Invalid typeof value");
  }
}

Version data entries

63 entries across 62 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.0 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.2 test/dummy/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.7 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.6 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.5 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.4 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.16.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.15.2 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.3 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.2 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.4 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.18.1 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.14.0 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/preset-modules/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.1 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-4.3.5 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-5.0.0 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js
trusty-cms-4.3.4 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js