initial commit
This commit is contained in:
21
node_modules/sentence-case/LICENSE
generated
vendored
Normal file
21
node_modules/sentence-case/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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.
|
||||
49
node_modules/sentence-case/README.md
generated
vendored
Normal file
49
node_modules/sentence-case/README.md
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# Sentence Case
|
||||
|
||||
[![NPM version][npm-image]][npm-url]
|
||||
[![NPM downloads][downloads-image]][downloads-url]
|
||||
[![Build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Transform a string to lower space cased. Optional locale and replacement character supported.
|
||||
|
||||
Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a `toString` property, numbers and booleans. Empty values (`null` and `undefined`) will result in an empty string.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install sentence-case --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var sentenceCase = require('sentence-case')
|
||||
|
||||
sentenceCase(null) //=> ""
|
||||
sentenceCase('string') //=> "string"
|
||||
sentenceCase('dot.case') //=> "dot case"
|
||||
sentenceCase('camelCase') //=> "camel case"
|
||||
sentenceCase('Beyoncé Knowles') //=> "beyoncé knowles"
|
||||
|
||||
sentenceCase('A STRING', 'tr') //=> "a strıng"
|
||||
|
||||
sentenceCase('HELLO WORLD!', null, '_') //=> "hello_world"
|
||||
```
|
||||
|
||||
## Typings
|
||||
|
||||
Includes a [TypeScript definition](sentence-case.d.ts).
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/sentence-case.svg?style=flat
|
||||
[npm-url]: https://npmjs.org/package/sentence-case
|
||||
[downloads-image]: https://img.shields.io/npm/dm/sentence-case.svg?style=flat
|
||||
[downloads-url]: https://npmjs.org/package/sentence-case
|
||||
[travis-image]: https://img.shields.io/travis/blakeembrey/sentence-case.svg?style=flat
|
||||
[travis-url]: https://travis-ci.org/blakeembrey/sentence-case
|
||||
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/sentence-case.svg?style=flat
|
||||
[coveralls-url]: https://coveralls.io/r/blakeembrey/sentence-case?branch=master
|
||||
60
node_modules/sentence-case/package.json
generated
vendored
Normal file
60
node_modules/sentence-case/package.json
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "sentence-case",
|
||||
"version": "1.1.3",
|
||||
"description": "Sentence case a string",
|
||||
"main": "sentence-case.js",
|
||||
"typings": "sentence-case.d.ts",
|
||||
"files": [
|
||||
"sentence-case.js",
|
||||
"sentence-case.d.ts",
|
||||
"vendor",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"mocha": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
|
||||
"test": "npm run build && npm run lint && npm run mocha",
|
||||
"build": "node build.js",
|
||||
"stage-vendor": "git add vendor"
|
||||
},
|
||||
"standard": {
|
||||
"ignore": [
|
||||
"coverage/**"
|
||||
]
|
||||
},
|
||||
"pre-commit": [
|
||||
"build",
|
||||
"stage-vendor",
|
||||
"test"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/blakeembrey/sentence-case.git"
|
||||
},
|
||||
"keywords": [
|
||||
"sentence",
|
||||
"case",
|
||||
"space"
|
||||
],
|
||||
"author": {
|
||||
"name": "Blake Embrey",
|
||||
"email": "hello@blakeembrey.com",
|
||||
"url": "http://blakeembrey.me"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/blakeembrey/sentence-case/issues"
|
||||
},
|
||||
"homepage": "https://github.com/blakeembrey/sentence-case",
|
||||
"devDependencies": {
|
||||
"chai": "^1.9.1",
|
||||
"istanbul": "^0.3.5",
|
||||
"mocha": "^2.1.0",
|
||||
"pre-commit": "^1.0.1",
|
||||
"standard": "^2.3.1",
|
||||
"xregexp": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lower-case": "^1.1.1"
|
||||
}
|
||||
}
|
||||
3
node_modules/sentence-case/sentence-case.d.ts
generated
vendored
Normal file
3
node_modules/sentence-case/sentence-case.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
declare function sentenceCase (value: string, locale?: string, replacement?: string): string;
|
||||
|
||||
export = sentenceCase;
|
||||
40
node_modules/sentence-case/sentence-case.js
generated
vendored
Normal file
40
node_modules/sentence-case/sentence-case.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
var lowerCase = require('lower-case')
|
||||
|
||||
var NON_WORD_REGEXP = require('./vendor/non-word-regexp')
|
||||
var CAMEL_CASE_REGEXP = require('./vendor/camel-case-regexp')
|
||||
var TRAILING_DIGIT_REGEXP = require('./vendor/trailing-digit-regexp')
|
||||
|
||||
/**
|
||||
* Sentence case a string.
|
||||
*
|
||||
* @param {String} str
|
||||
* @param {String} locale
|
||||
* @param {String} replacement
|
||||
* @return {String}
|
||||
*/
|
||||
module.exports = function (str, locale, replacement) {
|
||||
if (str == null) {
|
||||
return ''
|
||||
}
|
||||
|
||||
replacement = replacement || ' '
|
||||
|
||||
function replace (match, index, string) {
|
||||
if (index === 0 || index === (string.length - match.length)) {
|
||||
return ''
|
||||
}
|
||||
|
||||
return replacement
|
||||
}
|
||||
|
||||
str = String(str)
|
||||
// Support camel case ("camelCase" -> "camel Case").
|
||||
.replace(CAMEL_CASE_REGEXP, '$1 $2')
|
||||
// Support digit groups ("test2012" -> "test 2012").
|
||||
.replace(TRAILING_DIGIT_REGEXP, '$1 $2')
|
||||
// Remove all non-word characters and replace with a single space.
|
||||
.replace(NON_WORD_REGEXP, replace)
|
||||
|
||||
// Lower case the entire string.
|
||||
return lowerCase(str, locale)
|
||||
}
|
||||
1
node_modules/sentence-case/vendor/camel-case-regexp.js
generated
vendored
Normal file
1
node_modules/sentence-case/vendor/camel-case-regexp.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/sentence-case/vendor/non-word-regexp.js
generated
vendored
Normal file
1
node_modules/sentence-case/vendor/non-word-regexp.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/sentence-case/vendor/trailing-digit-regexp.js
generated
vendored
Normal file
1
node_modules/sentence-case/vendor/trailing-digit-regexp.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = /([\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])([^\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19])/g
|
||||
Reference in New Issue
Block a user