1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var Error_1 = require("@shopify/app-bridge/actions/Error");
|
4 | function isValidConfig(appConfig, config) {
|
5 | if (!appConfig) {
|
6 | return false;
|
7 | }
|
8 | var apiKey = appConfig.apiKey;
|
9 | if (!apiKey || apiKey !== config.apiKey) {
|
10 | return false;
|
11 | }
|
12 | return true;
|
13 | }
|
14 | exports.isValidConfig = isValidConfig;
|
15 | function throwInvalidConfigError(appConfig, config, action) {
|
16 | Error_1.throwError(Error_1.AppActionType.INVALID_CONFIG, action, "Provided apiKey `" + appConfig.apiKey + "` is incorrect. Expecting `" + config.apiKey + "`");
|
17 | }
|
18 | exports.throwInvalidConfigError = throwInvalidConfigError;
|