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

billy

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

billy - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

16

es5/getArguments.js

@@ -5,3 +5,3 @@ 'use strict';

var babylon = require('babylon');
var parser = require('@babel/parser');

@@ -16,3 +16,13 @@ /*

*/
var cache = new WeakMap();
module.exports = function getArguments(f) {
if (cache.has(f)) {
return cache.get(f);
}
var args = _getArgs(f);
cache.set(f, args);
return args;
};
function _getArgs(f) {
var amended = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

@@ -46,3 +56,3 @@

try {
var ast = babylon.parse(code);
var ast = parser.parse(code, { plugins: ['objectRestSpread'] });
var node = findNode(ast);

@@ -61,3 +71,3 @@

if (!amended) {
return getArguments(f, true);
return _getArgs(f, true);
}

@@ -64,0 +74,0 @@

# Change History
## v2.0.3 (2018-10-24)
* Argument name resolution is now cached internally for better performance.
* Arguments can now be parsed from code containing object rest spread sytnax.
Contributions thanks to [@dshook](https://github.com/dshook)
## v2.0.2 (2017-09-08)

@@ -4,0 +11,0 @@

18

lib/getArguments.js

@@ -1,2 +0,2 @@

const babylon = require('babylon');
const parser = require('@babel/parser');

@@ -11,3 +11,13 @@ /*

*/
module.exports = function getArguments(f, amended = false)
var cache = new WeakMap();
module.exports = function getArguments(f){
if(cache.has(f)){
return cache.get(f);
}
let args = _getArgs(f);
cache.set(f, args);
return args;
}
function _getArgs(f, amended = false)
{

@@ -40,3 +50,3 @@ if (!f) {

try {
const ast = babylon.parse(code);
const ast = parser.parse(code, {plugins: ['objectRestSpread']});
const node = findNode(ast);

@@ -54,3 +64,3 @@

if (!amended) {
return getArguments(f, true);
return _getArgs(f, true);
}

@@ -57,0 +67,0 @@

'use strict';
const babylon = require('babylon');
const parser = require('@babel/parser');

@@ -13,3 +13,13 @@ /*

*/
module.exports = function getArguments(f, amended = false) {
var cache = new WeakMap();
module.exports = function getArguments(f) {
if (cache.has(f)) {
return cache.get(f);
}
let args = _getArgs(f);
cache.set(f, args);
return args;
};
function _getArgs(f, amended = false) {
if (!f) {

@@ -41,3 +51,3 @@ throw new Error('Missing function or class parameter');

try {
const ast = babylon.parse(code);
const ast = parser.parse(code, { plugins: ['objectRestSpread'] });
const node = findNode(ast);

@@ -54,3 +64,3 @@

if (!amended) {
return getArguments(f, true);
return _getArgs(f, true);
}

@@ -57,0 +67,0 @@

{
"name": "billy",
"version": "2.0.2",
"version": "2.0.3",
"description": "A minimal application harness that stays out of your way and out of your code.",

@@ -38,4 +38,4 @@ "author": "Brandon Valosek <bvalosek@gmail.com>",

"dependencies": {
"babylon": "6.17.0",
"debug": "2.6.6"
"@babel/parser": "^7.1.3",
"debug": "^4.1.0"
},

@@ -42,0 +42,0 @@ "devDependencies": {

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