How to use the @lhci/utils/src/lodash.js.padEnd function in @lhci/utils

To help you get started, we’ve selected a few @lhci/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / lighthouse-ci / packages / server / src / api / storage / sql / sql.js View on Github external
function formatAsUuid(uuid, filler = '0') {
  const parts = padEnd(uuid, 32, filler).match(/\w{4}/g);
  if (!parts || parts.length !== 8) throw new Error('Invalid UUID');
  const [p1, p2, p3, p4, p5, p6, p7, p8] = parts;
  return `${p1}${p2}-${p3}-${p4}-${p5}-${p6}${p7}${p8}`;
}