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

array-move

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-move - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

8

index.js
'use strict';
const arrayMoveMutate = (array, from, to) => {
const startIndex = to < 0 ? array.length + to : to;
const startIndex = from < 0 ? array.length + from : from;
if (startIndex >= 0 && startIndex < array.length) {
const item = array.splice(from, 1)[0];
array.splice(startIndex, 0, item);
const endIndex = to < 0 ? array.length + to : to;
const [item] = array.splice(from, 1);
array.splice(endIndex, 0, item);
}

@@ -10,0 +12,0 @@ };

{
"name": "array-move",
"version": "3.0.0",
"version": "3.0.1",
"description": "Move an array item to a different position",

@@ -5,0 +5,0 @@ "license": "MIT",

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