Skip to content

Commit 4201b36

Browse files
committed
style: add numeric separators for readability
Update numeric literals >= 10000 to use underscores as separators per Biome numeric_separators rule.
1 parent 37286e5 commit 4201b36

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

src/validation/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export interface JsonParseOptions {
110110
* Maximum allowed size of JSON string in bytes.
111111
* Prevents memory exhaustion from extremely large payloads.
112112
*
113-
* @default 10485760 (10 MB)
113+
* @default 10_485_760 (10 MB)
114114
*
115115
* @example
116116
* ```ts

test/packages/operations.test.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ describe('packages/operations', () => {
370370
.catch(() => false)
371371
expect(exists).toBe(true)
372372
}, 'extract-pkg-')
373-
}, 30000)
373+
}, 30_000)
374374

375375
it('should call callback with destination path', async () => {
376376
await runWithTempDir(async tmpDir => {
@@ -384,7 +384,7 @@ describe('packages/operations', () => {
384384

385385
expect(callbackPath).toBe(dest)
386386
}, 'extract-pkg-callback-')
387-
}, 30000)
387+
}, 30_000)
388388

389389
it('should use temporary directory when dest not provided', async () => {
390390
let tmpPath = ''
@@ -400,7 +400,7 @@ describe('packages/operations', () => {
400400
}) as any)
401401

402402
expect(tmpPath).toBeTruthy()
403-
}, 30000)
403+
}, 30_000)
404404

405405
it('should handle function as second argument', async () => {
406406
let called = false
@@ -410,7 +410,7 @@ describe('packages/operations', () => {
410410
}) as any)
411411

412412
expect(called).toBe(true)
413-
}, 30000)
413+
}, 30_000)
414414

415415
it('should pass extract options to pacote', async () => {
416416
await runWithTempDir(async tmpDir => {
@@ -429,7 +429,7 @@ describe('packages/operations', () => {
429429
.catch(() => false)
430430
expect(exists).toBe(true)
431431
}, 'extract-pkg-options-')
432-
}, 30000)
432+
}, 30_000)
433433

434434
it('should use tmpPrefix option for temp directory', async () => {
435435
let tmpPath = ''
@@ -442,7 +442,7 @@ describe('packages/operations', () => {
442442
)
443443

444444
expect(tmpPath).toBeTruthy()
445-
}, 30000)
445+
}, 30_000)
446446
})
447447

448448
describe('packPackage', () => {
@@ -467,7 +467,7 @@ describe('packages/operations', () => {
467467
expect(tarball).toBeDefined()
468468
expect(Buffer.isBuffer(tarball)).toBe(true)
469469
}, 'pack-pkg-')
470-
}, 30000)
470+
}, 30_000)
471471

472472
it('should pack package with options', async () => {
473473
await runWithTempDir(async tmpDir => {
@@ -481,13 +481,13 @@ describe('packages/operations', () => {
481481
const tarball = await packPackage(tmpDir, { preferOffline: true })
482482
expect(tarball).toBeDefined()
483483
}, 'pack-pkg-options-')
484-
}, 30000)
484+
}, 30_000)
485485

486486
it('should pack remote package spec', async () => {
487487
const tarball = await packPackage('is-number@7.0.0')
488488
expect(tarball).toBeDefined()
489489
expect(Buffer.isBuffer(tarball)).toBe(true)
490-
}, 30000)
490+
}, 30_000)
491491
})
492492

493493
describe('resolveGitHubTgzUrl', () => {
@@ -517,7 +517,7 @@ describe('packages/operations', () => {
517517
// Should return the URL itself if it's already a tarball URL
518518
expect(typeof result).toBe('string')
519519
}, 'resolve-github-tgz-spec-')
520-
}, 30000)
520+
}, 30_000)
521521

522522
it('should accept package.json object as where parameter', async () => {
523523
const pkgJson: PackageJson = {
@@ -529,7 +529,7 @@ describe('packages/operations', () => {
529529
const result = await resolveGitHubTgzUrl('test-package', pkgJson)
530530
// Should return empty string or valid URL
531531
expect(typeof result).toBe('string')
532-
}, 30000)
532+
}, 30_000)
533533

534534
it('should return empty string when no repository URL', async () => {
535535
const pkgJson: PackageJson = {
@@ -550,7 +550,7 @@ describe('packages/operations', () => {
550550

551551
const result = await resolveGitHubTgzUrl('github:user/repo#main', pkgJson)
552552
expect(typeof result).toBe('string')
553-
}, 30000)
553+
}, 30_000)
554554

555555
it('should try version with v prefix first', async () => {
556556
const pkgJson: PackageJson = {
@@ -562,7 +562,7 @@ describe('packages/operations', () => {
562562
const result = await resolveGitHubTgzUrl('test', pkgJson)
563563
// Will return empty string if tag doesn't exist, which is expected
564564
expect(typeof result).toBe('string')
565-
}, 30000)
565+
}, 30_000)
566566

567567
it('should fallback to version without v prefix', async () => {
568568
const pkgJson: PackageJson = {
@@ -573,7 +573,7 @@ describe('packages/operations', () => {
573573

574574
const result = await resolveGitHubTgzUrl('test', pkgJson)
575575
expect(typeof result).toBe('string')
576-
}, 30000)
576+
}, 30_000)
577577

578578
it('should handle repository as string', async () => {
579579
const pkgJson: PackageJson = {
@@ -584,21 +584,21 @@ describe('packages/operations', () => {
584584

585585
const result = await resolveGitHubTgzUrl('test', pkgJson)
586586
expect(typeof result).toBe('string')
587-
}, 30000)
587+
}, 30_000)
588588
})
589589

590590
describe('edge cases and error handling', () => {
591591
it('should handle extractPackage with invalid spec', async () => {
592592
await expect(
593593
extractPackage('non-existent-package-xyz-123', { dest: '/tmp/test' })
594594
).rejects.toThrow()
595-
}, 30000)
595+
}, 30_000)
596596

597597
it('should handle packPackage with invalid path', async () => {
598598
await expect(
599599
packPackage('/non/existent/path')
600600
).rejects.toThrow()
601-
}, 30000)
601+
}, 30_000)
602602

603603
it('should handle readPackageJson with invalid JSON', async () => {
604604
await runWithTempDir(async tmpDir => {
@@ -650,7 +650,7 @@ describe('packages/operations', () => {
650650
called = true
651651
}) as any)
652652
expect(called).toBe(true)
653-
}, 30000)
653+
}, 30_000)
654654

655655
it('should lazy load fetcher on first use', async () => {
656656
// This test verifies that make-fetch-happen is only loaded when needed
@@ -663,7 +663,7 @@ describe('packages/operations', () => {
663663
await resolveGitHubTgzUrl('test', pkgJson)
664664
// If we get here without error, lazy loading worked
665665
expect(true).toBe(true)
666-
}, 30000)
666+
}, 30_000)
667667

668668
it('should lazy load npm-package-arg on first use', () => {
669669
// Using getReleaseTag should not load npm-package-arg
@@ -674,14 +674,14 @@ describe('packages/operations', () => {
674674
it('should lazy load pack on first use', async () => {
675675
// packPackage should lazy load the pack module
676676
await expect(packPackage('/non/existent')).rejects.toThrow()
677-
}, 30000)
677+
}, 30_000)
678678

679679
it('should lazy load pacote on first use', async () => {
680680
// extractPackage should lazy load pacote
681681
await expect(
682682
extractPackage('invalid-spec-xyz', { dest: '/tmp/test' })
683683
).rejects.toThrow()
684-
}, 30000)
684+
}, 30_000)
685685

686686
it('should lazy load semver on first use', () => {
687687
// findPackageExtensions should lazy load semver
@@ -708,7 +708,7 @@ describe('packages/operations', () => {
708708
.catch(() => false)
709709
expect(exists).toBe(true)
710710
}, 'extract-all-opts-')
711-
}, 30000)
711+
}, 30_000)
712712

713713
it('should handle readPackageJson with all options', async () => {
714714
await runWithTempDir(async tmpDir => {

0 commit comments

Comments
 (0)