summaryrefslogtreecommitdiff
path: root/std/node/tests/node_modules/left-pad/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'std/node/tests/node_modules/left-pad/index.js')
-rw-r--r--std/node/tests/node_modules/left-pad/index.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/std/node/tests/node_modules/left-pad/index.js b/std/node/tests/node_modules/left-pad/index.js
index e90aec35d..8501bca1b 100644
--- a/std/node/tests/node_modules/left-pad/index.js
+++ b/std/node/tests/node_modules/left-pad/index.js
@@ -3,37 +3,37 @@
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details. */
-'use strict';
+"use strict";
module.exports = leftPad;
var cache = [
- '',
- ' ',
- ' ',
- ' ',
- ' ',
- ' ',
- ' ',
- ' ',
- ' ',
- ' '
+ "",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
];
-function leftPad (str, len, ch) {
+function leftPad(str, len, ch) {
// convert `str` to a `string`
- str = str + '';
+ str = str + "";
// `len` is the `pad`'s length now
len = len - str.length;
// doesn't need to pad
if (len <= 0) return str;
// `ch` defaults to `' '`
- if (!ch && ch !== 0) ch = ' ';
+ if (!ch && ch !== 0) ch = " ";
// convert `ch` to a `string` cuz it could be a number
- ch = ch + '';
+ ch = ch + "";
// cache common use cases
- if (ch === ' ' && len < 10) return cache[len] + str;
+ if (ch === " " && len < 10) return cache[len] + str;
// `pad` starts with an empty string
- var pad = '';
+ var pad = "";
// loop
while (true) {
// add `ch` to `pad` if `len` is odd