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

hyperdiff

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperdiff - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

9

CHANGELOG.md

@@ -0,1 +1,10 @@

<a name="2.0.5"></a>
## 2.0.5 (2018-06-08)
* Support string as id ([32b8006](https://github.com/kikobeats/hyperdiff/commit/32b8006)), closes [#8](https://github.com/kikobeats/hyperdiff/issues/8)
* Update compositor.json via compositor.io ([3e50f07](https://github.com/kikobeats/hyperdiff/commit/3e50f07))
* Update node version ([e2c3446](https://github.com/kikobeats/hyperdiff/commit/e2c3446))
<a name="2.0.4"></a>

@@ -2,0 +11,0 @@ ## 2.0.4 (2017-12-01)

10

lib/index.js

@@ -17,3 +17,3 @@ 'use strict'

function indexOf (collection, item, props) {
function indexOf (collection, item) {
return collection.indexOf(item)

@@ -32,3 +32,3 @@ }

function determinateFindIndex (props) {
function determinateFindIndex (ids, props) {
return props ? findIndexWithProps : indexOf

@@ -38,8 +38,10 @@ }

function hyperdiff (orig, dist, props) {
const ids = props ? [].concat(props) : []
const {first, second} = determinateCollections(orig, dist)
const findIndex = determinateFindIndex(props)
const findIndex = determinateFindIndex(ids, props)
debug('preconditions first=%j second=%j findIndex=%s', first, second, findIndex.name)
const results = first.reduce(function (acc, item, index) {
const itemIndex = findIndex(second, item, props)
const itemIndex = findIndex(second, item, ids)
const destination = isPresent(itemIndex) ? 'common' : 'removed'

@@ -46,0 +48,0 @@ acc[destination].push(item)

4

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/Kikobeats/hyperdiff",
"version": "2.0.4",
"version": "2.0.5",
"main": "lib",

@@ -49,3 +49,3 @@ "author": {

"engines": {
"node": ">= 6"
"node": ">= 8"
},

@@ -52,0 +52,0 @@ "files": [

@@ -100,3 +100,2 @@ # hyperdiff

*Required*<br>
Type: `string`|`array`|`function`

@@ -103,0 +102,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