Beta 7 with some repo names changed.
This commit is contained in:
1 parent
0f7b40cca7
commit
963c19493a
3408 files changed
+462217
-15516
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
/*!
|
||||
* 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, '')
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "toidentifier",
|
||||
"description": "Convert a string of words to a JavaScript identifier",
|
||||
"version": "1.0.0",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"contributors": [
|
||||
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
|
||||
],
|
||||
"repository": "component/toidentifier",
|
||||
"devDependencies": {
|
||||
"eslint": "4.19.1",
|
||||
"eslint-config-standard": "11.0.0",
|
||||
"eslint-plugin-import": "2.11.0",
|
||||
"eslint-plugin-markdown": "1.0.0-beta.6",
|
||||
"eslint-plugin-node": "6.0.1",
|
||||
"eslint-plugin-promise": "3.7.0",
|
||||
"eslint-plugin-standard": "3.1.0",
|
||||
"mocha": "1.21.5",
|
||||
"nyc": "11.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md .",
|
||||
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||||
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz"
|
||||
,"_integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
||||
,"_from": "toidentifier@1.0.0"
|
||||
}
|
||||
Reference in new issue
Block a user