Last active
March 24, 2016 19:12
-
-
Save erikjung/d2e6dc2c33c61b0ccfde to your computer and use it in GitHub Desktop.
Revisions
-
erikjung revised this gist
Mar 24, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ module.exports = function leftpad (str, len, ch) { const val = String(str); const pad = ch === undefined ? ' ' : String(ch); return pad.repeat(Math.max(0, len - val.length), pad) + val; }; -
erikjung revised this gist
Mar 24, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ module.exports = function leftpad (str, len, ch) { const val = `${str}`; const pad = ch === undefined ? ' ' : `${ch}`; return pad.repeat(Math.max(0, len - val.length), pad) + val; }; -
erikjung revised this gist
Mar 24, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ module.exports = function leftpad (str, len, ch) { const val = `${str}`; const pad = `${ch}`; return pad.repeat(Math.max(0, len - val.length), pad) + val; -
erikjung revised this gist
Mar 24, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ module.exports = function leftpad (str, len, ch = ' ') { const val = `${str}`; const pad = `${ch}`; return pad.repeat(Math.max(0, len - val.length), pad) + val; }; -
erikjung revised this gist
Mar 24, 2016 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ module.exports = function leftpad (str, len, ch = ' ') { const val = `${str}` const pad = `${ch}` return pad.repeat(Math.max(0, len - val.length), pad) + val; }; -
erikjung revised this gist
Mar 24, 2016 . 2 changed files with 1 addition and 1 deletion.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ { "name": "left-pad", "main": "left-pad.js", "version": "0.0.1" } -
erikjung revised this gist
Mar 24, 2016 . 3 changed files with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ module.exports = function (str, len, ch) { return ch.repeat(len) + str; }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ { "name": "left-pad", "main": "index.css", "version": "0.0.1" } -
erikjung created this gist
Mar 24, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ module.exports = function leftpad (str, len, ch) { return ch.repeat(len) + str; };