Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-swap

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-swap - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

24

index.js
if (!Array.prototype.swap) {
module.exports = Array.prototype.swap = function(x, y) {
var swap = function(x, y) {
this[x] = this.splice(y, 1, this[x])[0];
return this;
}(Array.prototype.swap);
}
return this;
};
if (Object.defineProperty) {
try {
Object.defineProperty(Array.prototype, 'swap', {
value: swap,
configurable: true,
enumerable: false,
writable: true
});
} catch(e) {}
}
Array.prototype.swap = swap;
module.exports = swap;
}
{
"name": "array-swap",
"version": "0.0.2",
"version": "0.0.3",
"description": "Swapping two items in a javascript array - Array.prototype.swap",

@@ -5,0 +5,0 @@ "main": "index.js",

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