This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -4,19 +4,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _trimRight() {
const data = _interopRequireDefault(require("trim-right"));
_trimRight = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const SPACES_RE = /^[ \t]+$/;
class Buffer {
@@ -44,9 +31,9 @@ class Buffer {
const map = this._map;
const result = {
code: (0, _trimRight().default)(this._buf.join("")),
code: this._buf.join("").trimRight(),
map: null,
rawMappings: map && map.getRawMappings()
rawMappings: map == null ? void 0 : map.getRawMappings()
};
if (map) {
@@ -221,10 +208,10 @@ class Buffer {
const origLine = targetObj.line;
const origColumn = targetObj.column;
const origFilename = targetObj.filename;
targetObj.identifierName = prop === "start" && loc && loc.identifierName || null;
targetObj.line = pos ? pos.line : null;
targetObj.column = pos ? pos.column : null;
targetObj.filename = loc && loc.filename || null;
targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
targetObj.line = pos == null ? void 0 : pos.line;
targetObj.column = pos == null ? void 0 : pos.column;
targetObj.filename = loc == null ? void 0 : loc.filename;
if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
targetObj.force = force;

View File

@@ -28,9 +28,11 @@ function Program(node) {
}
function BlockStatement(node) {
var _node$directives;
this.token("{");
this.printInnerComments(node);
const hasDirectives = node.directives && node.directives.length;
const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
if (node.body.length || hasDirectives) {
this.newline();

View File

@@ -11,20 +11,14 @@ exports.ClassMethod = ClassMethod;
exports.ClassPrivateMethod = ClassPrivateMethod;
exports._classMethodHead = _classMethodHead;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function ClassDeclaration(node, parent) {
if (!this.format.decoratorsBeforeExport || !t().isExportDefaultDeclaration(parent) && !t().isExportNamedDeclaration(parent)) {
if (!this.format.decoratorsBeforeExport || !t.isExportDefaultDeclaration(parent) && !t.isExportNamedDeclaration(parent)) {
this.printJoin(node.decorators, node);
}
@@ -84,26 +78,7 @@ function ClassBody(node) {
function ClassProperty(node) {
this.printJoin(node.decorators, node);
if (node.accessibility) {
this.word(node.accessibility);
this.space();
}
if (node.static) {
this.word("static");
this.space();
}
if (node.abstract) {
this.word("abstract");
this.space();
}
if (node.readonly) {
this.word("readonly");
this.space();
}
this.tsPrintClassMemberModifiers(node, true);
if (node.computed) {
this.token("[");
@@ -170,21 +145,7 @@ function ClassPrivateMethod(node) {
function _classMethodHead(node) {
this.printJoin(node.decorators, node);
if (node.accessibility) {
this.word(node.accessibility);
this.space();
}
if (node.abstract) {
this.word("abstract");
this.space();
}
if (node.static) {
this.word("static");
this.space();
}
this.tsPrintClassMemberModifiers(node, false);
this._methodHead(node);
}

View File

@@ -25,21 +25,16 @@ exports.BindExpression = BindExpression;
exports.MemberExpression = MemberExpression;
exports.MetaProperty = MetaProperty;
exports.PrivateName = PrivateName;
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
exports.AwaitExpression = exports.YieldExpression = void 0;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
var t = _interopRequireWildcard(require("@babel/types"));
var n = _interopRequireWildcard(require("../node"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function UnaryExpression(node) {
if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
@@ -93,9 +88,9 @@ function NewExpression(node, parent) {
this.space();
this.print(node.callee, node);
if (this.format.minified && node.arguments.length === 0 && !node.optional && !t().isCallExpression(parent, {
if (this.format.minified && node.arguments.length === 0 && !node.optional && !t.isCallExpression(parent, {
callee: node
}) && !t().isMemberExpression(parent) && !t().isNewExpression(parent)) {
}) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) {
return;
}
@@ -132,13 +127,13 @@ function Decorator(node) {
function OptionalMemberExpression(node) {
this.print(node.object, node);
if (!node.computed && t().isMemberExpression(node.property)) {
if (!node.computed && t.isMemberExpression(node.property)) {
throw new TypeError("Got a MemberExpression for MemberExpression property");
}
let computed = node.computed;
if (t().isLiteral(node.property) && typeof node.property.value === "number") {
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
computed = true;
}
@@ -260,13 +255,13 @@ function BindExpression(node) {
function MemberExpression(node) {
this.print(node.object, node);
if (!node.computed && t().isMemberExpression(node.property)) {
if (!node.computed && t.isMemberExpression(node.property)) {
throw new TypeError("Got a MemberExpression for MemberExpression property");
}
let computed = node.computed;
if (t().isLiteral(node.property) && typeof node.property.value === "number") {
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
computed = true;
}
@@ -289,4 +284,9 @@ function MetaProperty(node) {
function PrivateName(node) {
this.token("#");
this.print(node.id, node);
}
function V8IntrinsicIdentifier(node) {
this.token("%");
this.word(node.name);
}

View File

@@ -20,6 +20,15 @@ exports.DeclareOpaqueType = DeclareOpaqueType;
exports.DeclareVariable = DeclareVariable;
exports.DeclareExportDeclaration = DeclareExportDeclaration;
exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
exports.EnumDeclaration = EnumDeclaration;
exports.EnumBooleanBody = EnumBooleanBody;
exports.EnumNumberBody = EnumNumberBody;
exports.EnumStringBody = EnumStringBody;
exports.EnumSymbolBody = EnumSymbolBody;
exports.EnumDefaultedMember = EnumDefaultedMember;
exports.EnumBooleanMember = EnumBooleanMember;
exports.EnumNumberMember = EnumNumberMember;
exports.EnumStringMember = EnumStringMember;
exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
exports.FunctionTypeParam = FunctionTypeParam;
@@ -49,6 +58,7 @@ exports.ObjectTypeIndexer = ObjectTypeIndexer;
exports.ObjectTypeProperty = ObjectTypeProperty;
exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
exports.UnionTypeAnnotation = UnionTypeAnnotation;
exports.TypeCastExpression = TypeCastExpression;
exports.Variance = Variance;
@@ -66,21 +76,15 @@ Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
}
});
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
var t = _interopRequireWildcard(require("@babel/types"));
var _modules = require("./modules");
var _types2 = require("./types");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function AnyTypeAnnotation() {
this.word("any");
@@ -105,7 +109,7 @@ function NullLiteralTypeAnnotation() {
}
function DeclareClass(node, parent) {
if (!t().isDeclareExportDeclaration(parent)) {
if (!t.isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
@@ -117,7 +121,7 @@ function DeclareClass(node, parent) {
}
function DeclareFunction(node, parent) {
if (!t().isDeclareExportDeclaration(parent)) {
if (!t.isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
@@ -180,7 +184,7 @@ function DeclareTypeAlias(node) {
}
function DeclareOpaqueType(node, parent) {
if (!t().isDeclareExportDeclaration(parent)) {
if (!t.isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
@@ -189,7 +193,7 @@ function DeclareOpaqueType(node, parent) {
}
function DeclareVariable(node, parent) {
if (!t().isDeclareExportDeclaration(parent)) {
if (!t.isDeclareExportDeclaration(parent)) {
this.word("declare");
this.space();
}
@@ -222,11 +226,112 @@ function DeclareExportAllDeclaration() {
_modules.ExportAllDeclaration.apply(this, arguments);
}
function EnumDeclaration(node) {
const {
id,
body
} = node;
this.word("enum");
this.space();
this.print(id, node);
this.print(body, node);
}
function enumExplicitType(context, name, hasExplicitType) {
if (hasExplicitType) {
context.space();
context.word("of");
context.space();
context.word(name);
}
context.space();
}
function enumBody(context, node) {
const {
members
} = node;
context.token("{");
context.indent();
context.newline();
for (const member of members) {
context.print(member, node);
context.newline();
}
context.dedent();
context.token("}");
}
function EnumBooleanBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "boolean", explicitType);
enumBody(this, node);
}
function EnumNumberBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "number", explicitType);
enumBody(this, node);
}
function EnumStringBody(node) {
const {
explicitType
} = node;
enumExplicitType(this, "string", explicitType);
enumBody(this, node);
}
function EnumSymbolBody(node) {
enumExplicitType(this, "symbol", true);
enumBody(this, node);
}
function EnumDefaultedMember(node) {
const {
id
} = node;
this.print(id, node);
this.token(",");
}
function enumInitializedMember(context, node) {
const {
id,
init
} = node;
context.print(id, node);
context.space();
context.token("=");
context.space();
context.print(init, node);
context.token(",");
}
function EnumBooleanMember(node) {
enumInitializedMember(this, node);
}
function EnumNumberMember(node) {
enumInitializedMember(this, node);
}
function EnumStringMember(node) {
enumInitializedMember(this, node);
}
function FlowExportDeclaration(node) {
if (node.declaration) {
const declar = node.declaration;
this.print(declar, node);
if (!t().isStatement(declar)) this.semicolon();
if (!t.isStatement(declar)) this.semicolon();
} else {
this.token("{");
@@ -583,6 +688,11 @@ function ObjectTypeProperty(node) {
this.space();
}
if (node.kind === "get" || node.kind === "set") {
this.word(node.kind);
this.space();
}
this._variance(node);
this.print(node.key, node);
@@ -607,6 +717,10 @@ function QualifiedTypeIdentifier(node) {
this.print(node.id, node);
}
function SymbolTypeAnnotation() {
this.word("symbol");
}
function orSeparator() {
this.space();
this.token("|");

View File

@@ -12,17 +12,11 @@ exports._functionHead = _functionHead;
exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
exports.ArrowFunctionExpression = ArrowFunctionExpression;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _params(node) {
this.print(node.typeParameters, node);
@@ -62,6 +56,8 @@ function _methodHead(node) {
}
if (node.async) {
this._catchUp("start", key.loc);
this.word("async");
this.space();
}
@@ -132,8 +128,8 @@ function ArrowFunctionExpression(node) {
const firstParam = node.params[0];
if (node.params.length === 1 && t().isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
if ((this.format.retainLines || node.async) && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
this.token("(");
if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {

View File

@@ -12,19 +12,14 @@ exports.ExportAllDeclaration = ExportAllDeclaration;
exports.ExportNamedDeclaration = ExportNamedDeclaration;
exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
exports.ImportDeclaration = ImportDeclaration;
exports.ImportAttribute = ImportAttribute;
exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function ImportSpecifier(node) {
if (node.importKind === "type" || node.importKind === "typeof") {
@@ -87,7 +82,7 @@ function ExportAllDeclaration(node) {
}
function ExportNamedDeclaration(node) {
if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) {
if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
this.printJoin(node.declaration.decorators, node);
}
@@ -97,7 +92,7 @@ function ExportNamedDeclaration(node) {
}
function ExportDefaultDeclaration(node) {
if (this.format.decoratorsBeforeExport && t().isClassDeclaration(node.declaration)) {
if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
this.printJoin(node.declaration.decorators, node);
}
@@ -112,7 +107,7 @@ function ExportDeclaration(node) {
if (node.declaration) {
const declar = node.declaration;
this.print(declar, node);
if (!t().isStatement(declar)) this.semicolon();
if (!t.isStatement(declar)) this.semicolon();
} else {
if (node.exportKind === "type") {
this.word("type");
@@ -122,10 +117,10 @@ function ExportDeclaration(node) {
const specifiers = node.specifiers.slice(0);
let hasSpecial = false;
while (true) {
for (;;) {
const first = specifiers[0];
if (t().isExportDefaultSpecifier(first) || t().isExportNamespaceSpecifier(first)) {
if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
hasSpecial = true;
this.print(specifiers.shift(), node);
@@ -162,6 +157,8 @@ function ExportDeclaration(node) {
}
function ImportDeclaration(node) {
var _node$attributes;
this.word("import");
this.space();
@@ -172,11 +169,11 @@ function ImportDeclaration(node) {
const specifiers = node.specifiers.slice(0);
if (specifiers && specifiers.length) {
while (true) {
if (specifiers == null ? void 0 : specifiers.length) {
for (;;) {
const first = specifiers[0];
if (t().isImportDefaultSpecifier(first) || t().isImportNamespaceSpecifier(first)) {
if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
this.print(specifiers.shift(), node);
if (specifiers.length) {
@@ -202,9 +199,24 @@ function ImportDeclaration(node) {
}
this.print(node.source, node);
if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) {
this.space();
this.word("with");
this.space();
this.printList(node.attributes, node);
}
this.semicolon();
}
function ImportAttribute(node) {
this.print(node.key);
this.token(":");
this.space();
this.print(node.value);
}
function ImportNamespaceSpecifier(node) {
this.token("*");
this.space();

View File

@@ -18,17 +18,11 @@ exports.VariableDeclaration = VariableDeclaration;
exports.VariableDeclarator = VariableDeclarator;
exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function WithStatement(node) {
this.word("with");
@@ -46,7 +40,7 @@ function IfStatement(node) {
this.print(node.test, node);
this.token(")");
this.space();
const needsBlock = node.alternate && t().isIfStatement(getLastStatement(node.consequent));
const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
if (needsBlock) {
this.token("{");
@@ -71,7 +65,7 @@ function IfStatement(node) {
}
function getLastStatement(statement) {
if (!t().isStatement(statement.body)) return statement;
if (!t.isStatement(statement.body)) return statement;
return getLastStatement(statement.body);
}
@@ -208,6 +202,7 @@ function CatchClause(node) {
if (node.param) {
this.token("(");
this.print(node.param, node);
this.print(node.param.typeAnnotation, node);
this.token(")");
this.space();
}
@@ -280,7 +275,7 @@ function VariableDeclaration(node, parent) {
this.space();
let hasInits = false;
if (!t().isFor(parent)) {
if (!t.isFor(parent)) {
for (const declar of node.declarations) {
if (declar.init) {
hasInits = true;
@@ -298,7 +293,7 @@ function VariableDeclaration(node, parent) {
separator
});
if (t().isFor(parent)) {
if (t.isFor(parent)) {
if (parent.left === node || parent.init === node) return;
}

View File

@@ -10,39 +10,28 @@ exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
exports.ObjectMethod = ObjectMethod;
exports.ObjectProperty = ObjectProperty;
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
exports.RecordExpression = RecordExpression;
exports.TupleExpression = TupleExpression;
exports.RegExpLiteral = RegExpLiteral;
exports.BooleanLiteral = BooleanLiteral;
exports.NullLiteral = NullLiteral;
exports.NumericLiteral = NumericLiteral;
exports.StringLiteral = StringLiteral;
exports.BigIntLiteral = BigIntLiteral;
exports.DecimalLiteral = DecimalLiteral;
exports.PipelineTopicExpression = PipelineTopicExpression;
exports.PipelineBareFunction = PipelineBareFunction;
exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
function _jsesc() {
const data = _interopRequireDefault(require("jsesc"));
_jsesc = function () {
return data;
};
return data;
}
var _jsesc = _interopRequireDefault(require("jsesc"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function Identifier(node) {
this.exactSource(node.loc, () => {
@@ -93,14 +82,14 @@ function ObjectProperty(node) {
this.print(node.key, node);
this.token("]");
} else {
if (t().isAssignmentPattern(node.value) && t().isIdentifier(node.key) && node.key.name === node.value.left.name) {
if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {
this.print(node.value, node);
return;
}
this.print(node.key, node);
if (node.shorthand && t().isIdentifier(node.key) && t().isIdentifier(node.value) && node.key.name === node.value.name) {
if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) {
return;
}
}
@@ -131,6 +120,68 @@ function ArrayExpression(node) {
this.token("]");
}
function RecordExpression(node) {
const props = node.properties;
let startToken;
let endToken;
if (this.format.recordAndTupleSyntaxType === "bar") {
startToken = "{|";
endToken = "|}";
} else if (this.format.recordAndTupleSyntaxType === "hash") {
startToken = "#{";
endToken = "}";
} else {
throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`);
}
this.token(startToken);
this.printInnerComments(node);
if (props.length) {
this.space();
this.printList(props, node, {
indent: true,
statement: true
});
this.space();
}
this.token(endToken);
}
function TupleExpression(node) {
const elems = node.elements;
const len = elems.length;
let startToken;
let endToken;
if (this.format.recordAndTupleSyntaxType === "bar") {
startToken = "[|";
endToken = "|]";
} else if (this.format.recordAndTupleSyntaxType === "hash") {
startToken = "#[";
endToken = "]";
} else {
throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`);
}
this.token(startToken);
this.printInnerComments(node);
for (let i = 0; i < elems.length; i++) {
const elem = elems[i];
if (elem) {
if (i > 0) this.space();
this.print(elem, node);
if (i < len - 1) this.token(",");
}
}
this.token(endToken);
}
function RegExpLiteral(node) {
this.word(`/${node.pattern}/${node.flags}`);
}
@@ -145,9 +196,12 @@ function NullLiteral() {
function NumericLiteral(node) {
const raw = this.getPossibleRaw(node);
const opts = this.format.jsescOption;
const value = node.value + "";
if (raw == null) {
if (opts.numbers) {
this.number((0, _jsesc.default)(node.value, opts));
} else if (raw == null) {
this.number(value);
} else if (this.format.minified) {
this.number(raw.length < value.length ? raw : value);
@@ -170,7 +224,7 @@ function StringLiteral(node) {
opts.json = true;
}
const val = (0, _jsesc().default)(node.value, opts);
const val = (0, _jsesc.default)(node.value, opts);
return this.token(val);
}
@@ -182,7 +236,18 @@ function BigIntLiteral(node) {
return;
}
this.token(node.value);
this.token(node.value + "n");
}
function DecimalLiteral(node) {
const raw = this.getPossibleRaw(node);
if (!this.format.minified && raw != null) {
this.token(raw);
return;
}
this.token(node.value + "m");
}
function PipelineTopicExpression(node) {

View File

@@ -17,6 +17,7 @@ exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName;
exports.TSMethodSignature = TSMethodSignature;
exports.TSIndexSignature = TSIndexSignature;
exports.TSAnyKeyword = TSAnyKeyword;
exports.TSBigIntKeyword = TSBigIntKeyword;
exports.TSUnknownKeyword = TSUnknownKeyword;
exports.TSNumberKeyword = TSNumberKeyword;
exports.TSObjectKeyword = TSObjectKeyword;
@@ -41,6 +42,7 @@ exports.TSArrayType = TSArrayType;
exports.TSTupleType = TSTupleType;
exports.TSOptionalType = TSOptionalType;
exports.TSRestType = TSRestType;
exports.TSNamedTupleMember = TSNamedTupleMember;
exports.TSUnionType = TSUnionType;
exports.TSIntersectionType = TSIntersectionType;
exports.tsPrintUnionOrIntersectionType = tsPrintUnionOrIntersectionType;
@@ -68,6 +70,7 @@ exports.TSNonNullExpression = TSNonNullExpression;
exports.TSExportAssignment = TSExportAssignment;
exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase;
exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers;
function TSTypeAnnotation(node) {
this.token(":");
@@ -139,12 +142,14 @@ function TSQualifiedName(node) {
function TSCallSignatureDeclaration(node) {
this.tsPrintSignatureDeclarationBase(node);
this.token(";");
}
function TSConstructSignatureDeclaration(node) {
this.word("new");
this.space();
this.tsPrintSignatureDeclarationBase(node);
this.token(";");
}
function TSPropertySignature(node) {
@@ -216,6 +221,10 @@ function TSAnyKeyword() {
this.word("any");
}
function TSBigIntKeyword() {
this.word("bigint");
}
function TSUnknownKeyword() {
this.word("unknown");
}
@@ -293,11 +302,19 @@ function TSTypeReference(node) {
}
function TSTypePredicate(node) {
if (node.asserts) {
this.word("asserts");
this.space();
}
this.print(node.parameterName);
this.space();
this.word("is");
this.space();
this.print(node.typeAnnotation.typeAnnotation);
if (node.typeAnnotation) {
this.space();
this.word("is");
this.space();
this.print(node.typeAnnotation.typeAnnotation);
}
}
function TSTypeQuery(node) {
@@ -354,6 +371,14 @@ function TSRestType(node) {
this.print(node.typeAnnotation, node);
}
function TSNamedTupleMember(node) {
this.print(node.label, node);
if (node.optional) this.token("?");
this.token(":");
this.space();
this.print(node.elementType, node);
}
function TSUnionType(node) {
this.tsPrintUnionOrIntersectionType(node, "|");
}
@@ -712,4 +737,31 @@ function tsPrintSignatureDeclarationBase(node) {
this.token(")");
this.print(node.typeAnnotation, node);
}
function tsPrintClassMemberModifiers(node, isField) {
if (isField && node.declare) {
this.word("declare");
this.space();
}
if (node.accessibility) {
this.word(node.accessibility);
this.space();
}
if (node.static) {
this.word("static");
this.space();
}
if (node.abstract) {
this.word("abstract");
this.space();
}
if (isField && node.readonly) {
this.word("readonly");
this.space();
}
}

View File

@@ -47,7 +47,8 @@ function normalizeOptions(code, opts) {
jsescOption: Object.assign({
quotes: "double",
wrap: true
}, opts.jsescOption)
}, opts.jsescOption),
recordAndTupleSyntaxType: opts.recordAndTupleSyntaxType
};
if (format.minified) {

View File

@@ -12,17 +12,11 @@ var whitespace = _interopRequireWildcard(require("./whitespace"));
var parens = _interopRequireWildcard(require("./parentheses"));
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function expandAliases(obj) {
const newObj = {};
@@ -36,7 +30,7 @@ function expandAliases(obj) {
}
for (const type of Object.keys(obj)) {
const aliases = t().FLIPPED_ALIAS_KEYS[type];
const aliases = t.FLIPPED_ALIAS_KEYS[type];
if (aliases) {
for (const alias of aliases) {
@@ -60,21 +54,17 @@ function find(obj, node, parent, printStack) {
}
function isOrHasCallExpression(node) {
if (t().isCallExpression(node)) {
if (t.isCallExpression(node)) {
return true;
}
if (t().isMemberExpression(node)) {
return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property);
} else {
return false;
}
return t.isMemberExpression(node) && isOrHasCallExpression(node.object);
}
function needsWhitespace(node, parent, type) {
if (!node) return 0;
if (t().isExpressionStatement(node)) {
if (t.isExpressionStatement(node)) {
node = node.expression;
}
@@ -109,7 +99,7 @@ function needsWhitespaceAfter(node, parent) {
function needsParens(node, parent, printStack) {
if (!parent) return false;
if (t().isNewExpression(parent) && parent.callee === node) {
if (t.isNewExpression(parent) && parent.callee === node) {
if (isOrHasCallExpression(node)) return true;
}

View File

@@ -13,6 +13,7 @@ exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnno
exports.TSAsExpression = TSAsExpression;
exports.TSTypeAssertion = TSTypeAssertion;
exports.TSIntersectionType = exports.TSUnionType = TSUnionType;
exports.TSInferType = TSInferType;
exports.BinaryExpression = BinaryExpression;
exports.SequenceExpression = SequenceExpression;
exports.AwaitExpression = exports.YieldExpression = YieldExpression;
@@ -21,24 +22,19 @@ exports.UnaryLike = UnaryLike;
exports.FunctionExpression = FunctionExpression;
exports.ArrowFunctionExpression = ArrowFunctionExpression;
exports.ConditionalExpression = ConditionalExpression;
exports.OptionalMemberExpression = OptionalMemberExpression;
exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
exports.AssignmentExpression = AssignmentExpression;
exports.NewExpression = NewExpression;
exports.LogicalExpression = LogicalExpression;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
const PRECEDENCE = {
"||": 0,
"??": 0,
"&&": 1,
"|": 2,
"^": 3,
@@ -64,24 +60,20 @@ const PRECEDENCE = {
"**": 10
};
const isClassExtendsClause = (node, parent) => (t().isClassDeclaration(parent) || t().isClassExpression(parent)) && parent.superClass === node;
const isClassExtendsClause = (node, parent) => (t.isClassDeclaration(parent) || t.isClassExpression(parent)) && parent.superClass === node;
const hasPostfixPart = (node, parent) => (t.isMemberExpression(parent) || t.isOptionalMemberExpression(parent)) && parent.object === node || (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isTaggedTemplateExpression(parent) && parent.tag === node || t.isTSNonNullExpression(parent);
function NullableTypeAnnotation(node, parent) {
return t().isArrayTypeAnnotation(parent);
return t.isArrayTypeAnnotation(parent);
}
function FunctionTypeAnnotation(node, parent) {
return t().isUnionTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isArrayTypeAnnotation(parent);
function FunctionTypeAnnotation(node, parent, printStack) {
return t.isUnionTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isArrayTypeAnnotation(parent) || t.isTypeAnnotation(parent) && t.isArrowFunctionExpression(printStack[printStack.length - 3]);
}
function UpdateExpression(node, parent) {
return t().isMemberExpression(parent, {
object: node
}) || t().isCallExpression(parent, {
callee: node
}) || t().isNewExpression(parent, {
callee: node
}) || isClassExtendsClause(node, parent);
return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent);
}
function ObjectExpression(node, parent, printStack) {
@@ -95,7 +87,7 @@ function DoExpression(node, parent, printStack) {
}
function Binary(node, parent) {
if (node.operator === "**" && t().isBinaryExpression(parent, {
if (node.operator === "**" && t.isBinaryExpression(parent, {
operator: "**"
})) {
return parent.left === node;
@@ -105,26 +97,24 @@ function Binary(node, parent) {
return true;
}
if ((t().isCallExpression(parent) || t().isNewExpression(parent)) && parent.callee === node || t().isUnaryLike(parent) || t().isMemberExpression(parent) && parent.object === node || t().isAwaitExpression(parent)) {
if (hasPostfixPart(node, parent) || t.isUnaryLike(parent) || t.isAwaitExpression(parent)) {
return true;
}
if (t().isBinary(parent)) {
if (t.isBinary(parent)) {
const parentOp = parent.operator;
const parentPos = PRECEDENCE[parentOp];
const nodeOp = node.operator;
const nodePos = PRECEDENCE[nodeOp];
if (parentPos === nodePos && parent.right === node && !t().isLogicalExpression(parent) || parentPos > nodePos) {
if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) {
return true;
}
}
return false;
}
function UnionTypeAnnotation(node, parent) {
return t().isArrayTypeAnnotation(parent) || t().isNullableTypeAnnotation(parent) || t().isIntersectionTypeAnnotation(parent) || t().isUnionTypeAnnotation(parent);
return t.isArrayTypeAnnotation(parent) || t.isNullableTypeAnnotation(parent) || t.isIntersectionTypeAnnotation(parent) || t.isUnionTypeAnnotation(parent);
}
function TSAsExpression() {
@@ -136,15 +126,19 @@ function TSTypeAssertion() {
}
function TSUnionType(node, parent) {
return t().isTSArrayType(parent) || t().isTSOptionalType(parent) || t().isTSIntersectionType(parent) || t().isTSUnionType(parent) || t().isTSRestType(parent);
return t.isTSArrayType(parent) || t.isTSOptionalType(parent) || t.isTSIntersectionType(parent) || t.isTSUnionType(parent) || t.isTSRestType(parent);
}
function TSInferType(node, parent) {
return t.isTSArrayType(parent) || t.isTSOptionalType(parent);
}
function BinaryExpression(node, parent) {
return node.operator === "in" && (t().isVariableDeclarator(parent) || t().isFor(parent));
return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent));
}
function SequenceExpression(node, parent) {
if (t().isForStatement(parent) || t().isThrowStatement(parent) || t().isReturnStatement(parent) || t().isIfStatement(parent) && parent.test === node || t().isWhileStatement(parent) && parent.test === node || t().isForInStatement(parent) && parent.right === node || t().isSwitchStatement(parent) && parent.discriminant === node || t().isExpressionStatement(parent) && parent.expression === node) {
if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) {
return false;
}
@@ -152,7 +146,7 @@ function SequenceExpression(node, parent) {
}
function YieldExpression(node, parent) {
return t().isBinary(parent) || t().isUnaryLike(parent) || t().isCallExpression(parent) || t().isMemberExpression(parent) || t().isNewExpression(parent) || t().isAwaitExpression(parent) && t().isYieldExpression(node) || t().isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
return t.isBinary(parent) || t.isUnaryLike(parent) || hasPostfixPart(node, parent) || t.isAwaitExpression(parent) && t.isYieldExpression(node) || t.isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
}
function ClassExpression(node, parent, printStack) {
@@ -162,13 +156,7 @@ function ClassExpression(node, parent, printStack) {
}
function UnaryLike(node, parent) {
return t().isMemberExpression(parent, {
object: node
}) || t().isCallExpression(parent, {
callee: node
}) || t().isNewExpression(parent, {
callee: node
}) || t().isBinaryExpression(parent, {
return hasPostfixPart(node, parent) || t.isBinaryExpression(parent, {
operator: "**",
left: node
}) || isClassExtendsClause(node, parent);
@@ -181,13 +169,13 @@ function FunctionExpression(node, parent, printStack) {
}
function ArrowFunctionExpression(node, parent) {
return t().isExportDeclaration(parent) || ConditionalExpression(node, parent);
return t.isExportDeclaration(parent) || ConditionalExpression(node, parent);
}
function ConditionalExpression(node, parent) {
if (t().isUnaryLike(parent) || t().isBinary(parent) || t().isConditionalExpression(parent, {
if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, {
test: node
}) || t().isAwaitExpression(parent) || t().isOptionalMemberExpression(parent) || t().isTaggedTemplateExpression(parent) || t().isTSTypeAssertion(parent) || t().isTSAsExpression(parent)) {
}) || t.isAwaitExpression(parent) || t.isTSTypeAssertion(parent) || t.isTSAsExpression(parent)) {
return true;
}
@@ -195,19 +183,35 @@ function ConditionalExpression(node, parent) {
}
function OptionalMemberExpression(node, parent) {
return t().isCallExpression(parent) || t().isMemberExpression(parent);
return t.isCallExpression(parent, {
callee: node
}) || t.isMemberExpression(parent, {
object: node
});
}
function AssignmentExpression(node) {
if (t().isObjectPattern(node.left)) {
function AssignmentExpression(node, parent, printStack) {
if (t.isObjectPattern(node.left)) {
return true;
} else {
return ConditionalExpression(...arguments);
return ConditionalExpression(node, parent, printStack);
}
}
function NewExpression(node, parent) {
return isClassExtendsClause(node, parent);
function LogicalExpression(node, parent) {
switch (node.operator) {
case "||":
if (!t.isLogicalExpression(parent)) return false;
return parent.operator === "??" || parent.operator === "&&";
case "&&":
return t.isLogicalExpression(parent, {
operator: "??"
});
case "??":
return t.isLogicalExpression(parent) && parent.operator !== "??";
}
}
function isFirstInStatement(printStack, {
@@ -220,25 +224,21 @@ function isFirstInStatement(printStack, {
let parent = printStack[i];
while (i > 0) {
if (t().isExpressionStatement(parent, {
if (t.isExpressionStatement(parent, {
expression: node
}) || t().isTaggedTemplateExpression(parent) || considerDefaultExports && t().isExportDefaultDeclaration(parent, {
}) || considerDefaultExports && t.isExportDefaultDeclaration(parent, {
declaration: node
}) || considerArrow && t().isArrowFunctionExpression(parent, {
}) || considerArrow && t.isArrowFunctionExpression(parent, {
body: node
})) {
return true;
}
if (t().isCallExpression(parent, {
callee: node
}) || t().isSequenceExpression(parent) && parent.expressions[0] === node || t().isMemberExpression(parent, {
object: node
}) || t().isConditional(parent, {
if (hasPostfixPart(node, parent) && !t.isNewExpression(parent) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isConditional(parent, {
test: node
}) || t().isBinary(parent, {
}) || t.isBinary(parent, {
left: node
}) || t().isAssignmentExpression(parent, {
}) || t.isAssignmentExpression(parent, {
left: node
})) {
node = parent;

View File

@@ -5,31 +5,25 @@ Object.defineProperty(exports, "__esModule", {
});
exports.list = exports.nodes = void 0;
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
var t = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function crawl(node, state = {}) {
if (t().isMemberExpression(node)) {
if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
crawl(node.object, state);
if (node.computed) crawl(node.property, state);
} else if (t().isBinary(node) || t().isAssignmentExpression(node)) {
} else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
crawl(node.left, state);
crawl(node.right, state);
} else if (t().isCallExpression(node)) {
} else if (t.isCallExpression(node) || t.isOptionalCallExpression(node)) {
state.hasCall = true;
crawl(node.callee, state);
} else if (t().isFunction(node)) {
} else if (t.isFunction(node)) {
state.hasFunction = true;
} else if (t().isIdentifier(node)) {
} else if (t.isIdentifier(node)) {
state.hasHelper = state.hasHelper || isHelper(node.callee);
}
@@ -37,21 +31,21 @@ function crawl(node, state = {}) {
}
function isHelper(node) {
if (t().isMemberExpression(node)) {
if (t.isMemberExpression(node)) {
return isHelper(node.object) || isHelper(node.property);
} else if (t().isIdentifier(node)) {
} else if (t.isIdentifier(node)) {
return node.name === "require" || node.name[0] === "_";
} else if (t().isCallExpression(node)) {
} else if (t.isCallExpression(node)) {
return isHelper(node.callee);
} else if (t().isBinary(node) || t().isAssignmentExpression(node)) {
return t().isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
} else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
} else {
return false;
}
}
function isType(node) {
return t().isLiteral(node) || t().isObjectExpression(node) || t().isArrayExpression(node) || t().isIdentifier(node) || t().isMemberExpression(node);
return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);
}
const nodes = {
@@ -74,7 +68,7 @@ const nodes = {
},
LogicalExpression(node) {
if (t().isFunction(node.left) || t().isFunction(node.right)) {
if (t.isFunction(node.left) || t.isFunction(node.right)) {
return {
after: true
};
@@ -90,7 +84,16 @@ const nodes = {
},
CallExpression(node) {
if (t().isFunction(node.callee) || isHelper(node)) {
if (t.isFunction(node.callee) || isHelper(node)) {
return {
before: true,
after: true
};
}
},
OptionalCallExpression(node) {
if (t.isFunction(node.callee)) {
return {
before: true,
after: true
@@ -118,7 +121,7 @@ const nodes = {
},
IfStatement(node) {
if (t().isBlockStatement(node.consequent)) {
if (t.isBlockStatement(node.consequent)) {
return {
before: true,
after: true
@@ -138,7 +141,9 @@ nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function
};
nodes.ObjectTypeCallProperty = function (node, parent) {
if (parent.callProperties[0] === node && (!parent.properties || !parent.properties.length)) {
var _parent$properties;
if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) == null ? void 0 : _parent$properties.length)) {
return {
before: true
};
@@ -146,7 +151,9 @@ nodes.ObjectTypeCallProperty = function (node, parent) {
};
nodes.ObjectTypeIndexer = function (node, parent) {
if (parent.indexers[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length)) {
var _parent$properties2, _parent$callPropertie;
if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) == null ? void 0 : _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) == null ? void 0 : _parent$callPropertie.length)) {
return {
before: true
};
@@ -154,7 +161,9 @@ nodes.ObjectTypeIndexer = function (node, parent) {
};
nodes.ObjectTypeInternalSlot = function (node, parent) {
if (parent.internalSlots[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length) && (!parent.indexers || !parent.indexers.length)) {
var _parent$properties3, _parent$callPropertie2, _parent$indexers;
if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) == null ? void 0 : _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) == null ? void 0 : _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) == null ? void 0 : _parent$indexers.length)) {
return {
before: true
};
@@ -184,7 +193,7 @@ exports.list = list;
};
}
[type].concat(t().FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
[type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
nodes[type] = function () {
return amounts;
};

View File

@@ -5,49 +5,24 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;
function _isInteger() {
const data = _interopRequireDefault(require("lodash/isInteger"));
_isInteger = function () {
return data;
};
return data;
}
function _repeat() {
const data = _interopRequireDefault(require("lodash/repeat"));
_repeat = function () {
return data;
};
return data;
}
var _buffer = _interopRequireDefault(require("./buffer"));
var n = _interopRequireWildcard(require("./node"));
function t() {
const data = _interopRequireWildcard(require("@babel/types"));
t = function () {
return data;
};
return data;
}
var t = _interopRequireWildcard(require("@babel/types"));
var generatorFunctions = _interopRequireWildcard(require("./generators"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const SCIENTIFIC_NOTATION = /e/i;
const ZERO_DECIMAL_INTEGER = /\.0+$/;
const NON_DECIMAL_LITERAL = /^0[box]/;
const PURE_ANNOTATION_RE = /^\s*[@#]__PURE__\s*$/;
class Printer {
constructor(format, map) {
@@ -120,7 +95,7 @@ class Printer {
number(str) {
this.word(str);
this._endsWithInteger = (0, _isInteger().default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
this._endsWithInteger = Number.isInteger(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
}
token(str) {
@@ -205,19 +180,32 @@ class Printer {
_maybeAddParen(str) {
const parenPushNewlineState = this._parenPushNewlineState;
if (!parenPushNewlineState) return;
this._parenPushNewlineState = null;
let i;
for (i = 0; i < str.length && str[i] === " "; i++) continue;
if (i === str.length) return;
if (i === str.length) {
return;
}
const cha = str[i];
if (cha !== "\n") {
if (cha !== "/") return;
if (i + 1 === str.length) return;
if (cha !== "/" || i + 1 === str.length) {
this._parenPushNewlineState = null;
return;
}
const chaPost = str[i + 1];
if (chaPost !== "/" && chaPost !== "*") return;
if (chaPost === "*") {
if (PURE_ANNOTATION_RE.test(str.slice(i + 2, str.length - 2))) {
return;
}
} else if (chaPost !== "/") {
this._parenPushNewlineState = null;
return;
}
}
this.token("(");
@@ -229,7 +217,7 @@ class Printer {
if (!this.format.retainLines) return;
const pos = loc ? loc[prop] : null;
if (pos && pos.line !== null) {
if ((pos == null ? void 0 : pos.line) != null) {
const count = pos.line - this._buf.getCurrentLine();
for (let i = 0; i < count; i++) {
@@ -239,7 +227,7 @@ class Printer {
}
_getIndent() {
return (0, _repeat().default)(this.format.indent.style, this._indent);
return this.format.indent.style.repeat(this._indent);
}
startTerminatorless(isLabel = false) {
@@ -256,7 +244,7 @@ class Printer {
endTerminatorless(state) {
this._noLineTerminator = false;
if (state && state.printed) {
if (state == null ? void 0 : state.printed) {
this.dedent();
this.newline();
this.token(")");
@@ -274,7 +262,7 @@ class Printer {
const printMethod = this[node.type];
if (!printMethod) {
throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node && node.constructor.name)}`);
throw new ReferenceError(`unknown node of type ${JSON.stringify(node.type)} with constructor ${JSON.stringify(node == null ? void 0 : node.constructor.name)}`);
}
this._printStack.push(node);
@@ -294,7 +282,7 @@ class Printer {
this._printLeadingComments(node);
const loc = t().isProgram(node) || t().isFile(node) ? null : node.loc;
const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
this.withSource("start", loc, () => {
printMethod.call(this, node, parent);
});
@@ -349,7 +337,7 @@ class Printer {
}
printJoin(nodes, parent, opts = {}) {
if (!nodes || !nodes.length) return;
if (!(nodes == null ? void 0 : nodes.length)) return;
if (opts.indent) this.indent();
const newlineOpts = {
addNewlines: opts.addNewlines
@@ -385,7 +373,7 @@ class Printer {
printBlock(parent) {
const node = parent.body;
if (!t().isEmptyStatement(node)) {
if (!t.isEmptyStatement(node)) {
this.space();
}
@@ -397,11 +385,13 @@ class Printer {
}
_printLeadingComments(node) {
this._printComments(this._getComments(true, node));
this._printComments(this._getComments(true, node), true);
}
printInnerComments(node, indent = true) {
if (!node.innerComments || !node.innerComments.length) return;
var _node$innerComments;
if (!((_node$innerComments = node.innerComments) == null ? void 0 : _node$innerComments.length)) return;
if (indent) this.indent();
this._printComments(node.innerComments);
@@ -446,7 +436,7 @@ class Printer {
return node && (leading ? node.leadingComments : node.trailingComments) || [];
}
_printComment(comment) {
_printComment(comment, skipNewLines) {
if (!this.format.shouldPrintComment(comment.value)) return;
if (comment.ignore) return;
if (this._printedComments.has(comment)) return;
@@ -459,12 +449,15 @@ class Printer {
}
const isBlockComment = comment.type === "CommentBlock";
this.newline(this._buf.hasContent() && !this._noLineTerminator && isBlockComment ? 1 : 0);
const printNewLines = isBlockComment && !skipNewLines && !this._noLineTerminator;
if (printNewLines && this._buf.hasContent()) this.newline(1);
if (!this.endsWith("[") && !this.endsWith("{")) this.space();
let val = !isBlockComment && !this._noLineTerminator ? `//${comment.value}\n` : `/*${comment.value}*/`;
if (isBlockComment && this.format.indent.adjustMultilineComment) {
const offset = comment.loc && comment.loc.start.column;
var _comment$loc;
const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column;
if (offset) {
const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
@@ -472,21 +465,25 @@ class Printer {
}
const indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
val = val.replace(/\n(?!$)/g, `\n${(0, _repeat().default)(" ", indentSize)}`);
val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`);
}
if (this.endsWith("/")) this._space();
this.withSource("start", comment.loc, () => {
this._append(val);
});
this.newline(isBlockComment && !this._noLineTerminator ? 1 : 0);
if (printNewLines) this.newline(1);
}
_printComments(comments) {
if (!comments || !comments.length) return;
_printComments(comments, inlinePureAnnotation) {
if (!(comments == null ? void 0 : comments.length)) return;
for (const comment of comments) {
this._printComment(comment);
if (inlinePureAnnotation && comments.length === 1 && PURE_ANNOTATION_RE.test(comments[0].value)) {
this._printComment(comments[0], this._buf.hasContent() && !this.endsWith("\n"));
} else {
for (const comment of comments) {
this._printComment(comment);
}
}
}

View File

@@ -5,15 +5,7 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = void 0;
function _sourceMap() {
const data = _interopRequireDefault(require("source-map"));
_sourceMap = function () {
return data;
};
return data;
}
var _sourceMap = _interopRequireDefault(require("source-map"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -27,20 +19,20 @@ class SourceMap {
get() {
if (!this._cachedMap) {
const map = this._cachedMap = new (_sourceMap().default.SourceMapGenerator)({
const map = this._cachedMap = new _sourceMap.default.SourceMapGenerator({
sourceRoot: this._opts.sourceRoot
});
const code = this._code;
if (typeof code === "string") {
map.setSourceContent(this._opts.sourceFileName, code);
map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code);
} else if (typeof code === "object") {
Object.keys(code).forEach(sourceFileName => {
map.setSourceContent(sourceFileName, code[sourceFileName]);
map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
});
}
this._rawMappings.forEach(map.addMapping, map);
this._rawMappings.forEach(mapping => map.addMapping(mapping), map);
}
return this._cachedMap.toJSON();
@@ -68,7 +60,7 @@ class SourceMap {
line: generatedLine,
column: generatedColumn
},
source: line == null ? undefined : filename || this._opts.sourceFileName,
source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"),
original: line == null ? undefined : {
line: line,
column: column

View File

@@ -1,33 +1,27 @@
{
"_args": [
[
"source-map@0.5.7",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "source-map@0.5.7",
"_from": "source-map@^0.5.0",
"_id": "source-map@0.5.7",
"_inBundle": false,
"_integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
"_location": "/@babel/generator/source-map",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "source-map@0.5.7",
"raw": "source-map@^0.5.0",
"name": "source-map",
"escapedName": "source-map",
"rawSpec": "0.5.7",
"rawSpec": "^0.5.0",
"saveSpec": null,
"fetchSpec": "0.5.7"
"fetchSpec": "^0.5.0"
},
"_requiredBy": [
"/@babel/generator"
],
"_resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
"_spec": "0.5.7",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_shasum": "8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc",
"_spec": "source-map@^0.5.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@babel/generator",
"author": {
"name": "Nick Fitzgerald",
"email": "nfitzgerald@mozilla.com"
@@ -35,6 +29,7 @@
"bugs": {
"url": "https://github.com/mozilla/source-map/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Tobias Koppers",
@@ -181,6 +176,7 @@
"email": "nicolas.lalevee@hibnet.org"
}
],
"deprecated": false,
"description": "Generates and consumes source maps",
"devDependencies": {
"doctoc": "^0.15.0",

View File

@@ -1,56 +1,53 @@
{
"_args": [
[
"@babel/generator@7.5.5",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "@babel/generator@7.5.5",
"_id": "@babel/generator@7.5.5",
"_from": "@babel/generator@^7.11.6",
"_id": "@babel/generator@7.11.6",
"_inBundle": false,
"_integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==",
"_integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==",
"_location": "/@babel/generator",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "@babel/generator@7.5.5",
"raw": "@babel/generator@^7.11.6",
"name": "@babel/generator",
"escapedName": "@babel%2fgenerator",
"scope": "@babel",
"rawSpec": "7.5.5",
"rawSpec": "^7.11.6",
"saveSpec": null,
"fetchSpec": "7.5.5"
"fetchSpec": "^7.11.6"
},
"_requiredBy": [
"/@babel/core",
"/@babel/traverse",
"/istanbul-lib-instrument"
],
"_resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz",
"_spec": "7.5.5",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz",
"_shasum": "b868900f81b163b4d464ea24545c61cbac4dc620",
"_spec": "@babel/generator@^7.11.6",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@babel/core",
"author": {
"name": "Sebastian McKenzie",
"email": "sebmck@gmail.com"
},
"dependencies": {
"@babel/types": "^7.5.5",
"jsesc": "^2.5.1",
"lodash": "^4.17.13",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"bundleDependencies": false,
"dependencies": {
"@babel/types": "^7.11.5",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
},
"deprecated": false,
"description": "Turns an AST into code.",
"devDependencies": {
"@babel/helper-fixtures": "^7.5.5",
"@babel/parser": "^7.5.5"
"@babel/helper-fixtures": "^7.10.5",
"@babel/parser": "^7.11.5"
},
"files": [
"lib"
],
"gitHead": "0407f034f09381b95e9cabefbf6b176c76485a43",
"gitHead": "e51139d7fd850e7f5b8cd6aafb17cc88b7010218",
"homepage": "https://babeljs.io/",
"license": "MIT",
"main": "lib/index.js",
@@ -60,7 +57,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-generator"
"url": "git+https://github.com/babel/babel.git",
"directory": "packages/babel-generator"
},
"version": "7.5.5"
"version": "7.11.6"
}