@amritk/generate-parsers 0.6.1 → 0.6.2
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 +43 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -93,11 +93,49 @@ Returns: `Promise<GeneratedFile[]>`.
|
|
|
93
93
|
## Options
|
|
94
94
|
|
|
95
95
|
<!-- config-table-start -->
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
<table>
|
|
97
|
+
<thead>
|
|
98
|
+
<tr>
|
|
99
|
+
<th>Property</th>
|
|
100
|
+
<th>CLI Flag</th>
|
|
101
|
+
<th>Type</th>
|
|
102
|
+
<th align="center">Required</th>
|
|
103
|
+
<th align="center">Default</th>
|
|
104
|
+
</tr>
|
|
105
|
+
</thead>
|
|
106
|
+
<tbody>
|
|
107
|
+
<tr>
|
|
108
|
+
<td>🏷️ <code>typesOnly</code></td>
|
|
109
|
+
<td>—</td>
|
|
110
|
+
<td><code>boolean</code></td>
|
|
111
|
+
<td align="center">—</td>
|
|
112
|
+
<td align="center"><code>false</code></td>
|
|
113
|
+
</tr>
|
|
114
|
+
<tr>
|
|
115
|
+
<td colspan="5">Generate only TypeScript type definitions without parser functions. Runtime helper files (validators, isObject) are also omitted since they are only needed for parsers.</td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td>⚠️ <code>logWarnings</code></td>
|
|
119
|
+
<td>—</td>
|
|
120
|
+
<td><code>boolean</code></td>
|
|
121
|
+
<td align="center">—</td>
|
|
122
|
+
<td align="center"><code>false</code></td>
|
|
123
|
+
</tr>
|
|
124
|
+
<tr>
|
|
125
|
+
<td colspan="5">Emit a console.warn in the generated parsers for every input key that is not declared in the schema's properties. Useful for detecting schema drift or unexpected data shapes at runtime.</td>
|
|
126
|
+
</tr>
|
|
127
|
+
<tr>
|
|
128
|
+
<td>🚫 <code>strict</code></td>
|
|
129
|
+
<td>—</td>
|
|
130
|
+
<td><code>boolean</code></td>
|
|
131
|
+
<td align="center">—</td>
|
|
132
|
+
<td align="center"><code>false</code></td>
|
|
133
|
+
</tr>
|
|
134
|
+
<tr>
|
|
135
|
+
<td colspan="5">Generate parsers that throw on type/shape mismatches (wrong type, missing required property, enum/pattern/min/max violations) instead of coercing invalid input to default values. Unknown extra keys are still allowed.</td>
|
|
136
|
+
</tr>
|
|
137
|
+
</tbody>
|
|
138
|
+
</table>
|
|
101
139
|
<!-- config-table-end -->
|
|
102
140
|
|
|
103
141
|
The generator handles:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amritk/generate-parsers",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Generate TypeScript parsers and type definitions from JSON Schemas.",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"json-schema-typed": "^8.0.1",
|
|
52
52
|
"@amritk/helpers": "0.6.1",
|
|
53
|
-
"@amritk/generate-markdown": "0.2.
|
|
53
|
+
"@amritk/generate-markdown": "0.2.2"
|
|
54
54
|
}
|
|
55
55
|
}
|