@putout/printer
Advanced tools
Comparing version 1.19.0 to 1.20.0
@@ -237,4 +237,5 @@ 'use strict'; | ||
const computePath = (path, maybeLine) => { | ||
if (isString(maybeLine) && maybeLine.startsWith(GET)) | ||
if (isString(maybeLine) && maybeLine.startsWith(GET)) { | ||
return get(path, maybeLine); | ||
} | ||
@@ -246,1 +247,2 @@ if (isObject(maybeLine)) | ||
}; | ||
@@ -38,3 +38,3 @@ 'use strict'; | ||
TSTypeAnnotation(path, {print}) { | ||
if (!path.parentPath.isTSFunctionType()) { | ||
if (path.parentPath.isIdentifier()) { | ||
print(':'); | ||
@@ -59,2 +59,25 @@ print.space(); | ||
}, | ||
TSTypeLiteral(path, {indent, traverse, write}) { | ||
write('{'); | ||
write.newline(); | ||
indent.inc(); | ||
for (const member of path.get('members')) { | ||
indent(); | ||
traverse(member); | ||
write(';'); | ||
} | ||
write.newline(); | ||
indent.dec(); | ||
write('}'); | ||
}, | ||
TSPropertySignature(path, {print, maybe}) { | ||
const {optional} = path.node; | ||
print('__key'); | ||
maybe.print(optional, '?'); | ||
print(':'); | ||
print.space(); | ||
print('__typeAnnotation'); | ||
}, | ||
}; | ||
{ | ||
"name": "@putout/printer", | ||
"version": "1.19.0", | ||
"version": "1.20.0", | ||
"type": "commonjs", | ||
@@ -59,3 +59,3 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
"putout": "*", | ||
"putout-plugin-apply-computed-print": "./rules/putout-plugin-apply-computed-print", | ||
"putout-plugin-printer": "./rules", | ||
"supertape": "^8.0.0", | ||
@@ -62,0 +62,0 @@ "try-catch": "^3.0.0" |
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
65073
1816
53