inspect-parameters-declaration
Advanced tools
Comparing version 0.0.12 to 0.1.0
@@ -180,3 +180,4 @@ 'use strict'; | ||
if(source.constructor === Function) { | ||
const asyncFunctionConstructor = Object.getPrototypeOf(async function(){}).constructor; | ||
if(source.constructor === Function || source.constructor === asyncFunctionConstructor) { | ||
return inspectParametersFromFunction(source); | ||
@@ -183,0 +184,0 @@ } |
{ | ||
"name": "inspect-parameters-declaration", | ||
"version": "0.0.12", | ||
"version": "0.1.0", | ||
"description": "Inspects function's parameters declaration and returns information about it (e.g. names, default values, if needs destructuring, destructured parameters names and default values)", | ||
@@ -32,8 +32,8 @@ "main": "./lib/inspect-parameters-declaration.js", | ||
"split-skip": "0.0.2", | ||
"stringify-parameters": "0.0.4", | ||
"stringify-parameters": "0.0.7", | ||
"unpack-string": "0.0.2" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^3.5.0" | ||
"mocha": "^5.2.0" | ||
} | ||
} |
@@ -41,2 +41,7 @@ 'use strict'; | ||
asyncArrowWithParenthesis: { | ||
input: async (param) => console.log(param), | ||
expectedResult: ['param'] | ||
}, | ||
arrowWithParenthesis: { | ||
@@ -62,2 +67,7 @@ input: (param) => console.log(param), | ||
asyncSimpleFunction: { | ||
input: async function fn(z, k) {}, | ||
expectedResult: ['z', 'k'] | ||
}, | ||
simpleFunctionWithoutParameters: { | ||
@@ -85,2 +95,14 @@ input: function fn() {}, | ||
asyncStaticMethodFromClass: { | ||
input: (() => { | ||
class fn { | ||
static async staticMethod(b, l, a = 'A') { | ||
console.log(`bla bla`); | ||
} | ||
} | ||
return fn.staticMethod; | ||
})(), | ||
expectedResult: ['b', 'l', 'a'] | ||
}, | ||
complexNonSenseFunction: { | ||
@@ -87,0 +109,0 @@ input: (option, a = 2, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16538
438
+ Addedstringify-parameters@0.0.7(transitive)
Updatedstringify-parameters@0.0.7