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
600
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.16.0 to 1.16.1

65

lib/tokenize/statements/import-declarations.js

@@ -5,38 +5,43 @@ 'use strict';

module.exports.ImportDeclaration = (path, {print, maybe}) => {
const specifiers = path.get('specifiers');
print('import ');
for (const [index, spec] of specifiers.entries()) {
if (spec.isImportDefaultSpecifier()) {
print(spec.get('local'));
continue;
}
module.exports.ImportDeclaration = {
print(path, {print, maybe}) {
const specifiers = path.get('specifiers');
print('import ');
if (spec.isImportSpecifier()) {
maybe.print(index, ', ');
print('{');
print(spec.get('imported'));
print('}');
let wasSpecifier = false;
const n = specifiers.length - 1;
for (const [index, spec] of specifiers.entries()) {
if (spec.isImportDefaultSpecifier()) {
print(spec.get('local'));
continue;
}
continue;
if (spec.isImportSpecifier()) {
maybe.print(index, ', ');
maybe.print(!wasSpecifier, '{');
wasSpecifier = true;
print(spec.get('imported'));
maybe.print(index === n, '}');
continue;
}
}
}
if (specifiers.length) {
print.space();
print('from');
print.space();
}
print('__source');
print(';');
print.newline();
if (shouldAddNewlineAfter(path)) {
if (specifiers.length) {
print.space();
print('from');
print.space();
}
print('__source');
print(';');
print.newline();
},
afterIf: shouldAddNewlineAfter,
after(path, {print}) {
print.newline();
markAfter(path);
}
},
};
function shouldAddNewlineAfter(path) {

@@ -43,0 +48,0 @@ if (path.getNextSibling().isImportDeclaration())

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