@putout/printer
Advanced tools
@@ -23,2 +23,3 @@ 'use strict'; | ||
| isExportNamedDeclaration, | ||
| isExportDefaultSpecifier, | ||
| } = types; | ||
@@ -51,2 +52,6 @@ | ||
| module.exports.ExportDefaultSpecifier = (path, {print}) => { | ||
| print('__exported'); | ||
| }; | ||
| module.exports.ExportNamedDeclaration = { | ||
@@ -93,5 +98,20 @@ beforeIf(path) { | ||
| print.space(); | ||
| print('{'); | ||
| if (specifiers.length) { | ||
| const [first, ...rest] = specifiers; | ||
| if (!specifiers.length) { | ||
| print('{}'); | ||
| } else if (isExportDefaultSpecifier(first) && !rest.length) { | ||
| traverse(first); | ||
| } else { | ||
| if (isExportDefaultSpecifier(first)) { | ||
| traverse(first); | ||
| print(','); | ||
| print.space(); | ||
| } else { | ||
| rest.unshift(first); | ||
| } | ||
| print('{'); | ||
| indent.inc(); | ||
@@ -102,3 +122,3 @@ maybe.print.newline(isNewline); | ||
| for (const [i, spec] of specifiers.entries()) { | ||
| for (const [i, spec] of rest.entries()) { | ||
| const isType = spec.node.exportKind === 'type'; | ||
@@ -121,5 +141,5 @@ const isLast = i < lastIndex; | ||
| indent(); | ||
| print('}'); | ||
| } | ||
| print('}'); | ||
| const source = path.get('source'); | ||
@@ -164,1 +184,2 @@ | ||
| }; | ||
+1
-1
| { | ||
| "name": "@putout/printer", | ||
| "version": "16.5.0", | ||
| "version": "16.6.0", | ||
| "type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is too big to display
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
299510
0.24%6446
0.25%