@putout/printer
Advanced tools
Comparing version 9.13.0 to 9.14.0
@@ -16,3 +16,4 @@ 'use strict'; | ||
const {likeChain} = require('../member-expression/member-expressions'); | ||
const {isStringLiteral} = require('@putout/babel').types; | ||
const {types} = require('@putout/babel'); | ||
const {isStringLiteral} = types; | ||
@@ -19,0 +20,0 @@ const isBodyOfArrow = (path) => path.parentPath.node.body === path.node; |
'use strict'; | ||
const {maybeParens} = require('../../expressions/function/parens'); | ||
const {isObjectExpression} = require('@putout/babel').types; | ||
const { | ||
isVariableDeclarator, | ||
isObjectExpression, | ||
} = require('@putout/babel').types; | ||
module.exports.TSAsExpression = maybeParens((path, {print, maybe}) => { | ||
const {expression} = path.node; | ||
const is = isObjectExpression(expression); | ||
const is = isParens(path); | ||
@@ -17,1 +19,10 @@ maybe.print(is, '('); | ||
}); | ||
function isParens(path) { | ||
const {expression} = path.node; | ||
if (isVariableDeclarator(path.parentPath)) | ||
return false; | ||
return isObjectExpression(expression); | ||
} |
{ | ||
"name": "@putout/printer", | ||
"version": "9.13.0", | ||
"version": "9.14.0", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
231395
5095
17
24
7
111