AK-21/Graphite-Industrial-Intelligence
0
1/*!2 * toidentifier3 * Copyright(c) 2016 Douglas Christopher Wilson4 * MIT Licensed5 */6 7'use strict'8 9/**10 * Module exports.11 * @public12 */13 14module.exports = toIdentifier15 16/**17 * Trasform the given string into a JavaScript identifier18 *19 * @param {string} str20 * @returns {string}21 * @public22 */23 24function toIdentifier (str) {25 return str26 .split(' ')27 .map(function (token) {28 return token.slice(0, 1).toUpperCase() + token.slice(1)29 })30 .join('')31 .replace(/[^ _0-9a-z]/gi, '')32}33 