@taqueria/protocol 0.0.0-pr-659-ec26fd9f → 0.0.0-pr-659-420a2bbd
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/Config.ts +13 -0
- package/package.json +1 -1
package/Config.ts
CHANGED
|
@@ -165,4 +165,17 @@ export const make = (data: Input) => {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
export const of = (data: RawInput | Record<string, unknown>) => {
|
|
169
|
+
try {
|
|
170
|
+
const retval = schema.parse(data)
|
|
171
|
+
return resolve(retval)
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
if (err instanceof ZodError) {
|
|
175
|
+
return toParseErr<Config>(err, `The provided config is invalid.`, data)
|
|
176
|
+
}
|
|
177
|
+
return toParseUnknownErr<Config>(err, 'There was a problem trying to parse the Taqueria configuration', data)
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
168
181
|
export const create = (data: RawInput | Record<string, unknown>) => schema.parse(data)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taqueria/protocol",
|
|
3
|
-
"version": "0.0.0-pr-659-
|
|
3
|
+
"version": "0.0.0-pr-659-420a2bbd",
|
|
4
4
|
"description": "A TypeScript package which contains types that are to be shared between @taqueria/node-sdk and @taqueria/taqueria.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|