input-from-file-json 0.2.0 → 0.4.1
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/README.md +5 -5
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/index.test.d.ts +1 -0
- package/lib/index.test.d.ts.map +1 -0
- package/lib/index.test.js +1 -1
- package/lib/index.test.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<h1 align="center">input-from-file-json</h1>
|
|
2
2
|
|
|
3
|
-
<p align="center"
|
|
3
|
+
<p align="center">Bingo input that reads a file as JSON.</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://github.com/JoshuaKGoldberg/
|
|
7
|
-
<a href="https://github.com/JoshuaKGoldberg/
|
|
6
|
+
<a href="https://github.com/JoshuaKGoldberg/bingo/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="🤝 Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a>
|
|
7
|
+
<a href="https://github.com/JoshuaKGoldberg/bingo/blob/main/LICENSE.md" target="_blank"><img alt="📝 License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg"></a>
|
|
8
8
|
<a href="http://npmjs.com/package/input-from-file-json"><img alt="📦 npm version" src="https://img.shields.io/npm/v/input-from-file-json?color=21bb42&label=%F0%9F%93%A6%20npm" /></a>
|
|
9
9
|
<img alt="💪 TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" />
|
|
10
10
|
</p>
|
|
@@ -25,7 +25,7 @@ await take(inputFromFileJSON, { filePath: "data.json" });
|
|
|
25
25
|
|
|
26
26
|
It reads the `filePath` from disk and returns either:
|
|
27
27
|
|
|
28
|
-
- `Error
|
|
28
|
+
- [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error): If an error was caught reading or parsing the file
|
|
29
29
|
- `unknown`: The result of running `JSON.parse` on the file's text contents
|
|
30
30
|
|
|
31
|
-
See **[create.bingo >
|
|
31
|
+
See **[create.bingo > Templates > Concepts > Inputs](https://create.bingo/build/concepts/inputs)** for more documentation on Inputs.
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const inputFromFileJSON: import("
|
|
2
|
-
filePath:
|
|
1
|
+
export declare const inputFromFileJSON: import("bingo").InputWithArgs<Promise<unknown>, {
|
|
2
|
+
filePath: import("zod").ZodString;
|
|
3
3
|
}>;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;EAe5B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { createInput } from "
|
|
1
|
+
import { createInput } from "bingo";
|
|
2
2
|
import { inputFromFile } from "input-from-file";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
export const inputFromFileJSON = createInput({
|
|
5
|
-
args:
|
|
6
|
-
filePath: z.string(),
|
|
7
|
-
},
|
|
4
|
+
args: inputFromFile.args,
|
|
8
5
|
async produce({ args, take }) {
|
|
9
6
|
const text = await take(inputFromFile, args);
|
|
10
7
|
if (text instanceof Error) {
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC5C,IAAI,EAAE,aAAa,CAAC,IAAI;IACxB,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;QAC3B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAE7C,IAAI,IAAI,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,IAAI,CAAC;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,KAAoB,CAAC;QAC7B,CAAC;IACF,CAAC;CACD,CAAC,CAAC"}
|
package/lib/index.test.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
package/lib/index.test.js
CHANGED
package/lib/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACvF,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE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4
|
"description": "create input that reads a file as JSON.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/JoshuaKGoldberg/
|
|
7
|
+
"url": "https://github.com/JoshuaKGoldberg/bingo",
|
|
8
8
|
"directory": "packages/input-from-file-json"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"input-from-file": "^0.2.0"
|
|
24
|
+
"input-from-file": "^0.4.1"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"
|
|
27
|
+
"bingo-testers": "^0.4.1"
|
|
29
28
|
},
|
|
30
29
|
"peerDependencies": {
|
|
31
|
-
"
|
|
30
|
+
"zod": "^3.24.2",
|
|
31
|
+
"bingo": "^0.4.1"
|
|
32
32
|
},
|
|
33
33
|
"engines": {
|
|
34
34
|
"node": ">=18"
|