Added some tests
This commit is contained in:
4
tests/node_modules/trim/.npmignore
generated
vendored
Normal file
4
tests/node_modules/trim/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
*.sock
|
||||
5
tests/node_modules/trim/History.md
generated
vendored
Normal file
5
tests/node_modules/trim/History.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
7
tests/node_modules/trim/Makefile
generated
vendored
Normal file
7
tests/node_modules/trim/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--require should \
|
||||
--reporter spec
|
||||
|
||||
.PHONY: test
|
||||
69
tests/node_modules/trim/Readme.md
generated
vendored
Normal file
69
tests/node_modules/trim/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
# trim
|
||||
|
||||
Trims string whitespace.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ npm install trim
|
||||
$ component install component/trim
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- [trim(str)](#trimstr)
|
||||
- [.left(str)](#leftstr)
|
||||
- [.right(str)](#rightstr)
|
||||
<a name="" />
|
||||
|
||||
<a name="trimstr" />
|
||||
### trim(str)
|
||||
should trim leading / trailing whitespace.
|
||||
|
||||
```js
|
||||
trim(' foo bar ').should.equal('foo bar');
|
||||
trim('\n\n\nfoo bar\n\r\n\n').should.equal('foo bar');
|
||||
```
|
||||
|
||||
<a name="leftstr" />
|
||||
### .left(str)
|
||||
should trim leading whitespace.
|
||||
|
||||
```js
|
||||
trim.left(' foo bar ').should.equal('foo bar ');
|
||||
```
|
||||
|
||||
<a name="rightstr" />
|
||||
### .right(str)
|
||||
should trim trailing whitespace.
|
||||
|
||||
```js
|
||||
trim.right(' foo bar ').should.equal(' foo bar');
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
7
tests/node_modules/trim/component.json
generated
vendored
Normal file
7
tests/node_modules/trim/component.json
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "trim",
|
||||
"version": "0.0.1",
|
||||
"description": "Trim string whitespace",
|
||||
"keywords": ["string", "trim"],
|
||||
"scripts": ["index.js"]
|
||||
}
|
||||
14
tests/node_modules/trim/index.js
generated
vendored
Normal file
14
tests/node_modules/trim/index.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
exports = module.exports = trim;
|
||||
|
||||
function trim(str){
|
||||
return str.replace(/^\s*|\s*$/g, '');
|
||||
}
|
||||
|
||||
exports.left = function(str){
|
||||
return str.replace(/^\s*/, '');
|
||||
};
|
||||
|
||||
exports.right = function(str){
|
||||
return str.replace(/\s*$/, '');
|
||||
};
|
||||
49
tests/node_modules/trim/package.json
generated
vendored
Normal file
49
tests/node_modules/trim/package.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"_from": "trim@0.0.1",
|
||||
"_id": "trim@0.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=",
|
||||
"_location": "/trim",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "trim@0.0.1",
|
||||
"name": "trim",
|
||||
"escapedName": "trim",
|
||||
"rawSpec": "0.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/tap-out"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz",
|
||||
"_shasum": "5858547f6b290757ee95cccc666fb50084c460dd",
|
||||
"_spec": "trim@0.0.1",
|
||||
"_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/tap-out",
|
||||
"author": {
|
||||
"name": "TJ Holowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"component": {
|
||||
"scripts": {
|
||||
"trim/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Trim string whitespace",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"string",
|
||||
"trim"
|
||||
],
|
||||
"main": "index",
|
||||
"name": "trim",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
Reference in New Issue
Block a user