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

@phosphor/coreutils

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@phosphor/coreutils - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

1

lib/index.js

@@ -5,2 +5,3 @@ "use strict";

}
Object.defineProperty(exports, "__esModule", { value: true });
/*-----------------------------------------------------------------------------

@@ -7,0 +8,0 @@ | Copyright (c) 2014-2017, PhosphorJS Contributors

23

lib/json.d.ts

@@ -59,21 +59,12 @@ /**

/**
* Compare two JSON arrays for deep equality.
* Create a deep copy of a JSON value.
*
* @param first - The first JSON array of interest.
* @param value - The JSON value to copy.
*
* @param second - The second JSON array of interest.
*
* @returns `true` if the arrays are equal, `false` otherwise.
* @returns A deep copy of the given JSON value.
*/
function deepArrayEqual(first: JSONArray, second: JSONArray): boolean;
/**
* Compare two JSON objects for deep equality.
*
* @param first - The first JSON array of interest.
*
* @param second - The second JSON array of interest.
*
* @returns `true` if the arrays are equal, `false` otherwise.
*/
function deepObjectEqual(first: JSONObject, second: JSONObject): boolean;
function deepCopy(value: JSONPrimitive): JSONPrimitive;
function deepCopy(value: JSONArray): JSONArray;
function deepCopy(value: JSONObject): JSONObject;
function deepCopy(value: JSONValue): JSONValue;
}

@@ -9,2 +9,3 @@ /*-----------------------------------------------------------------------------

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -84,10 +85,17 @@ * The namespace for JSON-specific functions.

JSONExt.deepEqual = deepEqual;
function deepCopy(value) {
// Do nothing for primitive values.
if (isPrimitive(value)) {
return value;
}
// Deep copy an array.
if (isArray(value)) {
return deepArrayCopy(value);
}
// Deep copy an object.
return deepObjectCopy(value);
}
JSONExt.deepCopy = deepCopy;
/**
* Compare two JSON arrays for deep equality.
*
* @param first - The first JSON array of interest.
*
* @param second - The second JSON array of interest.
*
* @returns `true` if the arrays are equal, `false` otherwise.
*/

@@ -112,11 +120,4 @@ function deepArrayEqual(first, second) {

}
JSONExt.deepArrayEqual = deepArrayEqual;
/**
* Compare two JSON objects for deep equality.
*
* @param first - The first JSON array of interest.
*
* @param second - The second JSON array of interest.
*
* @returns `true` if the arrays are equal, `false` otherwise.
*/

@@ -149,3 +150,22 @@ function deepObjectEqual(first, second) {

}
JSONExt.deepObjectEqual = deepObjectEqual;
/**
* Create a deep copy of a JSON array.
*/
function deepArrayCopy(value) {
var result = new Array(value.length);
for (var i = 0, n = value.length; i < n; ++i) {
result[i] = deepCopy(value[i]);
}
return result;
}
/**
* Create a deep copy of a JSON object.
*/
function deepObjectCopy(value) {
var result = {};
for (var key in value) {
result[key] = deepCopy(value[key]);
}
return result;
}
})(JSONExt = exports.JSONExt || (exports.JSONExt = {}));

@@ -9,2 +9,3 @@ /*-----------------------------------------------------------------------------

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -11,0 +12,0 @@ * An object which stores MIME data for general application use.

@@ -9,2 +9,3 @@ /*-----------------------------------------------------------------------------

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**

@@ -11,0 +12,0 @@ * A class which wraps a promise into a delegate object.

{
"name": "@phosphor/coreutils",
"version": "0.1.1",
"version": "0.1.2",
"description": "PhosphorJS - Core Utilities",

@@ -5,0 +5,0 @@ "main": "lib/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