Sha256: 6df7c8b218f33abc33563a33de06b4bbb1a43a6232b4c31cb01c55c38ed1cba8
Contents?: true
Size: 490 Bytes
Versions: 29
Compression:
Stored size: 490 Bytes
Contents
/*! * toidentifier * Copyright(c) 2016 Douglas Christopher Wilson * MIT Licensed */ /** * Module exports. * @public */ module.exports = toIdentifier /** * Trasform the given string into a JavaScript identifier * * @param {string} str * @returns {string} * @public */ function toIdentifier (str) { return str .split(' ') .map(function (token) { return token.slice(0, 1).toUpperCase() + token.slice(1) }) .join('') .replace(/[^ _0-9a-z]/gi, '') }
Version data entries
29 entries across 28 versions & 9 rubygems