UNPKG

703 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.appBridgeMiddlewareProptype = void 0;
4var Error_1 = require("@shopify/app-bridge/actions/Error");
5function appBridgeMiddlewareProptype(object, key, componentName /* , ...rest: any[]*/) {
6 var propValue = object[key];
7 if (!propValue ||
8 !propValue.load ||
9 (propValue.load && !(typeof propValue.load === 'function'))) {
10 return Error_1.fromAction("Expected an instance of the App Bridge middleware for `" + key + "` in `" + componentName + "`", Error_1.AppActionType.MISSING_APP_BRIDGE_MIDDLEWARE);
11 }
12 return null;
13}
14exports.appBridgeMiddlewareProptype = appBridgeMiddlewareProptype;