Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
inspect-parameters-declaration
Advanced tools
Inspects function's parameters declaration and returns information about it (e.g. names, default values, if needs destructuring, destructured parameters names and default values)
Inspects function's parameters declaration and returns information about it (e.g. names, default values, if needs destructuring, destructured parameters names and default values).
npm install inspect-parameters-declaration
CLI
npm install inspect-parameters-declaration -g
inspectParameters(source);
getParametersNames(source);
Where source is a function reference or a string containing the parameters declaration (e.g. 'a = "z, b = [1,2,3], c, {d,e: {f}, g} = {}')
const { getParametersNames, inspectParameters } = require('inspect-parameters-declaration');
const testFunction = (a = "z", b = [1,2,3], c, {d,e: {f}, g} = {}) => console.log("noop");
const parametersNames = getParametersNames(testFunction);
const inspectedParameters = inspectParameters(testFunction);
//////////////////////////////////////
// parametersNames :: RESULT //
// //
// [ "a", "b", "c", "d", "f", "g" ] //
//////////////////////////////////////
//////////////////////////////////////////////////
// inspectedParameters :: RESULT //
// //
// [ //
// { //
// "parameter": "a", //
// "defaultValue": "z", //
// "declaration": "a = \"z\"" //
// }, //
// { //
// "parameter": "b", //
// "defaultValue": "[1,2,3]", //
// "declaration": "b = [1,2,3]" //
// }, //
// { //
// "parameter": "c", //
// "declaration": "c" //
// }, //
// { //
// "parameter": "{d,e: {f}, g}", //
// "defaultValue": "{}", //
// "expectsDestructuring": true, //
// "declaration": "{d,e: {f}, g} = {}", //
// "destructuredParameters": [ //
// { //
// "parameter": "d", //
// "declaration": "d" //
// }, //
// { //
// "parameter": "f", //
// "declaration": "f" //
// }, //
// { //
// "parameter": "g", //
// "declaration": "g" //
// } //
// ] //
// } //
// ] //
//////////////////////////////////////////////////
FAQs
Inspects function's parameters declaration and returns information about it (e.g. names, default values, if needs destructuring, destructured parameters names and default values)
The npm package inspect-parameters-declaration receives a total of 120,285 weekly downloads. As such, inspect-parameters-declaration popularity was classified as popular.
We found that inspect-parameters-declaration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.