@agnostack/next-shopify
Version:
Please contact agnoStack via info@agnostack.com for any questions
23 lines • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAssetKey = exports.getAssetTemplate = exports.THEME_ASSET_KEY_DEFAULT = void 0;
const display_1 = require("./display");
exports.THEME_ASSET_KEY_DEFAULT = 'config/settings_data.json';
const ASSET_TEMPLATE_DEFAULT = 'apps';
const ASSET_TEMPLATE = {
[exports.THEME_ASSET_KEY_DEFAULT]: ASSET_TEMPLATE_DEFAULT,
};
const ASSET_KEY = {
[ASSET_TEMPLATE_DEFAULT]: exports.THEME_ASSET_KEY_DEFAULT,
};
const getAssetTemplate = (assetKey) => {
var _a;
return ((_a = ASSET_TEMPLATE[assetKey]) !== null && _a !== void 0 ? _a : (0, display_1.ensureArray)((0, display_1.ensureString)(assetKey).match(/^templates\/(.+)\.json$/))[1]);
};
exports.getAssetTemplate = getAssetTemplate;
const getAssetKey = (assetTemplate) => {
var _a;
return ((_a = ASSET_KEY[assetTemplate]) !== null && _a !== void 0 ? _a : `templates/${assetTemplate}.json`);
};
exports.getAssetKey = getAssetKey;
//# sourceMappingURL=theme.js.map