@contrast/common 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/primordials.d.ts +9 -0
- package/lib/primordials.js +14 -1
- package/package.json +1 -1
package/lib/primordials.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
3
5
|
import { inspect } from 'util';
|
|
6
|
+
import fs from 'fs';
|
|
4
7
|
export declare const primordials: {
|
|
5
8
|
ArrayPrototypeJoin: (separator?: string | undefined) => string;
|
|
6
9
|
ArrayPrototypeSlice: (start?: number | undefined, end?: number | undefined) => any[];
|
|
@@ -52,5 +55,11 @@ export declare const primordials: {
|
|
|
52
55
|
};
|
|
53
56
|
UtilInspect: typeof inspect;
|
|
54
57
|
PathBasename: (path: string, ext?: string | undefined) => string;
|
|
58
|
+
FsOpen: typeof fs.open;
|
|
59
|
+
FsOpenSync: typeof fs.openSync;
|
|
60
|
+
FsReadFile: typeof fs.readFile;
|
|
61
|
+
FsReadFileSync: typeof fs.readFileSync;
|
|
62
|
+
FsPromisesOpen: typeof fs.promises.open;
|
|
63
|
+
FsPromiseReadFile: typeof fs.promises.readFile;
|
|
55
64
|
};
|
|
56
65
|
//# sourceMappingURL=primordials.d.ts.map
|
package/lib/primordials.js
CHANGED
|
@@ -13,10 +13,15 @@
|
|
|
13
13
|
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
14
14
|
* way not consistent with the End User License Agreement.
|
|
15
15
|
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
exports.primordials = void 0;
|
|
18
21
|
const util_1 = require("util");
|
|
19
22
|
const path_1 = require("path");
|
|
23
|
+
const fs_1 = __importDefault(require("fs"));
|
|
24
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
20
25
|
exports.primordials = {
|
|
21
26
|
// arrays
|
|
22
27
|
ArrayPrototypeJoin: Array.prototype.join,
|
|
@@ -48,6 +53,14 @@ exports.primordials = {
|
|
|
48
53
|
JSONParse: JSON.parse,
|
|
49
54
|
JSONStringify: JSON.stringify,
|
|
50
55
|
UtilInspect: util_1.inspect,
|
|
51
|
-
PathBasename: path_1.basename
|
|
56
|
+
PathBasename: path_1.basename,
|
|
57
|
+
// fs
|
|
58
|
+
FsOpen: fs_1.default.open,
|
|
59
|
+
FsOpenSync: fs_1.default.openSync,
|
|
60
|
+
FsReadFile: fs_1.default.readFile,
|
|
61
|
+
FsReadFileSync: fs_1.default.readFileSync,
|
|
62
|
+
// fs/promises
|
|
63
|
+
FsPromisesOpen: promises_1.default.open,
|
|
64
|
+
FsPromiseReadFile: promises_1.default.readFile,
|
|
52
65
|
};
|
|
53
66
|
//# sourceMappingURL=primordials.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0",
|
|
4
4
|
"description": "Shared constants and utilities for all Contrast Agent modules",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|