@bluelovers/fs-json 1.0.13 → 1.0.14
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/CHANGELOG.md +15 -0
- package/index.js +8 -8
- package/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.14](https://github.com/bluelovers/ws-iconv/compare/@bluelovers/fs-json@1.0.13...@bluelovers/fs-json@1.0.14) (2024-08-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 🛠 Build System
|
|
11
|
+
|
|
12
|
+
* update build ([263e72e](https://github.com/bluelovers/ws-iconv/commit/263e72e423867a305d52992f40543e2efd19a349))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### 📌 Dependencies
|
|
16
|
+
|
|
17
|
+
* update deps ([dffc6e3](https://github.com/bluelovers/ws-iconv/commit/dffc6e313e4017a32d608bd0dad6ef6faaf761a3))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [1.0.13](https://github.com/bluelovers/ws-iconv/compare/@bluelovers/fs-json@1.0.12...@bluelovers/fs-json@1.0.13) (2022-10-02)
|
|
7
22
|
|
|
8
23
|
|
package/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.readJSONSync = exports.readJSON = void 0;
|
|
4
|
+
exports._handleWriteOptions = _handleWriteOptions;
|
|
5
|
+
exports.outputJSON = outputJSON;
|
|
6
|
+
exports.outputJSONSync = outputJSONSync;
|
|
7
|
+
exports.writeJSON = writeJSON;
|
|
8
|
+
exports.writeJSONSync = writeJSONSync;
|
|
9
|
+
exports.stringifyJSON = stringifyJSON;
|
|
10
|
+
exports.parseJSON = parseJSON;
|
|
4
11
|
const fs_extra_1 = require("fs-extra");
|
|
5
12
|
Object.defineProperty(exports, "readJSON", { enumerable: true, get: function () { return fs_extra_1.readJSON; } });
|
|
6
13
|
Object.defineProperty(exports, "readJSONSync", { enumerable: true, get: function () { return fs_extra_1.readJSONSync; } });
|
|
@@ -11,34 +18,27 @@ function _handleWriteOptions(options) {
|
|
|
11
18
|
(_a = options.finalEOL) !== null && _a !== void 0 ? _a : (options.finalEOL = true);
|
|
12
19
|
return options;
|
|
13
20
|
}
|
|
14
|
-
exports._handleWriteOptions = _handleWriteOptions;
|
|
15
21
|
function outputJSON(file, data, options) {
|
|
16
22
|
options = _handleWriteOptions(options);
|
|
17
23
|
return (0, fs_extra_1.outputJSON)(file, data, options);
|
|
18
24
|
}
|
|
19
|
-
exports.outputJSON = outputJSON;
|
|
20
25
|
function outputJSONSync(file, data, options) {
|
|
21
26
|
options = _handleWriteOptions(options);
|
|
22
27
|
return (0, fs_extra_1.outputJSONSync)(file, data, options);
|
|
23
28
|
}
|
|
24
|
-
exports.outputJSONSync = outputJSONSync;
|
|
25
29
|
function writeJSON(file, data, options) {
|
|
26
30
|
options = _handleWriteOptions(options);
|
|
27
31
|
return (0, fs_extra_1.writeJSON)(file, data, options);
|
|
28
32
|
}
|
|
29
|
-
exports.writeJSON = writeJSON;
|
|
30
33
|
function writeJSONSync(file, data, options) {
|
|
31
34
|
options = _handleWriteOptions(options);
|
|
32
35
|
return (0, fs_extra_1.writeJSONSync)(file, data, options);
|
|
33
36
|
}
|
|
34
|
-
exports.writeJSONSync = writeJSONSync;
|
|
35
37
|
function stringifyJSON(data, options) {
|
|
36
38
|
options = _handleWriteOptions(options);
|
|
37
39
|
return (0, utils_1.stringify)(data, options);
|
|
38
40
|
}
|
|
39
|
-
exports.stringifyJSON = stringifyJSON;
|
|
40
41
|
function parseJSON(stringOrUint8Array, reviver) {
|
|
41
42
|
return JSON.parse(stringOrUint8Array.toString(), reviver);
|
|
42
43
|
}
|
|
43
|
-
exports.parseJSON = parseJSON;
|
|
44
44
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAsBA,kDAKC;AAOD,gCAIC;AAED,wCAIC;AAED,8BAIC;AAED,sCAIC;AAED,sCAIC;AAED,8BAKC;AArED,uCAQkB;AAsBjB,yFA3BA,mBAAQ,OA2BA;AACR,6FA3BA,uBAAY,OA2BA;AAtBb,0CAA2C;AAa3C,SAAgB,mBAAmB,CAAC,OAAuB;;IAE1D,OAAO,aAAP,OAAO,cAAP,OAAO,IAAP,OAAO,GAAK,EAAE,EAAC;IACf,MAAA,OAAO,CAAC,QAAQ,oCAAhB,OAAO,CAAC,QAAQ,GAAK,IAAI,EAAC;IAC1B,OAAO,OAAO,CAAA;AACf,CAAC;AAOD,SAAgB,UAAU,CAAC,IAAY,EAAE,IAAS,EAAE,OAAuB;IAE1E,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,IAAA,qBAAW,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AACxC,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY,EAAE,IAAS,EAAE,OAAuB;IAE9E,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,IAAA,yBAAe,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC5C,CAAC;AAED,SAAgB,SAAS,CAAC,IAAY,EAAE,IAAS,EAAE,OAAuB;IAEzE,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,IAAA,oBAAU,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,IAAS,EAAE,OAAuB;IAE7E,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,IAAA,wBAAc,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,IAAS,EAAE,OAAuB;IAE/D,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,IAAA,iBAAS,EAAC,IAAI,EAAE,OAAc,CAAC,CAAA;AACvC,CAAC;AAED,SAAgB,SAAS,CAAC,kBAAuC,EAChE,OAAqD;IAGrD,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAA;AAC1D,CAAC","sourcesContent":["import {\n\toutputJSON as _outputJSON,\n\toutputJSONSync as _outputJSONSync,\n\treadJSON,\n\treadJSONSync,\n\twriteJSON as _writeJSON,\n\twriteJSONSync as _writeJSONSync,\n\tWriteOptions,\n} from 'fs-extra';\nimport { stringify } from 'jsonfile/utils';\nimport { JFWriteOptions } from 'jsonfile';\n\ndeclare module 'fs-extra'\n{\n\tinterface WriteOptions extends Exclude<JFWriteOptions, string | null>\n\t{\n\t\tfinalEOL?: boolean\n\t}\n}\n\nexport type IWriteOptions = WriteOptions & Exclude<JFWriteOptions, string | null>;\n\nexport function _handleWriteOptions(options?: IWriteOptions): IWriteOptions\n{\n\toptions ??= {};\n\toptions.finalEOL ??= true;\n\treturn options\n}\n\nexport {\n\treadJSON,\n\treadJSONSync,\n}\n\nexport function outputJSON(file: string, data: any, options?: IWriteOptions)\n{\n\toptions = _handleWriteOptions(options);\n\treturn _outputJSON(file, data, options)\n}\n\nexport function outputJSONSync(file: string, data: any, options?: IWriteOptions)\n{\n\toptions = _handleWriteOptions(options);\n\treturn _outputJSONSync(file, data, options)\n}\n\nexport function writeJSON(file: string, data: any, options?: IWriteOptions)\n{\n\toptions = _handleWriteOptions(options);\n\treturn _writeJSON(file, data, options)\n}\n\nexport function writeJSONSync(file: string, data: any, options?: IWriteOptions)\n{\n\toptions = _handleWriteOptions(options);\n\treturn _writeJSONSync(file, data, options)\n}\n\nexport function stringifyJSON(data: any, options?: IWriteOptions): string\n{\n\toptions = _handleWriteOptions(options);\n\treturn stringify(data, options as any)\n}\n\nexport function parseJSON(stringOrUint8Array: string | Uint8Array,\n\treviver?: (this: any, key: string, value: any) => any,\n): string\n{\n\treturn JSON.parse(stringOrUint8Array.toString(), reviver)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluelovers/fs-json",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "stringify with final EOL",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create-by-yarn-tool"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@types/jsonfile": "^6",
|
|
50
|
-
"fs-extra": "^
|
|
50
|
+
"fs-extra": "^11.2.0",
|
|
51
51
|
"jsonfile": "^6.1.0",
|
|
52
52
|
"tslib": "^2"
|
|
53
53
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "43bcf89adcf481e321b509f7510de10206e8030a"
|
|
59
59
|
}
|