Guest User

Untitled

a guest
May 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // Converts snake-case to camelCase
  2. String.prototype.toCamel = function () {
  3. return this.replace(/(-[a-z])/g, $1 => $1.toUpperCase().replace('-', ''));
  4. };
  5.  
  6. // Converts snake-case to camelCase
  7. String.prototype.toCamel = () => this.replace(/(-[a-z])/g, $1 => $1.toUpperCase().replace('-', ''));
  8.  
  9. // Add style to coin
  10. export const setStyle = (id) => {
  11. switch (id) {
  12. case 'basic-attention-token': return style.basicattentiontoken;
  13. case 'bitcoin-cash': return style[id.toCamel()];
  14. case 'deepbrain-chain': return style[id.toCamel()];
  15. case '0x': return style.zrx;
  16. default: return style[id];
  17. }
  18. };
Add Comment
Please, Sign In to add comment