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

@putout/printer

Package Overview
Dependencies
Maintainers
0
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 11.4.0 to 11.5.0

4

lib/tokenize/statements/export-declaration/export-declaration.js
'use strict';
const {isExportNamespaceSpecifier} = require('@putout/babel').types;
const {markAfter, isMarkedAfter} = require('../../mark');
const {

@@ -10,4 +12,2 @@ isNewlineBetweenSiblings,

const {markAfter, isMarkedAfter} = require('../../mark');
const {isExportNamespaceSpecifier} = require('@putout/babel').types;
const isDeclarationNewline = (path) => isMarkedAfter(path.get('declaration'));

@@ -14,0 +14,0 @@ const isInsideNamespace = (path) => path.parentPath.isTSModuleBlock();

'use strict';
const {isNext, isNextParent} = require('../../is');
const {
isNext,
isNextParent,
isLast,
} = require('../../is');
const {markAfter} = require('../../mark');
module.exports.TSEnumDeclaration = {

@@ -28,8 +34,15 @@ beforeIf(path) {

indent.dec();
indent();
print('}');
if (isLast(path))
return;
print.newline();
markAfter(path);
},
afterSatisfy: () => [isNext, isNextParent],
after(path, {print}) {
print.breakline();
print.linebreak();
},
};
'use strict';
const {types} = require('@putout/babel');
const {
isTSTypeAliasDeclaration,
isExportDeclaration,
} = require('@putout/babel').types;
isExportNamedDeclaration,
isTSModuleBlock,
} = types;
const {isNext, isNextParent} = require('../../is');
const {maybeDeclare} = require('../../maybe/maybe-declare');
const {markAfter} = require('../../mark');
const isInsideNamespace = (path) => isTSModuleBlock(path.parentPath.parentPath);
module.exports.TSInterfaceDeclaration = {
print: maybeDeclare((path, {print, maybe}) => {
const {node, parentPath} = path;
const {node} = path;
maybe.indent(!isExportDeclaration(parentPath));
maybe.indent(!isExportNamedDeclaration(path.parentPath));
print('interface ');

@@ -31,9 +35,11 @@ print('__id');

after(path, {print}) {
print.breakline();
print.linebreak();
const exportNamed = isExportNamedDeclaration(path.parentPath);
const next = path.parentPath.getNextSibling();
if (exportNamed && isInsideNamespace(path))
markAfter(path);
if (!isTSTypeAliasDeclaration(next) && !isExportDeclaration(next))
print.breakline();
if (!exportNamed && !isTSTypeAliasDeclaration(path))
print.newline();
},
};
{
"name": "@putout/printer",
"version": "11.4.0",
"version": "11.5.0",
"type": "commonjs",

@@ -73,3 +73,3 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

"nodemon": "^3.0.1",
"putout": "^36.0.0",
"putout": "^37.0.1",
"redlint": "^3.16.0",

@@ -76,0 +76,0 @@ "samadhi": "^2.8.0",

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