smartlog-destination-devtools/.cache/bd/87f877728cdb347b367f564988c795.json

1 line
9.3 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/left-pad/index.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/left-pad/package.json","includedInParent":true,"mtime":1542058764034}],"generated":{"js":"/* This program is free software. It comes without any warranty, to\n * the extent permitted by applicable law. You can redistribute it\n * and/or modify it under the terms of the Do What The Fuck You Want\n * To Public License, Version 2, as published by Sam Hocevar. See\n * http://www.wtfpl.net/ for more details. */\n'use strict';\nmodule.exports = leftPad;\n\nvar cache = [\n '',\n ' ',\n ' ',\n ' ',\n ' ',\n ' ',\n ' ',\n ' ',\n ' ',\n ' '\n];\n\nfunction leftPad (str, len, ch) {\n // convert `str` to a `string`\n str = str + '';\n // `len` is the `pad`'s length now\n len = len - str.length;\n // doesn't need to pad\n if (len <= 0) return str;\n // `ch` defaults to `' '`\n if (!ch && ch !== 0) ch = ' ';\n // convert `ch` to a `string` cuz it could be a number\n ch = ch + '';\n // cache common use cases\n if (ch === ' ' && len < 10) return cache[len] + str;\n // `pad` starts with an empty string\n var pad = '';\n // loop\n while (true) {\n // add `ch` to `pad` if `len` is odd\n if (len & 1) pad += ch;\n // divide `len` by 2, ditch the remainder\n len >>= 1;\n // \"double\" the `ch` so this operation count grows logarithmically on `len`\n // each time `ch` is \"doubled\", the `len` would need to be \"doubled\" too\n // similar to finding a value in binary search tree, hence O(log(n))\n if (len) ch += ch;\n // `len` is 0, exit the loop\n else break;\n }\n // pad `str`!\n return pad + str;\n}\n","map":{"mappings":[{"source":"node_modules/left-pad/index.js","original":{"line":1,"column":0},"generated":{"line":1,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":2,"column":0},"generated":{"line":2,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":3,"column":0},"generated":{"line":3,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":4,"column":0},"generated":{"line":4,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":5,"column":0},"generated":{"line":5,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":6,"column":0},"generated":{"line":6,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":7,"column":0},"generated":{"line":7,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":8,"column":0},"generated":{"line":8,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":9,"column":0},"generated":{"line":9,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":10,"column":0},"generated":{"line":10,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":11,"column":0},"generated":{"line":11,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":12,"column":0},"generated":{"line":12,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":13,"column":0},"generated":{"line":13,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":14,"column":0},"generated":{"line":14,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":15,"column":0},"generated":{"line":15,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":16,"column":0},"generated":{"line":16,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":17,"column":0},"generated":{"line":17,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":18,"column":0},"generated":{"line":18,"column":0}},{"source":"node_modules/left-pad/index.js","original":{"line":19,"column":0},"generated":{"line":19,"column":0}},{"source":"node_modules/left-pad/index.js","o