@kadena/kadena-cli
Version:
Kadena CLI tool to interact with the Kadena blockchain (manage keys, transactions, etc.)
16 lines • 646 B
JavaScript
export const maskSensitiveInfo = (obj, fieldsToMask = ['password', 'passwordFile', 'newPasswordFile'], mask = '******') => {
if (typeof obj !== 'object' || obj === null)
return obj;
if (Array.isArray(obj)) {
return obj.map((item) => maskSensitiveInfo(item, fieldsToMask));
}
return Object.entries(obj).reduce((acc, [key, value]) => {
acc[key] = fieldsToMask.includes(key)
? mask
: typeof value === 'object' && value !== null
? maskSensitiveInfo(value, fieldsToMask)
: value;
return acc;
}, {});
};
//# sourceMappingURL=logger-utils.js.map