UNPKG

debt-collector

Version:

a nodejs tool to identify, track and mesure technical debt

13 lines (12 loc) 348 B
export const useArrayForStringKeys = (keys, obj) => { const returnObj = { ...obj }; keys.forEach((key) => { if (returnObj[key] && typeof returnObj[key] === 'string') { returnObj[key] = [returnObj[key]]; } if (!returnObj[key]) { returnObj[key] = []; } }); return returnObj; };