diff options
Diffstat (limited to 'node_modules/trim-right')
-rw-r--r-- | node_modules/trim-right/index.js | 10 | ||||
-rw-r--r-- | node_modules/trim-right/license | 21 | ||||
-rw-r--r-- | node_modules/trim-right/package.json | 37 | ||||
-rw-r--r-- | node_modules/trim-right/readme.md | 30 |
4 files changed, 98 insertions, 0 deletions
diff --git a/node_modules/trim-right/index.js b/node_modules/trim-right/index.js new file mode 100644 index 000000000..666f4b2f4 --- /dev/null +++ b/node_modules/trim-right/index.js @@ -0,0 +1,10 @@ +'use strict'; +module.exports = function (str) { + var tail = str.length; + + while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { + tail--; + } + + return str.slice(0, tail); +}; diff --git a/node_modules/trim-right/license b/node_modules/trim-right/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/trim-right/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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. diff --git a/node_modules/trim-right/package.json b/node_modules/trim-right/package.json new file mode 100644 index 000000000..979bfa915 --- /dev/null +++ b/node_modules/trim-right/package.json @@ -0,0 +1,37 @@ +{ + "name": "trim-right", + "version": "1.0.1", + "description": "Similar to String#trim() but removes only whitespace on the right", + "license": "MIT", + "repository": "sindresorhus/trim-right", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "trim", + "right", + "string", + "str", + "util", + "utils", + "utility", + "whitespace", + "space", + "remove", + "delete" + ], + "devDependencies": { + "ava": "0.0.4" + } +} diff --git a/node_modules/trim-right/readme.md b/node_modules/trim-right/readme.md new file mode 100644 index 000000000..0a4438acd --- /dev/null +++ b/node_modules/trim-right/readme.md @@ -0,0 +1,30 @@ +# trim-right [](https://travis-ci.org/sindresorhus/trim-right) + +> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only whitespace on the right + + +## Install + +``` +$ npm install --save trim-right +``` + + +## Usage + +```js +var trimRight = require('trim-right'); + +trimRight(' unicorn '); +//=> ' unicorn' +``` + + +## Related + +- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |