New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-changes

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-changes - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

.jshintignore

20

package.json
{
"name": "array-changes",
"version": "1.0.2",
"version": "1.0.3",
"description": "Array diffing",
"main": "./lib/arrayChanges.js",
"scripts": {
"test": "mocha",
"lint": "jshint .",
"test": "mocha && npm run lint",
"travis": "npm test && npm run coverage && (<coverage/lcov.info coveralls || true)",
"coverage": "NODE_ENV=development istanbul cover _mocha -- --reporter dot && echo google-chrome coverage/lcov-report/index.html",
"prepublish": "(echo '/*!' && <LICENSE sed -e's/^/ * /' | sed -e's/\\s+$//' && echo ' */' && browserify -p bundle-collapser/plugin -e lib/arrayChanges -s weknowhow.arrayChanges) > array-changes.js"

@@ -24,10 +27,13 @@ },

"dependencies": {
"arraydiff": "0.1.1",
"browserify": "9.0.3",
"bundle-collapser": "1.1.4"
"arraydiff": "0.1.1"
},
"devDependencies": {
"mocha": "2.2.1",
"unexpected": "6.1.0"
"browserify": "9.0.3",
"bundle-collapser": "1.1.4",
"coveralls": "2.11.2",
"istanbul": "0.3.14",
"jshint": "2.7.0",
"mocha": "2.2.4",
"unexpected": "7.1.0"
}
}
# array-changes
[![NPM version](https://badge.fury.io/js/array-changes.svg)](http://badge.fury.io/js/array-changes)
[![Build Status](https://travis-ci.org/unexpectedjs/array-changes.svg?branch=master)](https://travis-ci.org/unexpectedjs/array-changes)
[![Coverage Status](https://coveralls.io/repos/unexpectedjs/array-changes/badge.svg)](https://coveralls.io/r/unexpectedjs/array-changes)
[![Dependency Status](https://david-dm.org/unexpectedjs/array-changes.svg)](https://david-dm.org/unexpectedjs/array-changes)
A library for finding differences between two arrays.

@@ -4,0 +9,0 @@

@@ -0,1 +1,2 @@

/*global describe, it*/
var arrayChanges = require('../lib/arrayChanges');

@@ -9,2 +10,8 @@ var expect = require('unexpected');

describe('array-changes', function () {
it('returns an empty change-list when the two arrays are both empty', function () {
expect(arrayChanges([], [], function (a, b) {
return a === b;
}), 'to equal', []);
});
it('returns a change-list with no changes if the arrays are the same', function () {

@@ -32,2 +39,10 @@ expect(arrayChanges([0, 1, 2, 3], [0, 1, 2, 3], function (a, b) {

it('should indicate item removals at the end', function () {
expect(arrayChanges([0], [], function (a, b) {
return a === b;
}), 'to equal', [
{ type: 'remove', value: 0, last: true }
]);
});
it('should indicate missing items', function () {

@@ -44,2 +59,10 @@ expect(arrayChanges([0, 1, 3], [0, 1, 2, 3], function (a, b) {

it('should indicate a missing item at the end', function () {
expect(arrayChanges([], [0], function (a, b) {
return a === b;
}), 'to equal', [
{ type: 'insert', value: 0, last: true }
]);
});
it('should treat moved items as removed and inserted', function () {

@@ -46,0 +69,0 @@ expect(arrayChanges([1, 2, 3, 0], [0, 1, 2, 3], function (a, b) {

Sorry, the diff of this file is not supported yet

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