init
This commit is contained in:
21
node_modules/pad-right/LICENSE
generated
vendored
Normal file
21
node_modules/pad-right/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Jon Schlinkert
|
||||
|
||||
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.
|
71
node_modules/pad-right/README.md
generated
vendored
Normal file
71
node_modules/pad-right/README.md
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
# pad-right [](http://badge.fury.io/js/pad-right)
|
||||
|
||||
> Right pad a string with zeros or a specified string. Fastest implementation.
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i pad-right --save
|
||||
```
|
||||
|
||||
## Run tests
|
||||
|
||||
```bash
|
||||
npm test
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var pad = require('pad-right');
|
||||
pad('abc', 5)
|
||||
// 'abc00'
|
||||
pad('abc', 10)
|
||||
// 'abc0000000'
|
||||
pad('abc', 10, '~')
|
||||
// 'abc~~~~~~~'
|
||||
pad('abc', 10, ' ')
|
||||
// 'abc '
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string.
|
||||
* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
|
||||
* [justified](https://github.com/jonschlinkert/justified): Wrap words to a specified length and justified the text.
|
||||
* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation.
|
||||
* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
|
||||
* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
|
||||
* [right-align-keys](https://github.com/jonschlinkert/right-align-keys): Right align the keys of an object.
|
||||
* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-align-values)
|
||||
* [right-pad-keys](https://github.com/jonschlinkert/right-pad-keys): Right pad the keys of an object.
|
||||
* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful… [more](https://github.com/jonschlinkert/right-pad-values)
|
||||
* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/pad-right/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2014-2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 15, 2015._
|
20
node_modules/pad-right/index.js
generated
vendored
Normal file
20
node_modules/pad-right/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict';
|
||||
|
||||
var repeat = require('repeat-string');
|
||||
|
||||
module.exports = function padLeft(val, num, str) {
|
||||
var padding = '';
|
||||
var diff = num - val.length;
|
||||
|
||||
// Breakpoints based on benchmarks to use the fastest approach
|
||||
// for the given number of zeros
|
||||
if (diff <= 5 && !str) {
|
||||
padding = '00000';
|
||||
} else if (diff <= 25 && !str) {
|
||||
padding = '000000000000000000000000000';
|
||||
} else {
|
||||
return val + repeat(str || '0', diff);
|
||||
}
|
||||
|
||||
return val + padding.slice(0, diff);
|
||||
};
|
64
node_modules/pad-right/package.json
generated
vendored
Normal file
64
node_modules/pad-right/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "pad-right",
|
||||
"description": "Right pad a string with zeros or a specified string. Fastest implementation.",
|
||||
"version": "0.2.2",
|
||||
"homepage": "https://github.com/jonschlinkert/pad-right",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/pad-right",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/pad-right/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"repeat-string": "^1.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"align",
|
||||
"alignment",
|
||||
"fill",
|
||||
"left",
|
||||
"pad",
|
||||
"pad-left",
|
||||
"pad-right",
|
||||
"padded",
|
||||
"padding",
|
||||
"right",
|
||||
"right-pad",
|
||||
"spaces",
|
||||
"string",
|
||||
"zero",
|
||||
"zero-fill",
|
||||
"zeros"
|
||||
],
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"align-text",
|
||||
"center-align",
|
||||
"justified",
|
||||
"pad-left",
|
||||
"repeat-string",
|
||||
"right-align",
|
||||
"right-align-keys",
|
||||
"right-align-values",
|
||||
"right-pad-keys",
|
||||
"right-pad-values",
|
||||
"word-wrap"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user