UNPKG

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