forked from enviPath/enviPy
Current Dev State
This commit is contained in:
28
static/js/ketcher2/node_modules/pad-left/index.js
generated
vendored
Executable file
28
static/js/ketcher2/node_modules/pad-left/index.js
generated
vendored
Executable file
@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* pad-left <https://github.com/jonschlinkert/pad-left>
|
||||
*
|
||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var repeat = require('repeat-string');
|
||||
|
||||
module.exports = function padLeft(str, num, ch) {
|
||||
str = str.toString();
|
||||
|
||||
if (typeof num === 'undefined') {
|
||||
return str;
|
||||
}
|
||||
|
||||
if (ch === 0) {
|
||||
ch = '0';
|
||||
} else if (ch) {
|
||||
ch = ch.toString();
|
||||
} else {
|
||||
ch = ' ';
|
||||
}
|
||||
|
||||
return repeat(ch, num - str.length) + str;
|
||||
};
|
||||
Reference in New Issue
Block a user