UNPKG

@vtex/payment-provider-sdk

Version:
15 lines (14 loc) 700 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renameKeys = exports.useHTTP = exports.withMiddlwares = void 0; const ramda_1 = require("ramda"); const withMiddlwares = (middlewares, options) => { var _a; return ({ ...options, middlewares: [...((_a = options === null || options === void 0 ? void 0 : options.middlewares) !== null && _a !== void 0 ? _a : []), ...middlewares], }); }; exports.withMiddlwares = withMiddlwares; exports.useHTTP = ramda_1.replace('https', 'http'); exports.renameKeys = ramda_1.curry((keysMap, obj) => ramda_1.reduce((acc, key) => ramda_1.assoc(keysMap[key] || key, obj[key], acc), {}, ramda_1.keys(obj)));