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

@thi.ng/api

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/api - npm Package Compare versions

Comparing version 2.3.0 to 2.3.1

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="2.3.1"></a>
## [2.3.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.3.0...@thi.ng/api@2.3.1) (2018-04-29)
### Performance Improvements
* **api:** major speedup equivObject(), update equivSet() ([7fdf172](https://github.com/thi-ng/umbrella/commit/7fdf172))
<a name="2.3.0"></a>

@@ -8,0 +19,0 @@ # [2.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@2.2.0...@thi.ng/api@2.3.0) (2018-04-26)

30

equiv.js

@@ -38,5 +38,8 @@ "use strict";

}
if ((is_set_1.isSet(a) && is_set_1.isSet(b)) || (is_map_1.isMap(a) && is_map_1.isMap(b))) {
return equivSetLike(a, b);
if (is_set_1.isSet(a) && is_set_1.isSet(b)) {
return equivSet(a, b);
}
if (is_map_1.isMap(a) && is_map_1.isMap(b)) {
return equivMap(a, b);
}
if (is_date_1.isDate(a) && is_date_1.isDate(b)) {

@@ -60,20 +63,23 @@ return a.getTime() === b.getTime();

}
function equivSetLike(a, b) {
function equivSet(a, b) {
if (a.size !== b.size)
return false;
return equiv([...a.keys()].sort(), [...b.keys()].sort());
}
function equivMap(a, b) {
if (a.size !== b.size)
return false;
return equiv([...a].sort(), [...b].sort());
}
function equivObject(a, b) {
const keys = new Set(Object.keys(a).concat(Object.keys(b)));
for (let k of keys) {
if (a.hasOwnProperty(k)) {
if (b.hasOwnProperty(k)) {
if (equiv(a[k], b[k])) {
continue;
}
}
const ka = Object.keys(a);
if (ka.length !== Object.keys(b).length)
return false;
for (let i = ka.length, k; --i >= 0;) {
k = ka[i];
if (!b.hasOwnProperty(k) || !equiv(a[k], b[k])) {
return false;
}
return false;
}
return true;
}

4

package.json
{
"name": "@thi.ng/api",
"version": "2.3.0",
"version": "2.3.1",
"description": "Common, generic types & interfaces for thi.ng projects",

@@ -27,3 +27,3 @@ "main": "./index.js",

"dependencies": {
"@thi.ng/checks": "^1.5.0"
"@thi.ng/checks": "^1.5.1"
},

@@ -30,0 +30,0 @@ "keywords": [

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