UNPKG

@shopify/app-bridge-core

Version:

**[Join our team and work on libraries like this one.](https://www.shopify.ca/careers)**

31 lines (30 loc) 1.47 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Action = exports.linkActionSchema = exports.linkPropsSchema = void 0; exports.validateProps = validateProps; exports.validateAction = validateAction; var AppLink_1 = require("../../actions/Link/AppLink"); Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return AppLink_1.Action; } }); var type_validate_1 = require("../type-validate"); var utils_1 = require("../utils"); var AllowedRedirectType; (function (AllowedRedirectType) { AllowedRedirectType["APP"] = "APP::NAVIGATION::REDIRECT::APP"; AllowedRedirectType["LEGACY_APP"] = "APP"; })(AllowedRedirectType || (AllowedRedirectType = {})); exports.linkPropsSchema = (0, type_validate_1.matchesObject)({ label: (0, type_validate_1.matchesString)(), destination: utils_1.relativeUrlSchema, redirectType: (0, type_validate_1.matchesEnum)(AllowedRedirectType), }); exports.linkActionSchema = (0, type_validate_1.matchesObject)({ label: (0, type_validate_1.matchesString)(), destination: utils_1.relativePathSchema, redirectType: (0, type_validate_1.matchesEnum)(AllowedRedirectType), }); function validateProps(props) { return (0, type_validate_1.validate)(props, exports.linkPropsSchema); } function validateAction(action) { return (0, type_validate_1.validate)(action, (0, utils_1.createActionValidator)(AppLink_1.Action, exports.linkActionSchema, true, true)); }