Socket
Socket
Sign inDemoInstall

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 0.2.0 to 0.2.1

5

index.js
'use strict';
var isArrayish = require('is-arrayish');
var concat = Array.prototype.concat;

@@ -12,4 +14,3 @@ var slice = Array.prototype.slice;

// https://jsperf.com/hasownproperty-vs-in-vs-undefined/12
if (typeof arg.length !== 'undefined') {
if (isArrayish(arg)) {
// http://jsperf.com/javascript-array-concat-vs-push/98

@@ -16,0 +17,0 @@ results = concat.call(results, slice.call(arg));

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

@@ -32,3 +32,6 @@ "keywords": [

"xo": "^0.7.1"
},
"dependencies": {
"is-arrayish": "^0.3.0"
}
}

9

README.md

@@ -27,3 +27,3 @@ # 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)

var sfn = swizzle.wrap(function (args) {
var swizzledFn = swizzle.wrap(function (args) {
// ...

@@ -33,6 +33,5 @@ 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]
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]
```

@@ -39,0 +38,0 @@

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