fur-resources
Version:
Resources for fur
25 lines (20 loc) • 518 B
JavaScript
/**
* Convert index to theme name.
* @memberof module:fur-resources
* @function _themeName
* @param {number} n - Index to convert.
* @private
*/
;
var CHAR_CODE_START = 97,
CHAR_CODE_RANGE = 26;
/** @lends _themeName */
function _themeName(n) {
var result = '';
if (n >= CHAR_CODE_RANGE) {
result = _themeName(parseInt(n / CHAR_CODE_RANGE) - 1);
}
result += String.fromCharCode(CHAR_CODE_START + n % CHAR_CODE_RANGE);
return result;
}
module.exports = _themeName;