"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatHrTime = exports.dropWhile = exports.enforceLF = exports.identity = void 0; function identity(v) { return v; } exports.identity = identity; function enforceLF(str) { return str.match(/[\r\n]$/) ? str : str + '\n'; } exports.enforceLF = enforceLF; function dropWhile(array, predicate = v => !!v) { let done = false; return array.filter(item => { if (done) { return true; } if (predicate(item)) { return false; } else { done = true; return true; } }); } exports.dropWhile = dropWhile; const TIME_UNITS = ['s', 'ms', 'μp']; function formatHrTime(hrtime) { let time = hrtime[0] + hrtime[1] / 1e9; let index = 0; for (; index < TIME_UNITS.length - 1; index++, time *= 1000) { if (time >= 1) { break; } } return time.toFixed(2) + TIME_UNITS[index]; } exports.formatHrTime = formatHrTime;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
colors.d.ts | File | 854 B | 0644 |
|
colors.js | File | 526 B | 0644 |
|
index.d.ts | File | 927 B | 0644 |
|
index.js | File | 2.05 KB | 0644 |
|
logger.d.ts | File | 3.75 KB | 0644 |
|
logger.js | File | 6.96 KB | 0644 |
|
output.d.ts | File | 1.38 KB | 0644 |
|
output.js | File | 3.21 KB | 0644 |
|
tasks.d.ts | File | 2.44 KB | 0644 |
|
tasks.js | File | 3.51 KB | 0644 |
|
utils.d.ts | File | 272 B | 0644 |
|
utils.js | File | 1.01 KB | 0644 |
|