🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More
Socket
Sign inDemoInstall
Socket

simple-swizzle

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-swizzle - npm Package Compare versions

Comparing version

to
0.2.0

8

index.js

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

module.exports = function swizzle(args) {
var swizzle = module.exports = function swizzle(args) {
var results = [];

@@ -24,1 +24,7 @@

};
swizzle.wrap = function (fn) {
return function () {
return fn(swizzle(arguments));
};
};

2

package.json
{
"name": "simple-swizzle",
"description": "Simply swizzle your arguments",
"version": "0.1.0",
"version": "0.2.0",
"author": "Qix (http://github.com/qix-)",

@@ -6,0 +6,0 @@ "keywords": [

@@ -21,4 +21,21 @@ # 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)

Functions can also be wrapped to automatically swizzle arguments and be passed
the resulting array.
```js
var swizzle = require('simple-swizzle');
var sfn = swizzle.wrap(function (args) {
// ...
return args;
});
sfn(1, [2, 3], 4); // [1, 2, 3, 4]
sfn(1, 2, 3, 4); // [1, 2, 3, 4]
sfn([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).