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.1.0 to 3.2.0

lib/PromiseUtilities.d.ts

17

CHANGELOG.json

@@ -5,2 +5,19 @@ {

{
"version": "3.2.0",
"tag": "@microsoft/node-core-library_v3.2.0",
"date": "Sun, 07 Oct 2018 06:15:56 GMT",
"comments": {
"minor": [
{
"comment": "Introduce promiseify utility function."
}
],
"patch": [
{
"comment": "Update documentation"
}
]
}
},
{
"version": "3.1.0",

@@ -7,0 +24,0 @@ "tag": "@microsoft/node-core-library_v3.1.0",

13

CHANGELOG.md
# Change Log - @microsoft/node-core-library
This log was last generated on Fri, 28 Sep 2018 16:05:35 GMT and should not be manually modified.
This log was last generated on Sun, 07 Oct 2018 06:15:56 GMT and should not be manually modified.
## 3.2.0
Sun, 07 Oct 2018 06:15:56 GMT
### Minor changes
- Introduce promiseify utility function.
### Patches
- Update documentation
## 3.1.0

@@ -6,0 +17,0 @@ Fri, 28 Sep 2018 16:05:35 GMT

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

export declare type callback<TResult, TError> = (error: TError, result: TResult) => void;
/**

@@ -648,3 +650,3 @@ * The allowed types of encodings, as supported by Node.js

/**
* If true, then "\n" will be used for newlines instead of the default "\r\n".
* If true, then `\n` will be used for newlines instead of the default `\r\n`.
*/

@@ -1080,3 +1082,3 @@ newlineConversion?: NewlineKind;

/**
* Helper functions for working with the Map<K,V> data type.
* Helper functions for working with the `Map<K, V>` data type.
*

@@ -1250,8 +1252,21 @@ * @public

/**
* Returns true if childPath refers to a location under parentFolderPath.
* Returns true if "childPath" is located inside the "parentFolderPath" folder
* or one of its child folders. Note that "parentFolderPath" is not considered to be
* under itself. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().
*/
static isUnder(childPath: string, parentFolderPath: string): boolean;
/**
* Returns true if "childPath" is equal to "parentFolderPath", or if it is inside that folder
* or one of its children. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().
*/
static isUnderOrEqual(childPath: string, parentFolderPath: string): boolean;

@@ -1334,3 +1349,17 @@ }

/**
* The ProtectableMap provides an easy way for an API to expose a Map<K, V> property
* This is a set of utilities for constructing and interacting with promises.
*
* @beta
*/
export declare class PromiseUtilities {
/**
* This function wraps a function with a callback in a promise.
*/
static promiseify<TResult, TError>(fn: (cb: callback<TResult, TError>) => void): Promise<TResult>;
static promiseify<TResult, TError, TArg1>(fn: (arg1: TArg1, cb: callback<TResult, TError>) => void, arg1: TArg1): Promise<TResult>;
static promiseify<TResult, TError, TArg1, TArg2>(fn: (arg1: TArg1, arg2: TArg2, cb: callback<TResult, TError>) => void, arg1: TArg1, arg2: TArg2): Promise<TResult>;
}
/**
* The ProtectableMap provides an easy way for an API to expose a `Map<K, V>` property
* while intercepting and validating any write operations that are performed by

@@ -1345,3 +1374,3 @@ * consumers of the API.

*
* For example, suppose you want to share your Map<string,number> data structure,
* For example, suppose you want to share your `Map<string, number>` data structure,
* but you want to enforce that the key must always be an upper case string:

@@ -1441,5 +1470,5 @@ * You could use the onSet() hook to validate the keys and throw an exception

/**
* Returns the input string with a trailing '\n' character appended, if not already present.
* Returns the input string with a trailing `\n` character appended, if not already present.
*/
static ensureTrailingNewline(s: string, newlineKind?: NewlineKind): string;
}

@@ -22,1 +22,2 @@ /**

export { FileWriter, IFileWriterFlags } from './FileWriter';
export { PromiseUtilities, callback } from './PromiseUtilities';

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

exports.FileWriter = FileWriter_1.FileWriter;
var PromiseUtilities_1 = require("./PromiseUtilities");
exports.PromiseUtilities = PromiseUtilities_1.PromiseUtilities;
//# sourceMappingURL=index.js.map

2

lib/JsonFile.d.ts

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

/**
* If true, then "\n" will be used for newlines instead of the default "\r\n".
* If true, then `\n` will be used for newlines instead of the default `\r\n`.
*/

