Skip to content

Commit

Permalink
feature: @putout/bundle: update @putout/printer to 5.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Sep 22, 2023
1 parent f89807b commit b375526
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion bundle/putout-iife.js

Large diffs are not rendered by default.

41 changes: 27 additions & 14 deletions bundle/putout.js
Original file line number Diff line number Diff line change
Expand Up @@ -68587,9 +68587,9 @@ parens$1.maybeParens = (print) => ({

const {exists: exists$e} = is$3;
const {printParams: printParams$c} = params;
const {maybeParens: maybeParens$6} = parens$1;
const {maybeParens: maybeParens$5} = parens$1;

arrowFunctionExpression.ArrowFunctionExpression = maybeParens$6((path, printer, semantics) => {
arrowFunctionExpression.ArrowFunctionExpression = maybeParens$5((path, printer, semantics) => {
const {
print,
maybe,
Expand Down Expand Up @@ -68789,9 +68789,9 @@ var functionExpression = {};

const {exists: exists$d} = is$3;
const {printParams: printParams$8} = params;
const {maybeParens: maybeParens$5} = parens$1;
const {maybeParens: maybeParens$4} = parens$1;

functionExpression.FunctionExpression = maybeParens$5((path, printer, semantics) => {
functionExpression.FunctionExpression = maybeParens$4((path, printer, semantics) => {
const {
print,
maybe,
Expand Down Expand Up @@ -68841,11 +68841,11 @@ var unaryExpressions$1 = {};

const {isLast: isLast$b, isNext: isNext$j} = is$3;

const {maybeParens: maybeParens$4} = parens$1;
const {maybeParens: maybeParens$3} = parens$1;

const isWord = (a) => /^(delete|typeof|void|throw)$/.test(a);

const unaryExpression = maybeParens$4((path, printer) => {
const unaryExpression = maybeParens$3((path, printer) => {
const {maybe, traverse} = printer;
const {prefix, operator} = path.node;
const argPath = path.get('argument');
Expand Down Expand Up @@ -69105,7 +69105,7 @@ _class.ClassDeclaration = {
};

function classVisitor(path, {print, indent, maybe, traverse}) {
const {abstract} = path.node;
const {id, abstract} = path.node;

for (const decorator of maybeDecorators$1(path)) {
traverse(decorator);
Expand All @@ -69127,7 +69127,7 @@ function classVisitor(path, {print, indent, maybe, traverse}) {
}

if (node.superClass) {
maybe.print(path.isStatement(), ' ');
maybe.print(id && !node.implements, ' ');
print('extends ');
print('__superClass');
}
Expand Down Expand Up @@ -69287,10 +69287,11 @@ const {

const {parseComments: parseComments$3} = comment;
const {likeChain} = memberExpressions$1;
const {maybeParens: maybeParens$3} = parens$1;

const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;
const isLogical = (path) => path.get('argument').isLogicalExpression();
const isValue = (path) => path.get('properties.0.value').node;
const isParentExpression = (path) => path.parentPath.isExpressionStatement();

const isMemberExpressionCallee = ({parentPath}) => {
if (!parentPath.isCallExpression())
Expand All @@ -69304,16 +69305,16 @@ const isMemberExpressionCallee = ({parentPath}) => {
return likeChain(callee);
};

objectExpression.ObjectExpression = maybeParens$3((path, {print, maybe, indent, write}, semantics) => {
objectExpression.ObjectExpression = (path, {print, maybe, indent, write}, semantics) => {
const {trailingComma} = semantics;
indent.inc();

const properties = path.get('properties');
const {length} = properties;
const parens = isParens$4(path);
const manyLines = !isOneLine$1(path);

maybe.print(path.isRecordExpression(), '#');

maybe.print(parens, '(');
print('{');
parseComments$3(path, {write}, semantics);
maybe.print.newline(manyLines);
Expand Down Expand Up @@ -69355,9 +69356,10 @@ objectExpression.ObjectExpression = maybeParens$3((path, {print, maybe, indent,
indent.dec();
maybe.indent(manyLines);
print('}');
maybe.print(parens, ')');

maybe.indent.dec(isMemberExpressionCallee(path));
});
};

const hasNextLeadingComment = (path) => {
const next = path.getNextSibling();
Expand Down Expand Up @@ -69407,6 +69409,13 @@ function isOneLine$1(path) {
return !isValue(path);
}

function isParens$4(path) {
if (isBodyOfArrow(path))
return true;

return isParentExpression(path);
}

var objectProperty = {};

var concatanate$1 = {};
Expand Down Expand Up @@ -71043,7 +71052,11 @@ var recordExpression = {};

const {ObjectExpression: ObjectExpression$1} = objectExpression;

recordExpression.RecordExpression = ObjectExpression$1;
recordExpression.RecordExpression = (path, operations, semantics) => {
const {write} = operations;
write('#');
ObjectExpression$1(path, operations, semantics);
};

var tupleExpression = {};

Expand Down
2 changes: 1 addition & 1 deletion bundle/putout.min.js

Large diffs are not rendered by default.

0 comments on commit b375526

Please sign in to comment.