UNPKG

@janiscommerce/client-creator

Version:

A package that wraps all the client creation in Janis Services

18 lines (16 loc) 416 B
'use strict'; /** * @deprecated * Replaces key with value in the object received * @param {string} key * @param {any} value * @param {object} obj */ module.exports = (key, value, obj) => { return Object.entries(obj).reduce((replacedObject, [objKey, objValue]) => { return { ...replacedObject, [objKey]: typeof objValue === 'string' ? objValue.replace(`{{${key}}}`, value) : objValue }; }, {}); };