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.6.0 to 11.7.0

lib/tokenize/statements/labeled-statement/labeled-satement.js

23

lib/tokenize/expressions/function/function-declaration.js
'use strict';
const {
isTSModuleBlock,
isBlockStatement,
isExportNamedDeclaration,
} = require('@putout/babel').types;
const {markAfter} = require('../../mark');

@@ -7,9 +13,7 @@ const {isNext, isNextParent} = require('../../is');

const isInsideNamedExport = ({parentPath}) => isExportNamedDeclaration(parentPath);
module.exports.FunctionDeclaration = {
print(path, printer, semantics) {
const {
print,
maybe,
indent,
} = printer;
const {print, maybe} = printer;

@@ -22,3 +26,3 @@ const {

indent();
maybe.indent(!isInsideNamedExport(path));
maybe.print(async, 'async ');

@@ -54,3 +58,8 @@

function isInsideBlockStatement(path) {
if (!path.parentPath.isBlockStatement())
const {parentPath} = path;
if (isTSModuleBlock(parentPath.parentPath))
return true;
if (!isBlockStatement(parentPath))
return false;

@@ -57,0 +66,0 @@

@@ -29,2 +29,1 @@ 'use strict';

});
'use strict';
const {isLabeledStatement} = require('@putout/babel').types;
const {

@@ -38,5 +39,7 @@ isNext,

const isInsideLabel = ({parentPath}) => isLabeledStatement(parentPath);
module.exports.ExpressionStatement = {
print(path, {indent, print, maybe, store}) {
indent();
print(path, {print, maybe, store}) {
maybe.indent(!isInsideLabel(path));

@@ -43,0 +46,0 @@ print('__expression');

@@ -24,2 +24,3 @@ 'use strict';

const {ContinueStatement} = require('./continue-statement');
const {LabeledStatement} = require('./labeled-statement/labeled-satement');

@@ -48,8 +49,3 @@ const {

DebuggerStatement,
LabeledStatement(path, {print}) {
print('__label');
print(':');
print.space();
print('__body');
},
LabeledStatement,
Program,

@@ -56,0 +52,0 @@ EmptyStatement(path, {write}) {

{
"name": "@putout/printer",
"version": "11.6.0",
"version": "11.7.0",
"type": "commonjs",

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

"@putout/plugin-printer": "^3.0.0",
"@putout/plugin-promises": "^15.0.0",
"@putout/plugin-promises": "^16.0.0",
"@putout/plugin-react-hook-form": "^4.0.0",

@@ -60,0 +60,0 @@ "@putout/plugin-react-hooks": "^6.0.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