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

util-ex

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util-ex - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

lib/createFunction.d.ts

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

declare function _exports(name: string, args?: (string | string[]) | undefined, body: string, scope?: (string[] | any), values?: any[], ...args: any[]): Function;
declare function _exports(name: string, aArgs?: (string | string[]) | undefined, body: string, scope?: (string[] | any), values?: any[], ...args: any[]): Function;
export = _exports;

@@ -26,3 +26,3 @@ // Generated by CoffeeScript 2.7.0

* @param {string} name - The name of the function.
* @param {string|string[]=} [args] - An array of argument names. or function body if it's string.
* @param {string|string[]=} [aArgs] - An array of argument names. or function body if it's string.
* @param {string} body - The function body as a string.

@@ -44,16 +44,16 @@ * @param {(string[]|Object)} [scope] - An array of scope names, or an object with scope names as keys and their corresponding values as values.

module.exports = function createFunction(name, args, body, scope, values) {
module.exports = function createFunction(name, aArgs, body, scope, values) {
if (arguments.length === 1) {
return _createFunc('function ' + name + '(){}');
}
if (isString(args)) {
if (isString(aArgs)) {
values = scope;
scope = body;
body = args;
args = [];
} else if (args == null) {
args = [];
body = aArgs;
aArgs = [];
} else if (aArgs == null) {
aArgs = [];
}
body = 'function ' + name + '(' + args.join(', ') + ') {\n' + body + '\n}';
body = 'function ' + name + '(' + aArgs.join(', ') + ') {\n' + body + '\n}';
return _createFunc(body, scope, values);
};

@@ -87,3 +87,3 @@ export = injectFunc;

}
declare function createArguments(args: any, ...args: any[]): any;
declare function createArguments(aArgs: any, ...args: any[]): any;
declare function isArguments(v: any): any;

@@ -171,5 +171,5 @@ // var inherits = require('inherits-ex/lib/inheritsDirectly');

function createArguments(args) {
if (arguments.length !== 1 || !Array.isArray(args)) args = arguments;
var result = Array.apply(null, args);
function createArguments(aArgs) {
if (arguments.length !== 1 || !Array.isArray(aArgs)) aArgs = arguments;
var result = Array.apply(null, aArgs);
defineProperty(result, '__arguments__', true);

@@ -176,0 +176,0 @@ return result;

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

declare function _exports(name: string | Function, args: string[], body: string, scope: object, values: object, ...args: any[]): Function;
declare function _exports(name: string | Function, aArgs: string[], body: string, scope: object, values: object, ...args: any[]): Function;
export = _exports;

@@ -33,3 +33,3 @@ // Generated by CoffeeScript 2.7.0

* @param {string|Function} name The name of the function or the function itself.
* @param {string[]} args An array of argument names for the function.
* @param {string[]} aArgs An array of argument names for the function.
* @param {string} body The body of the function.

@@ -52,3 +52,3 @@ * @param {object} scope The scope for the function.

*/
module.exports = function newFunction(name, args, body, scope, values) {
module.exports = function newFunction(name, aArgs, body, scope, values) {
if (arguments.length === 1) {

@@ -61,14 +61,14 @@ if (!isFunction(name)) {

if (isFunction(name)) {
scope = args;
scope = aArgs;
values = body;
} else {
if (isString(args)) {
if (isString(aArgs)) {
values = scope;
scope = body;
body = args;
args = [];
} else if (args == null) {
args = [];
body = aArgs;
aArgs = [];
} else if (aArgs == null) {
aArgs = [];
}
name = 'function ' + name + '(' + args.join(', ') + ') {\n' + body + '\n}';
name = 'function ' + name + '(' + aArgs.join(', ') + ') {\n' + body + '\n}';
}

@@ -75,0 +75,0 @@ return createFunc(name, scope, values);

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/snowyu/util-ex.js",
"version": "1.0.1",
"version": "1.0.2",
"author": {

@@ -55,3 +55,3 @@ "name": "Riceball LEE",

"doc.md": "typedoc --plugin typedoc-plugin-markdown --out docs ./src",
"release": "npm run build && npm run doc.md && npx standard-version",
"release": "npm run build && npm run doc.md && git add docs && git ci -m 'docs: update API docs' && npx standard-version -s",
"release.alpha": "npx standard-version --prerelease alpha",

@@ -58,0 +58,0 @@ "release.major": "npx standard-version -r major",

@@ -26,3 +26,3 @@ // Generated by CoffeeScript 2.7.0

* @param {string} name - The name of the function.
* @param {string|string[]=} [args] - An array of argument names. or function body if it's string.
* @param {string|string[]=} [aArgs] - An array of argument names. or function body if it's string.
* @param {string} body - The function body as a string.

@@ -44,16 +44,16 @@ * @param {(string[]|Object)} [scope] - An array of scope names, or an object with scope names as keys and their corresponding values as values.

module.exports = function createFunction(name, args, body, scope, values) {
module.exports = function createFunction(name, aArgs, body, scope, values) {
if (arguments.length === 1) {
return _createFunc('function ' + name + '(){}');
}
if (isString(args)) {
if (isString(aArgs)) {
values = scope;
scope = body;
body = args;
args = [];
} else if (args == null) {
args = [];
body = aArgs;
aArgs = [];
} else if (aArgs == null) {
aArgs = [];
}
body = 'function ' + name + '(' + args.join(', ') + ') {\n' + body + '\n}';
body = 'function ' + name + '(' + aArgs.join(', ') + ') {\n' + body + '\n}';
return _createFunc(body, scope, values);
};

@@ -171,5 +171,5 @@ // var inherits = require('inherits-ex/lib/inheritsDirectly');

function createArguments(args) {
if (arguments.length !== 1 || !Array.isArray(args)) args = arguments;
var result = Array.apply(null, args);
function createArguments(aArgs) {
if (arguments.length !== 1 || !Array.isArray(aArgs)) aArgs = arguments;
var result = Array.apply(null, aArgs);
defineProperty(result, '__arguments__', true);

@@ -176,0 +176,0 @@ return result;

@@ -33,3 +33,3 @@ // Generated by CoffeeScript 2.7.0

* @param {string|Function} name The name of the function or the function itself.
* @param {string[]} args An array of argument names for the function.
* @param {string[]} aArgs An array of argument names for the function.
* @param {string} body The body of the function.

@@ -52,3 +52,3 @@ * @param {object} scope The scope for the function.

*/
module.exports = function newFunction(name, args, body, scope, values) {
module.exports = function newFunction(name, aArgs, body, scope, values) {
if (arguments.length === 1) {

@@ -61,14 +61,14 @@ if (!isFunction(name)) {

if (isFunction(name)) {
scope = args;
scope = aArgs;
values = body;
} else {
if (isString(args)) {
if (isString(aArgs)) {
values = scope;
scope = body;
body = args;
args = [];
} else if (args == null) {
args = [];
body = aArgs;
aArgs = [];
} else if (aArgs == null) {
aArgs = [];
}
name = 'function ' + name + '(' + args.join(', ') + ') {\n' + body + '\n}';
name = 'function ' + name + '(' + aArgs.join(', ') + ') {\n' + body + '\n}';
}

@@ -75,0 +75,0 @@ return createFunc(name, scope, values);

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