This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/@babel/plugin-transform-runtime/lib/helpers.js

48 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasMinVersion = hasMinVersion;
exports.typeAnnotationToString = typeAnnotationToString;
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function hasMinVersion(minVersion, runtimeVersion) {
if (!runtimeVersion) return true;
if (_semver().default.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
return !_semver().default.intersects(`<${minVersion}`, runtimeVersion) && !_semver().default.intersects(`>=8.0.0`, runtimeVersion);
}
function typeAnnotationToString(node) {
switch (node.type) {
case "GenericTypeAnnotation":
if (_core().types.isIdentifier(node.id, {
name: "Array"
})) return "array";
break;
case "StringTypeAnnotation":
return "string";
}
}