@@ -13,0 +13,0 @@ newlineConversion?: NewlineKind;

/**
* Helper functions for working with the Map<K,V> data type.
* Helper functions for working with the `Map<K, V>` data type.
*

@@ -4,0 +4,0 @@ * @public

@@ -6,3 +6,3 @@ "use strict";

/**
* Helper functions for working with the Map<K,V> data type.
* Helper functions for working with the `Map<K, V>` data type.
*

@@ -9,0 +9,0 @@ * @public

@@ -10,9 +10,22 @@ /**

/**
* Returns true if childPath refers to a location under parentFolderPath.
* Returns true if "childPath" is located inside the "parentFolderPath" folder
* or one of its child folders. Note that "parentFolderPath" is not considered to be
* under itself. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().
*/
static isUnder(childPath: string, parentFolderPath: string): boolean;
/**
* Returns true if "childPath" is equal to "parentFolderPath", or if it is inside that folder
* or one of its children. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().
*/
static isUnderOrEqual(childPath: string, parentFolderPath: string): boolean;
}

@@ -14,5 +14,9 @@ "use strict";

/**
* Returns true if childPath refers to a location under parentFolderPath.
* Returns true if "childPath" is located inside the "parentFolderPath" folder
* or one of its child folders. Note that "parentFolderPath" is not considered to be
* under itself. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().

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

}
/**
* Returns true if "childPath" is equal to "parentFolderPath", or if it is inside that folder
* or one of its children. The "childPath" can refer to any type of file system object.
*
* @remarks
* The indicated file/folder objects are not required to actually exist on disk.
* For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file.
* If the paths are relative, they will first be resolved using path.resolve().
*/
static isUnderOrEqual(childPath, parentFolderPath) {

@@ -29,0 +42,0 @@ const relativePath = path.relative(childPath, parentFolderPath);

@@ -25,3 +25,3 @@ /**

/**
* The ProtectableMap provides an easy way for an API to expose a Map<K, V> property
* The ProtectableMap provides an easy way for an API to expose a `Map<K, V>` property
* while intercepting and validating any write operations that are performed by

@@ -36,3 +36,3 @@ * consumers of the API.

*
* For example, suppose you want to share your Map<string,number> data structure,
* For example, suppose you want to share your `Map<string, number>` data structure,
* but you want to enforce that the key must always be an upper case string:

@@ -39,0 +39,0 @@ * You could use the onSet() hook to validate the keys and throw an exception

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

/**
* The ProtectableMap provides an easy way for an API to expose a Map<K, V> property
* The ProtectableMap provides an easy way for an API to expose a `Map<K, V>` property
* while intercepting and validating any write operations that are performed by

@@ -18,3 +18,3 @@ * consumers of the API.

*
* For example, suppose you want to share your Map<string,number> data structure,
* For example, suppose you want to share your `Map<string, number>` data structure,
* but you want to enforce that the key must always be an upper case string:

@@ -21,0 +21,0 @@ * You could use the onSet() hook to validate the keys and throw an exception

import { ProtectableMap, IProtectableMapParameters } from './ProtectableMap';
/**
* The internal wrapper used by ProtectableMap. It extends the real Map<K, V> base class,
* The internal wrapper used by ProtectableMap. It extends the real `Map<K, V>` base class,
* but hooks the destructive operations (clear/delete/set) to give the owner a chance

@@ -5,0 +5,0 @@ * to block them.

@@ -6,3 +6,3 @@ "use strict";

/**
* The internal wrapper used by ProtectableMap. It extends the real Map<K, V> base class,
* The internal wrapper used by ProtectableMap. It extends the real `Map<K, V>` base class,
* but hooks the destructive operations (clear/delete/set) to give the owner a chance

@@ -9,0 +9,0 @@ * to block them.

@@ -71,5 +71,5 @@ /**

/**
* Returns the input string with a trailing '\n' character appended, if not already present.
* Returns the input string with a trailing `\n` character appended, if not already present.
*/
static ensureTrailingNewline(s: string, newlineKind?: NewlineKind): string;
}

@@ -72,3 +72,3 @@ "use strict";

/**
* Returns the input string with a trailing '\n' character appended, if not already present.
* Returns the input string with a trailing `\n` character appended, if not already present.
*/

@@ -75,0 +75,0 @@ static ensureTrailingNewline(s, newlineKind = "\n" /* Lf */) {

{
"name": "@microsoft/node-core-library",
"version": "3.1.0",
"version": "3.2.0",
"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 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

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