mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-19 00:53:48 -05:00
chore(package): re-init package with commitizen and standard-release
This commit is contained in:
28
node_modules/right-pad/rightpad.js
generated
vendored
Normal file
28
node_modules/right-pad/rightpad.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
// Coding standard for this project defined @ https://github.com/MatthewSH/standards/blob/master/JavaScript.md
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = function rightPad (_string, _length, _char) {
|
||||
if (typeof _string !== 'string') {
|
||||
throw new Error('The string parameter must be a string.');
|
||||
}
|
||||
if (_string.length < 1) {
|
||||
throw new Error('The string parameter must be 1 character or longer.');
|
||||
}
|
||||
if (typeof _length !== 'number') {
|
||||
throw new Error('The length parameter must be a number.');
|
||||
}
|
||||
if(typeof _char !== 'string' && _char) {
|
||||
throw new Error('The character parameter must be a string.');
|
||||
}
|
||||
|
||||
var i = -1;
|
||||
_length = _length - _string.length;
|
||||
if (!_char && _char !== 0) {
|
||||
_char = ' ';
|
||||
}
|
||||
while (++i < _length) {
|
||||
_string += _char;
|
||||
}
|
||||
|
||||
return _string;
|
||||
}
|
||||
Reference in New Issue
Block a user