/ stream.nieuweinstituut.nl / node_modules / simple-swizzle /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]node_modules/2 years ago -  
[   ]LICENSE8 years ago1.1K 
[TXT]README.md8 years ago1.2Kd768d73 docs [كارل مبارك]
[   ]index.js8 years ago571 3e510ca test new git [كارل مبارك]
[   ]package.json2 years ago1.7K3e510ca test new git [كارل مبارك]
README.md

simple-swizzle Travis-CI.org Build Status Coveralls.io Coverage Rating

Swizzle your function arguments; pass in mixed arrays/values and get a clean array

Usage

var swizzle = require('simple-swizzle');

function myFunc() {
    var args = swizzle(arguments);
    // ...
    return args;
}

myFunc(1, [2, 3], 4); // [1, 2, 3, 4]
myFunc(1, 2, 3, 4);   // [1, 2, 3, 4]
myFunc([1, 2, 3, 4]); // [1, 2, 3, 4]

Functions can also be wrapped to automatically swizzle arguments and be passed the resulting array.

var swizzle = require('simple-swizzle');

var swizzledFn = swizzle.wrap(function (args) {
    // ...
    return args;
});

swizzledFn(1, [2, 3], 4); // [1, 2, 3, 4]
swizzledFn(1, 2, 3, 4);   // [1, 2, 3, 4]
swizzledFn([1, 2, 3, 4]); // [1, 2, 3, 4]

License

Licensed under the MIT License. You can find a copy of it in LICENSE.

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80