mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-06-10 21:01:41 +00:00
update
This commit is contained in:
21
node_modules/toidentifier/LICENSE
generated
vendored
Normal file
21
node_modules/toidentifier/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
61
node_modules/toidentifier/README.md
generated
vendored
Normal file
61
node_modules/toidentifier/README.md
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# toidentifier
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][codecov-image]][codecov-url]
|
||||
|
||||
> Convert a string of words to a JavaScript identifier
|
||||
|
||||
## Install
|
||||
|
||||
This is a [Node.js](https://nodejs.org/en/) module available through the
|
||||
[npm registry](https://www.npmjs.com/). Installation is done using the
|
||||
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
||||
|
||||
```bash
|
||||
$ npm install toidentifier
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var toIdentifier = require('toidentifier')
|
||||
|
||||
console.log(toIdentifier('Bad Request'))
|
||||
// => "BadRequest"
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This CommonJS module exports a single default function: `toIdentifier`.
|
||||
|
||||
### toIdentifier(string)
|
||||
|
||||
Given a string as the argument, it will be transformed according to
|
||||
the following rules and the new string will be returned:
|
||||
|
||||
1. Split into words separated by space characters (`0x20`).
|
||||
2. Upper case the first character of each word.
|
||||
3. Join the words together with no separator.
|
||||
4. Remove all non-word (`[0-9a-z_]`) characters.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg
|
||||
[codecov-url]: https://codecov.io/gh/component/toidentifier
|
||||
[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg
|
||||
[downloads-url]: https://npmjs.org/package/toidentifier
|
||||
[npm-image]: https://img.shields.io/npm/v/toidentifier.svg
|
||||
[npm-url]: https://npmjs.org/package/toidentifier
|
||||
[travis-image]: https://img.shields.io/travis/component/toidentifier/master.svg
|
||||
[travis-url]: https://travis-ci.org/component/toidentifier
|
||||
|
||||
|
||||
##
|
||||
|
||||
[npm]: https://www.npmjs.com/
|
||||
|
||||
[yarn]: https://yarnpkg.com/
|
30
node_modules/toidentifier/index.js
generated
vendored
Normal file
30
node_modules/toidentifier/index.js
generated
vendored
Normal file
@ -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, '')
|
||||
}
|
79
node_modules/toidentifier/package.json
generated
vendored
Normal file
79
node_modules/toidentifier/package.json
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"toidentifier@1.0.0",
|
||||
"/Users/tatiana/selfdefined"
|
||||
]
|
||||
],
|
||||
"_from": "toidentifier@1.0.0",
|
||||
"_id": "toidentifier@1.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==",
|
||||
"_location": "/toidentifier",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "toidentifier@1.0.0",
|
||||
"name": "toidentifier",
|
||||
"escapedName": "toidentifier",
|
||||
"rawSpec": "1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/http-errors"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
|
||||
"_spec": "1.0.0",
|
||||
"_where": "/Users/tatiana/selfdefined",
|
||||
"author": {
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/component/toidentifier/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Douglas Christopher Wilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "Nick Baugh",
|
||||
"email": "niftylettuce@gmail.com",
|
||||
"url": "http://niftylettuce.com/"
|
||||
}
|
||||
],
|
||||
"description": "Convert a string of words to a JavaScript identifier",
|
||||
"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"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/component/toidentifier#readme",
|
||||
"license": "MIT",
|
||||
"name": "toidentifier",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/component/toidentifier.git"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
Reference in New Issue
Block a user