[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]node_modules/2023-06-13 07:16 -  
[   ]LICENSE2016-11-16 02:03 1.1K 
[TXT]README.md2016-11-16 02:03 1.2Kd768d73 docs [كارل مبارك]
[   ]index.js2016-11-16 02:24 571 3e510ca test new git [كارل مبارك]
[   ]package.json2023-06-13 07:17 1.7K3e510ca test new git [كارل مبارك]
# simple-swizzle [![Travis-CI.org Build Status](https://img.shields.io/travis/Qix-/node-simple-swizzle.svg?style=flat-square)](https://travis-ci.org/Qix-/node-simple-swizzle) [![Coveralls.io Coverage Rating](https://img.shields.io/coveralls/Qix-/node-simple-swizzle.svg?style=flat-square)](https://coveralls.io/r/Qix-/node-simple-swizzle)

> [Swizzle](https://en.wikipedia.org/wiki/Swizzling_(computer_graphics)) your function arguments; pass in mixed arrays/values and get a clean array

## Usage

```js
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.

```js
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](http://opensource.org/licenses/MIT).
You can find a copy of it in [LICENSE](LICENSE).