@putout/printer
Advanced tools
@@ -35,9 +35,6 @@ import {types} from '@putout/babel'; | ||
| const cutOptions = (fn) => (a) => fn(a); | ||
| const isFunctionLike = cutOptions(isFunction); | ||
| const isFunctionParam = callWithParent(createTypeChecker([ | ||
| ['+', isFunctionLike], | ||
| ['+', isFunction], | ||
| ['-: -> !AssignmentPattern'], | ||
| ['+: parentPath', isFunctionLike], | ||
| ['+: parentPath', isFunction], | ||
| ])); | ||
@@ -72,3 +69,5 @@ | ||
| const properties = path.node.properties | ||
| const properties = path | ||
| .node | ||
| .properties | ||
| .filter(isObjectProperty) | ||
@@ -75,0 +74,0 @@ .map(getValue) |
@@ -0,1 +1,3 @@ | ||
| import {types} from '@putout/babel'; | ||
| const isFn = (a) => typeof a === 'function'; | ||
@@ -21,3 +23,3 @@ const isString = (a) => typeof a === 'string'; | ||
| const result = fn(a, options); | ||
| const result = maybeCutOptions(fn, a, options); | ||
@@ -29,1 +31,10 @@ if (not) | ||
| }; | ||
| function maybeCutOptions(fn, a, options) { | ||
| const {name} = fn; | ||
| if (types[name] === fn) | ||
| return fn(a); | ||
| return fn(a, options); | ||
| } |
+1
-1
| { | ||
| "name": "@putout/printer", | ||
| "version": "18.8.5", | ||
| "version": "18.8.6", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
Sorry, the diff of this file is not supported yet
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
327012
0.07%6828
0.1%