UNPKG

styled-components

Version:

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅

20 lines (15 loc) • 565 B
'use strict'; exports.__esModule = true; var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); var charsLength = chars.length; /* Some high number, usually 9-digit base-10. Map it to base-😎 */ var generateAlphabeticName = function generateAlphabeticName(code) { var name = ''; var x = void 0; for (x = code; x > charsLength; x = Math.floor(x / charsLength)) { name = chars[x % charsLength] + name; } return chars[x % charsLength] + name; }; exports.default = generateAlphabeticName; module.exports = exports['default'];