@stdlib/fs-read-json 0.2.2 → 0.2.3
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/NOTICE +1 -1
- package/README.md +5 -5
- package/docs/types/index.d.ts +5 -5
- package/package.json +3 -3
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2026 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -206,7 +206,7 @@ See [LICENSE][stdlib-license].
|
|
|
206
206
|
|
|
207
207
|
## Copyright
|
|
208
208
|
|
|
209
|
-
Copyright © 2016-
|
|
209
|
+
Copyright © 2016-2026. The Stdlib [Authors][stdlib-authors].
|
|
210
210
|
|
|
211
211
|
</section>
|
|
212
212
|
|
|
@@ -219,8 +219,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
219
219
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/fs-read-json.svg
|
|
220
220
|
[npm-url]: https://npmjs.org/package/@stdlib/fs-read-json
|
|
221
221
|
|
|
222
|
-
[test-image]: https://github.com/stdlib-js/fs-read-json/actions/workflows/test.yml/badge.svg?branch=v0.2.
|
|
223
|
-
[test-url]: https://github.com/stdlib-js/fs-read-json/actions/workflows/test.yml?query=branch:v0.2.
|
|
222
|
+
[test-image]: https://github.com/stdlib-js/fs-read-json/actions/workflows/test.yml/badge.svg?branch=v0.2.3
|
|
223
|
+
[test-url]: https://github.com/stdlib-js/fs-read-json/actions/workflows/test.yml?query=branch:v0.2.3
|
|
224
224
|
|
|
225
225
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/fs-read-json/main.svg
|
|
226
226
|
[coverage-url]: https://codecov.io/github/stdlib-js/fs-read-json?branch=main
|
|
@@ -232,8 +232,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
232
232
|
|
|
233
233
|
-->
|
|
234
234
|
|
|
235
|
-
[chat-image]: https://img.shields.io/
|
|
236
|
-
[chat-url]: https://
|
|
235
|
+
[chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
|
|
236
|
+
[chat-url]: https://stdlib.zulipchat.com
|
|
237
237
|
|
|
238
238
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
239
239
|
|
package/docs/types/index.d.ts
CHANGED
|
@@ -55,9 +55,9 @@ type Reviver = ( key: string, value: any ) => any;
|
|
|
55
55
|
* Callback invoked upon reading a file.
|
|
56
56
|
*
|
|
57
57
|
* @param err - error object
|
|
58
|
-
* @param
|
|
58
|
+
* @param data - file contents
|
|
59
59
|
*/
|
|
60
|
-
type Callback = ( err: Error | null,
|
|
60
|
+
type Callback<T> = ( err: Error | null, data: T ) => void;
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Interface for reading a file as JSON.
|
|
@@ -85,7 +85,7 @@ interface ReadJSON {
|
|
|
85
85
|
* console.dir( data );
|
|
86
86
|
* }
|
|
87
87
|
*/
|
|
88
|
-
( file: string | Buffer | number, options: Options | string, clbk: Callback ): void;
|
|
88
|
+
<T = unknown>( file: string | Buffer | number, options: Options | string, clbk: Callback<T> ): void;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
91
|
* Asynchronously reads a file as JSON.
|
|
@@ -105,7 +105,7 @@ interface ReadJSON {
|
|
|
105
105
|
* console.dir( data );
|
|
106
106
|
* }
|
|
107
107
|
*/
|
|
108
|
-
( file: string | Buffer | number, clbk: Callback ): void;
|
|
108
|
+
<T = unknown>( file: string | Buffer | number, clbk: Callback<T> ): void;
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* Synchronously reads a file as JSON.
|
|
@@ -127,7 +127,7 @@ interface ReadJSON {
|
|
|
127
127
|
* }
|
|
128
128
|
* console.dir( out );
|
|
129
129
|
*/
|
|
130
|
-
sync( file: string | Buffer | number, options?: Options | string ):
|
|
130
|
+
sync<T = unknown>( file: string | Buffer | number, options?: Options | string ): T | Error;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/fs-read-json",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Read a file as JSON.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@stdlib/assert-instance-of": "^0.
|
|
33
|
+
"@stdlib/assert-instance-of": "^0.3.0",
|
|
34
34
|
"@stdlib/assert-is-function": "^0.2.2",
|
|
35
35
|
"@stdlib/assert-is-plain-object": "^0.2.2",
|
|
36
36
|
"@stdlib/assert-is-string": "^0.2.2",
|
|
37
37
|
"@stdlib/fs-read-file": "^0.2.2",
|
|
38
38
|
"@stdlib/string-format": "^0.2.2",
|
|
39
|
-
"@stdlib/string-remove-utf8-bom": "^0.2.
|
|
39
|
+
"@stdlib/string-remove-utf8-bom": "^0.2.2",
|
|
40
40
|
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
|
|
41
41
|
"@stdlib/utils-parse-json": "^0.2.2",
|
|
42
42
|
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
|