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.14.0 to 3.14.1

12

CHANGELOG.json

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

{
"version": "3.14.1",
"tag": "@microsoft/node-core-library_v3.14.1",
"date": "Wed, 04 Sep 2019 18:28:06 GMT",
"comments": {
"patch": [
{
"comment": "Add support for two more arguments in LegacyAdapters.convertCallbackToPromise."
}
]
}
},
{
"version": "3.14.0",

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

9

CHANGELOG.md
# Change Log - @microsoft/node-core-library
This log was last generated on Thu, 08 Aug 2019 15:14:17 GMT and should not be manually modified.
This log was last generated on Wed, 04 Sep 2019 18:28:06 GMT and should not be manually modified.
## 3.14.1
Wed, 04 Sep 2019 18:28:06 GMT
### Patches
- Add support for two more arguments in LegacyAdapters.convertCallbackToPromise.
## 3.14.0

@@ -6,0 +13,0 @@ Thu, 08 Aug 2019 15:14:17 GMT

2

lib/index.d.ts

@@ -23,3 +23,3 @@ /**

export { FileWriter, IFileWriterFlags } from './FileWriter';
export { LegacyAdapters, callback } from './LegacyAdapters';
export { LegacyAdapters, LegacyCallback } from './LegacyAdapters';
export { StringBuilder, IStringBuilder } from './StringBuilder';

@@ -26,0 +26,0 @@ export { Terminal } from './Terminal/Terminal';

/**
* Callback used by {@link LegacyAdapters}.
* @beta
*/
export declare type callback<TResult, TError> = (error: TError, result: TResult) => void;
export declare type LegacyCallback<TResult, TError> = (error: TError, result: TResult) => void;
/**
* Helper functions used when interacting with APIs that do not follow modern coding practices.
*
* @beta
*/

@@ -15,5 +12,7 @@ export declare class LegacyAdapters {

*/
static convertCallbackToPromise<TResult, TError>(fn: (cb: callback<TResult, TError>) => void): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1>(fn: (arg1: TArg1, cb: callback<TResult, TError>) => void, arg1: TArg1): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1, TArg2>(fn: (arg1: TArg1, arg2: TArg2, cb: callback<TResult, TError>) => void, arg1: TArg1, arg2: TArg2): Promise<TResult>;
static convertCallbackToPromise<TResult, TError>(fn: (cb: LegacyCallback<TResult, TError>) => void): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1>(fn: (arg1: TArg1, cb: LegacyCallback<TResult, TError>) => void, arg1: TArg1): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1, TArg2>(fn: (arg1: TArg1, arg2: TArg2, cb: LegacyCallback<TResult, TError>) => void, arg1: TArg1, arg2: TArg2): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1, TArg2, TArg3>(fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, cb: LegacyCallback<TResult, TError>) => void, arg1: TArg1, arg2: TArg2, arg3: TArg3): Promise<TResult>;
static convertCallbackToPromise<TResult, TError, TArg1, TArg2, TArg3, TArg4>(fn: (arg1: TArg1, arg2: TArg2, arg3: TArg3, arg4: TArg4, cb: LegacyCallback<TResult, TError>) => void, arg1: TArg1, arg2: TArg2, arg3: TArg3, arg4: TArg4): Promise<TResult>;
/**

@@ -20,0 +19,0 @@ * Normalizes an object into an `Error` object.

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

* Helper functions used when interacting with APIs that do not follow modern coding practices.
*
* @beta
*/
class LegacyAdapters {
static convertCallbackToPromise(fn, arg1, arg2) {
static convertCallbackToPromise(fn, arg1, arg2, arg3, arg4) {
return new Promise((resolve, reject) => {

@@ -23,3 +21,9 @@ const cb = (error, result) => {

try {
if (arg1 !== undefined && arg2 !== undefined) {
if (arg1 !== undefined && arg2 !== undefined && arg3 !== undefined && arg4 !== undefined) {
fn(arg1, arg2, arg3, arg4, cb);
}
else if (arg1 !== undefined && arg2 !== undefined && arg3 !== undefined) {
fn(arg1, arg2, arg3, cb);
}
else if (arg1 !== undefined && arg2 !== undefined) {
fn(arg1, arg2, cb);

@@ -26,0 +30,0 @@ }

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

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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