simple-swizzle

WebJar for simple-swizzle

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

simple-swizzle
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

simple-swizzle
WebJar for simple-swizzle
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/qix-/node-simple-swizzle

Download simple-swizzle

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/simple-swizzle/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>simple-swizzle</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/simple-swizzle/
implementation 'org.webjars.npm:simple-swizzle:0.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/simple-swizzle/
implementation ("org.webjars.npm:simple-swizzle:0.2.2")
'org.webjars.npm:simple-swizzle:jar:0.2.2'
<dependency org="org.webjars.npm" name="simple-swizzle" rev="0.2.2">
  <artifact name="simple-swizzle" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='simple-swizzle', version='0.2.2')
)
libraryDependencies += "org.webjars.npm" % "simple-swizzle" % "0.2.2"
[org.webjars.npm/simple-swizzle "0.2.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : is-arrayish jar [0.3.1,0.4)

Project Modules

There are no modules declared in this project.

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.

Versions

Version
0.2.2