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

inspect-parameters-declaration

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inspect-parameters-declaration - npm Package Compare versions

Comparing version 0.0.12 to 0.1.0

3

lib/inspect-parameters-declaration.js

@@ -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

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