@shopify/shopify_function 1.0.2 → 1.0.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/package.json +1 -1
- package/run.ts +3 -0
package/package.json
CHANGED
package/run.ts
CHANGED
|
@@ -14,6 +14,9 @@ declare global {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export default function <I extends {}, O extends {}>(userfunction: ShopifyFunction<I, O>) {
|
|
17
|
+
if (!Javy.JSON) {
|
|
18
|
+
throw new Error('Javy.JSON is not defined. Please rebuild your function using the latest version of Shopify CLI.');
|
|
19
|
+
}
|
|
17
20
|
const input_obj = Javy.JSON.fromStdin();
|
|
18
21
|
const output_obj = userfunction(input_obj);
|
|
19
22
|
Javy.JSON.toStdout(output_obj)
|