Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@putout/printer

Package Overview
Dependencies
Maintainers
1
Versions
604
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/printer - npm Package Compare versions

Comparing version 1.70.1 to 1.70.2

76

lib/tokenize/statements/export-declarations.js
'use strict';
const {isNewlineBetweenStatements} = require('../is');
const {
markAfter,
isMarkedAfter,
} = require('../mark');
const isDeclarationNewline = (path) => isMarkedAfter(path.get('declaration'));
module.exports.ExportSpecifier = (path, {print}) => {

@@ -22,35 +30,47 @@ const {

module.exports.ExportNamedDeclaration = (path, {print, traverse, write, indent}) => {
const {exportKind} = path.node;
const specifiers = path.get('specifiers');
write('export ');
if (exportKind === 'type' && specifiers.length) {
print('type');
print(specifiers[0]);
print(' from ');
print('__source');
print(';');
module.exports.ExportNamedDeclaration = {
print(path, {print, traverse, write, indent}) {
const {exportKind} = path.node;
const specifiers = path.get('specifiers');
return;
}
if (specifiers.length) {
write('{');
indent.inc();
write.newline();
write('export ');
for (const spec of specifiers) {
indent();
traverse(spec);
write(',');
if (exportKind === 'type' && specifiers.length) {
print('type');
print(specifiers[0]);
print(' from ');
print('__source');
print(';');
return;
}
if (specifiers.length) {
write('{');
indent.inc();
write.newline();
for (const spec of specifiers) {
indent();
traverse(spec);
write(',');
write.newline();
}
indent.dec();
write('}');
}
indent.dec();
write('}');
}
print('__declaration');
print('__declaration');
},
afterIf(path) {
if (isDeclarationNewline(path))
return false;
return isNewlineBetweenStatements(path);
},
after(path, {print}) {
print.newline();
markAfter(path);
},
};

@@ -9,6 +9,3 @@ 'use strict';

const {
hasPrevNewline,
markAfter,
} = require('../mark');
const {hasPrevNewline} = require('../mark');

@@ -56,3 +53,3 @@ const {isExportDeclaration} = require('@babel/types');

maybe.print.newline(!wasNewline);
markAfter(path);
maybe.markAfter(wasNewline, path);
},

@@ -59,0 +56,0 @@ };

{
"name": "@putout/printer",
"version": "1.70.1",
"version": "1.70.2",
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc