rollup 4.9.5 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rollup +88 -50
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +105 -42
- package/dist/es/shared/parseAst.js +322 -361
- package/dist/es/shared/watch.js +6 -3
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/native.js +3 -1
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +4 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +6 -3
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +322 -361
- package/dist/shared/rollup.js +104 -41
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +45 -42
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.10.0
|
|
5
|
+
Sat, 10 Feb 2024 05:58:12 GMT - commit 762420860765e8e46e24d48b38f5b98ca31735fa
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
@@ -28,7 +28,7 @@ require('../native.js');
|
|
|
28
28
|
require('node:url');
|
|
29
29
|
require('../getLogFilter.js');
|
|
30
30
|
|
|
31
|
-
const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
|
31
|
+
const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
@@ -1248,33 +1248,66 @@ yargsParser.decamelize = decamelize;
|
|
|
1248
1248
|
yargsParser.looksLikeNumber = looksLikeNumber;
|
|
1249
1249
|
const argParser = yargsParser;
|
|
1250
1250
|
|
|
1251
|
-
|
|
1252
|
-
if (typeof milliseconds !== 'number') {
|
|
1253
|
-
throw new TypeError('Expected a number');
|
|
1254
|
-
}
|
|
1251
|
+
const toZeroIfInfinity = value => Number.isFinite(value) ? value : 0;
|
|
1255
1252
|
|
|
1256
|
-
|
|
1253
|
+
function parseNumber(milliseconds) {
|
|
1254
|
+
return {
|
|
1255
|
+
days: Math.trunc(milliseconds / 86_400_000),
|
|
1256
|
+
hours: Math.trunc(milliseconds / 3_600_000 % 24),
|
|
1257
|
+
minutes: Math.trunc(milliseconds / 60_000 % 60),
|
|
1258
|
+
seconds: Math.trunc(milliseconds / 1000 % 60),
|
|
1259
|
+
milliseconds: Math.trunc(milliseconds % 1000),
|
|
1260
|
+
microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1000) % 1000),
|
|
1261
|
+
nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1000),
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1257
1264
|
|
|
1265
|
+
function parseBigint(milliseconds) {
|
|
1258
1266
|
return {
|
|
1259
|
-
days:
|
|
1260
|
-
hours:
|
|
1261
|
-
minutes:
|
|
1262
|
-
seconds:
|
|
1263
|
-
milliseconds:
|
|
1264
|
-
microseconds:
|
|
1265
|
-
nanoseconds:
|
|
1267
|
+
days: milliseconds / 86_400_000n,
|
|
1268
|
+
hours: milliseconds / 3_600_000n % 24n,
|
|
1269
|
+
minutes: milliseconds / 60_000n % 60n,
|
|
1270
|
+
seconds: milliseconds / 1000n % 60n,
|
|
1271
|
+
milliseconds: milliseconds % 1000n,
|
|
1272
|
+
microseconds: 0n,
|
|
1273
|
+
nanoseconds: 0n,
|
|
1266
1274
|
};
|
|
1267
1275
|
}
|
|
1268
1276
|
|
|
1269
|
-
|
|
1277
|
+
function parseMilliseconds(milliseconds) {
|
|
1278
|
+
switch (typeof milliseconds) {
|
|
1279
|
+
case 'number': {
|
|
1280
|
+
if (Number.isFinite(milliseconds)) {
|
|
1281
|
+
return parseNumber(milliseconds);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
case 'bigint': {
|
|
1288
|
+
return parseBigint(milliseconds);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
// No default
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
throw new TypeError('Expected a finite number or bigint');
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
const isZero = value => value === 0 || value === 0n;
|
|
1298
|
+
const pluralize = (word, count) => (count === 1 || count === 1n) ? word : `${word}s`;
|
|
1270
1299
|
|
|
1271
1300
|
const SECOND_ROUNDING_EPSILON = 0.000_000_1;
|
|
1301
|
+
const ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n;
|
|
1272
1302
|
|
|
1273
|
-
function prettyMilliseconds(milliseconds, options
|
|
1274
|
-
|
|
1275
|
-
|
|
1303
|
+
function prettyMilliseconds(milliseconds, options) {
|
|
1304
|
+
const isBigInt = typeof milliseconds === 'bigint';
|
|
1305
|
+
if (!isBigInt && !Number.isFinite(milliseconds)) {
|
|
1306
|
+
throw new TypeError('Expected a finite number or bigint');
|
|
1276
1307
|
}
|
|
1277
1308
|
|
|
1309
|
+
options = {...options};
|
|
1310
|
+
|
|
1278
1311
|
if (options.colonNotation) {
|
|
1279
1312
|
options.compact = false;
|
|
1280
1313
|
options.formatSubMilliseconds = false;
|
|
@@ -1283,11 +1316,12 @@ function prettyMilliseconds(milliseconds, options = {}) {
|
|
|
1283
1316
|
}
|
|
1284
1317
|
|
|
1285
1318
|
if (options.compact) {
|
|
1319
|
+
options.unitCount = 1;
|
|
1286
1320
|
options.secondsDecimalDigits = 0;
|
|
1287
1321
|
options.millisecondsDecimalDigits = 0;
|
|
1288
1322
|
}
|
|
1289
1323
|
|
|
1290
|
-
|
|
1324
|
+
let result = [];
|
|
1291
1325
|
|
|
1292
1326
|
const floorDecimals = (value, decimalDigits) => {
|
|
1293
1327
|
const flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);
|
|
@@ -1296,62 +1330,67 @@ function prettyMilliseconds(milliseconds, options = {}) {
|
|
|
1296
1330
|
};
|
|
1297
1331
|
|
|
1298
1332
|
const add = (value, long, short, valueString) => {
|
|
1299
|
-
if (
|
|
1333
|
+
if (
|
|
1334
|
+
(result.length === 0 || !options.colonNotation)
|
|
1335
|
+
&& isZero(value)
|
|
1336
|
+
&& !(options.colonNotation && short === 'm')) {
|
|
1300
1337
|
return;
|
|
1301
1338
|
}
|
|
1302
1339
|
|
|
1303
|
-
valueString =
|
|
1304
|
-
let prefix;
|
|
1305
|
-
let suffix;
|
|
1340
|
+
valueString = valueString ?? String(value);
|
|
1306
1341
|
if (options.colonNotation) {
|
|
1307
|
-
prefix = result.length > 0 ? ':' : '';
|
|
1308
|
-
suffix = '';
|
|
1309
1342
|
const wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;
|
|
1310
1343
|
const minLength = result.length > 0 ? 2 : 1;
|
|
1311
1344
|
valueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;
|
|
1312
1345
|
} else {
|
|
1313
|
-
|
|
1314
|
-
suffix = options.verbose ? ' ' + pluralize(long, value) : short;
|
|
1346
|
+
valueString += options.verbose ? ' ' + pluralize(long, value) : short;
|
|
1315
1347
|
}
|
|
1316
1348
|
|
|
1317
|
-
result.push(
|
|
1349
|
+
result.push(valueString);
|
|
1318
1350
|
};
|
|
1319
1351
|
|
|
1320
1352
|
const parsed = parseMilliseconds(milliseconds);
|
|
1353
|
+
const days = BigInt(parsed.days);
|
|
1321
1354
|
|
|
1322
|
-
add(
|
|
1323
|
-
add(
|
|
1324
|
-
add(parsed.hours, 'hour', 'h');
|
|
1325
|
-
add(parsed.minutes, 'minute', 'm');
|
|
1355
|
+
add(days / 365n, 'year', 'y');
|
|
1356
|
+
add(days % 365n, 'day', 'd');
|
|
1357
|
+
add(Number(parsed.hours), 'hour', 'h');
|
|
1358
|
+
add(Number(parsed.minutes), 'minute', 'm');
|
|
1326
1359
|
|
|
1327
1360
|
if (
|
|
1328
1361
|
options.separateMilliseconds
|
|
1329
1362
|
|| options.formatSubMilliseconds
|
|
1330
1363
|
|| (!options.colonNotation && milliseconds < 1000)
|
|
1331
1364
|
) {
|
|
1332
|
-
|
|
1365
|
+
const seconds = Number(parsed.seconds);
|
|
1366
|
+
const milliseconds = Number(parsed.milliseconds);
|
|
1367
|
+
const microseconds = Number(parsed.microseconds);
|
|
1368
|
+
const nanoseconds = Number(parsed.nanoseconds);
|
|
1369
|
+
|
|
1370
|
+
add(seconds, 'second', 's');
|
|
1371
|
+
|
|
1333
1372
|
if (options.formatSubMilliseconds) {
|
|
1334
|
-
add(
|
|
1335
|
-
add(
|
|
1336
|
-
add(
|
|
1373
|
+
add(milliseconds, 'millisecond', 'ms');
|
|
1374
|
+
add(microseconds, 'microsecond', 'µs');
|
|
1375
|
+
add(nanoseconds, 'nanosecond', 'ns');
|
|
1337
1376
|
} else {
|
|
1338
1377
|
const millisecondsAndBelow
|
|
1339
|
-
=
|
|
1340
|
-
+ (
|
|
1341
|
-
+ (
|
|
1378
|
+
= milliseconds
|
|
1379
|
+
+ (microseconds / 1000)
|
|
1380
|
+
+ (nanoseconds / 1e6);
|
|
1342
1381
|
|
|
1343
1382
|
const millisecondsDecimalDigits
|
|
1344
1383
|
= typeof options.millisecondsDecimalDigits === 'number'
|
|
1345
1384
|
? options.millisecondsDecimalDigits
|
|
1346
1385
|
: 0;
|
|
1347
1386
|
|
|
1348
|
-
const
|
|
1387
|
+
const roundedMilliseconds = millisecondsAndBelow >= 1
|
|
1349
1388
|
? Math.round(millisecondsAndBelow)
|
|
1350
1389
|
: Math.ceil(millisecondsAndBelow);
|
|
1351
1390
|
|
|
1352
1391
|
const millisecondsString = millisecondsDecimalDigits
|
|
1353
1392
|
? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)
|
|
1354
|
-
:
|
|
1393
|
+
: roundedMilliseconds;
|
|
1355
1394
|
|
|
1356
1395
|
add(
|
|
1357
1396
|
Number.parseFloat(millisecondsString),
|
|
@@ -1361,7 +1400,10 @@ function prettyMilliseconds(milliseconds, options = {}) {
|
|
|
1361
1400
|
);
|
|
1362
1401
|
}
|
|
1363
1402
|
} else {
|
|
1364
|
-
const seconds = (
|
|
1403
|
+
const seconds = (
|
|
1404
|
+
(isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds)
|
|
1405
|
+
/ 1000
|
|
1406
|
+
) % 60;
|
|
1365
1407
|
const secondsDecimalDigits
|
|
1366
1408
|
= typeof options.secondsDecimalDigits === 'number'
|
|
1367
1409
|
? options.secondsDecimalDigits
|
|
@@ -1377,16 +1419,12 @@ function prettyMilliseconds(milliseconds, options = {}) {
|
|
|
1377
1419
|
return '0' + (options.verbose ? ' milliseconds' : 'ms');
|
|
1378
1420
|
}
|
|
1379
1421
|
|
|
1380
|
-
|
|
1381
|
-
return result[0];
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1422
|
+
const separator = options.colonNotation ? ':' : ' ';
|
|
1384
1423
|
if (typeof options.unitCount === 'number') {
|
|
1385
|
-
|
|
1386
|
-
return result.slice(0, Math.max(options.unitCount, 1)).join(separator);
|
|
1424
|
+
result = result.slice(0, Math.max(options.unitCount, 1));
|
|
1387
1425
|
}
|
|
1388
1426
|
|
|
1389
|
-
return
|
|
1427
|
+
return result.join(separator);
|
|
1390
1428
|
}
|
|
1391
1429
|
|
|
1392
1430
|
const BYTE_UNITS = [
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED