Socket
Socket
Sign inDemoInstall

@microsoft/node-core-library

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/node-core-library - npm Package Compare versions

Comparing version 3.16.0 to 3.17.0

12

CHANGELOG.json

@@ -5,2 +5,14 @@ {

{
"version": "3.17.0",
"tag": "@microsoft/node-core-library_v3.17.0",
"date": "Tue, 05 Nov 2019 06:49:28 GMT",
"comments": {
"minor": [
{
"comment": "Add new API LegacyAdapters.stableSort(), and update the Sort API to be stable"
}
]
}
},
{
"version": "3.16.0",

@@ -7,0 +19,0 @@ "tag": "@microsoft/node-core-library_v3.16.0",

9

CHANGELOG.md
# Change Log - @microsoft/node-core-library
This log was last generated on Tue, 22 Oct 2019 06:24:44 GMT and should not be manually modified.
This log was last generated on Tue, 05 Nov 2019 06:49:28 GMT and should not be manually modified.
## 3.17.0
Tue, 05 Nov 2019 06:49:28 GMT
### Minor changes
- Add new API LegacyAdapters.stableSort(), and update the Sort API to be stable
## 3.16.0

@@ -6,0 +13,0 @@ Tue, 22 Oct 2019 06:24:44 GMT

2

dist/tsdoc-metadata.json

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.5.1"
"packageVersion": "7.5.2"
}
]
}

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { JsonSchema, IJsonSchemaErrorInfo, IJsonSchemaValidateOptions } from './JsonSchema';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { JsonObject } from './JsonFile';

@@ -0,0 +0,0 @@ "use strict";

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

export declare class LegacyAdapters {
private static _useTimsort;
/**

@@ -24,3 +25,12 @@ * This function wraps a function with a callback in a promise.

static scrubError(error: Error | string | any): Error;
/**
* Prior to Node 11.x, the `Array.sort()` algorithm is not guaranteed to be stable.
* If you need a stable sort, you can use `sortStable()` as a workaround.
*
* @remarks
* On NodeJS 11.x and later, this method simply calls the native `Array.sort()`.
* For earlier versions, it uses an implementation of Timsort, which is the same algorithm used by modern NodeJS.
*/
static sortStable<T>(array: T[], compare?: (a: T, b: T) => number): void;
}
//# sourceMappingURL=LegacyAdapters.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
const timsort_1 = require("timsort");
const semver = require("semver");
/**

@@ -59,4 +61,24 @@ * Helper functions used when interacting with APIs that do not follow modern coding practices.

}
/**
* Prior to Node 11.x, the `Array.sort()` algorithm is not guaranteed to be stable.
* If you need a stable sort, you can use `sortStable()` as a workaround.
*
* @remarks
* On NodeJS 11.x and later, this method simply calls the native `Array.sort()`.
* For earlier versions, it uses an implementation of Timsort, which is the same algorithm used by modern NodeJS.
*/
static sortStable(array, compare) {
if (LegacyAdapters._useTimsort === undefined) {
LegacyAdapters._useTimsort = semver.major(process.versions.node) < 11;
}
if (LegacyAdapters._useTimsort) {
timsort_1.sort(array, compare);
}
else {
Array.prototype.sort.call(array, compare);
}
}
}
LegacyAdapters._useTimsort = undefined;
exports.LegacyAdapters = LegacyAdapters;
//# sourceMappingURL=LegacyAdapters.js.map

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { IPackageJson, INodePackageJson } from './IPackageJson';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ProtectableMap, IProtectableMapParameters } from './ProtectableMap';

@@ -0,0 +0,0 @@ "use strict";

/**
* Operations for sorting collections.
*
* @remarks
* NOTE: Prior to Node 11.x, the `Array.sort()` algorithm is not guaranteed to be stable. For maximum
* compatibility, consider using {@link LegacyAdapters.sortStable} instead of `Array.sort()`.
*
* @public

@@ -27,2 +31,3 @@ */

* Sorts the array according to a key which is obtained from the array elements.
* The result is guaranteed to be a stable sort.
*

@@ -53,3 +58,4 @@ * @example

/**
* Sorts the entries in a Map object according to the keys.
* Sorts the entries in a Map object according to the map keys.
* The result is guaranteed to be a stable sort.
*

@@ -69,3 +75,4 @@ * @example

/**
* Sorts the entries in a Set object according to the keys.
* Sorts the entries in a Set object according to the specified keys.
* The result is guaranteed to be a stable sort.
*

@@ -85,3 +92,3 @@ * @example

/**
* Sorts the entries in a Set object according to the keys.
* Sorts the entries in a Set object. The result is guaranteed to be a stable sort.
*

@@ -88,0 +95,0 @@ * @example

@@ -5,5 +5,10 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const LegacyAdapters_1 = require("./LegacyAdapters");
/**
* Operations for sorting collections.
*
* @remarks
* NOTE: Prior to Node 11.x, the `Array.sort()` algorithm is not guaranteed to be stable. For maximum
* compatibility, consider using {@link LegacyAdapters.sortStable} instead of `Array.sort()`.
*
* @public

@@ -60,2 +65,3 @@ */

* Sorts the array according to a key which is obtained from the array elements.
* The result is guaranteed to be a stable sort.
*

@@ -71,3 +77,3 @@ * @example

static sortBy(array, keySelector, comparer = Sort.compareByValue) {
array.sort((x, y) => comparer(keySelector(x), keySelector(y)));
LegacyAdapters_1.LegacyAdapters.sortStable(array, (x, y) => comparer(keySelector(x), keySelector(y)));
}

@@ -111,3 +117,4 @@ /**

/**
* Sorts the entries in a Map object according to the keys.
* Sorts the entries in a Map object according to the map keys.
* The result is guaranteed to be a stable sort.
*

@@ -139,3 +146,4 @@ * @example

/**
* Sorts the entries in a Set object according to the keys.
* Sorts the entries in a Set object according to the specified keys.
* The result is guaranteed to be a stable sort.
*

@@ -160,3 +168,3 @@ * @example

}
array.sort((x, y) => keyComparer(keySelector(x), keySelector(y)));
LegacyAdapters_1.LegacyAdapters.sortStable(array, (x, y) => keyComparer(keySelector(x), keySelector(y)));
set.clear();

@@ -168,3 +176,3 @@ for (const item of array) {

/**
* Sorts the entries in a Set object according to the keys.
* Sorts the entries in a Set object. The result is guaranteed to be a stable sort.
*

@@ -189,3 +197,3 @@ * @example

}
array.sort((x, y) => comparer(x, y));
LegacyAdapters_1.LegacyAdapters.sortStable(array, (x, y) => comparer(x, y));
set.clear();

@@ -192,0 +200,0 @@ for (const item of array) {

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ITerminalProvider, TerminalProviderSeverity } from './ITerminalProvider';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ import { ITerminalProvider } from './ITerminalProvider';

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ "use strict";

{
"name": "@microsoft/node-core-library",
"version": "3.16.0",
"version": "3.17.0",
"description": "Core libraries that every NodeJS toolchain project should use",

@@ -19,14 +19,18 @@ "main": "lib/index.js",

"jju": "~1.4.0",
"semver": "~5.3.0",
"timsort": "~0.3.0",
"z-schema": "~3.18.3"
},
"devDependencies": {
"@microsoft/node-library-build": "6.3.2",
"@microsoft/rush-stack-compiler-3.4": "0.3.2",
"@rushstack/eslint-config": "0.4.1",
"@types/fs-extra": "5.0.4",
"@types/jest": "23.3.11",
"@types/jju": "1.4.1",
"@types/semver": "5.3.33",
"@types/timsort": "0.3.0",
"@types/z-schema": "3.16.31",
"gulp": "~4.0.2",
"@microsoft/node-library-build": "6.3.0",
"@microsoft/rush-stack-compiler-3.4": "0.3.0",
"@rushstack/eslint-config": "0.4.1"
"gulp": "~4.0.2"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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