UNPKG

kod-temp

Version:

Workano Communications SDK

13 lines (12 loc) 423 B
export const camelToUnderscore = (key) => { if (typeof key !== 'string') { throw new Error('Input is not a string'); } return key.charAt(0).toLowerCase() + key.substring(1).replace(/([A-Z])/g, '_$1').toLowerCase(); }; export const obfuscateToken = (token) => { if (!token) { return token; } return token.split('-').map((part, index) => (index === 0 ? part : 'xxxxxx')).join('-'); };