From 84401d267b1f1e633e42147b4b6fc43f1f7ce807 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Wed, 23 Nov 2022 14:36:50 +0100 Subject: [PATCH] chore: Updated dependencies. --- package.json | 18 +++++++++--------- src/models.ts | 4 ++-- src/print.ts | 8 ++++---- test/fixture/sample.ts | 2 +- test/print.test.ts | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 30fa1df..1be76b2 100644 --- a/package.json +++ b/package.json @@ -37,25 +37,25 @@ "postpublish": "git push origin && git push origin -f --tags" }, "dependencies": { - "acquerello": "^1.0.11", + "acquerello": "^1.0.12", "hdr-histogram-js": "^3.0.0", - "table": "^6.8.0" + "table": "^6.8.1" }, "devDependencies": { - "@cowtech/eslint-config": "^8.7.5", + "@cowtech/eslint-config": "^8.8.0", "@swc/cli": "^0.1.57", - "@swc/core": "^1.3.7", - "@types/node": "^18.8.4", + "@swc/core": "^1.3.19", + "@types/node": "^18.11.9", "@types/sinon": "^10.0.13", "@types/tap": "^15.0.7", "c8": "^7.12.0", "chokidar": "^3.5.3", - "prettier": "^2.7.1", + "prettier": "^2.8.0", "proxyquire": "^2.1.3", - "sinon": "^14.0.1", - "tap": "^16.3.0", + "sinon": "^14.0.2", + "tap": "^16.3.2", "ts-node": "^10.9.1", - "typescript": "^4.8.4" + "typescript": "^4.9.3" }, "engines": { "node": ">=14.15.0" diff --git a/src/models.ts b/src/models.ts index 9ce8afe..09eedb4 100644 --- a/src/models.ts +++ b/src/models.ts @@ -64,7 +64,7 @@ export interface Context { iterations: number errorThreshold: number print: boolean | PrintOptions - tests: Array<[string, TestFunction | Test]> + tests: [string, TestFunction | Test][] results: Results current: number callback: Callback @@ -75,7 +75,7 @@ export interface Context { export interface WorkerContext { path: string - tests: Array<[string, TestFunction | Test]> + tests: [string, TestFunction | Test][] index: number iterations: number warmup: boolean diff --git a/src/print.ts b/src/print.ts index e1dc661..1ac2387 100644 --- a/src/print.ts +++ b/src/print.ts @@ -14,9 +14,9 @@ interface PrintInfo { compared: string } -let currentLogger: (message: string, ...params: Array) => void = console.log +let currentLogger: (message: string, ...params: any[]) => void = console.log -export function setLogger(logger: (message: string, ...params: Array) => void): void { +export function setLogger(logger: (message: string, ...params: any[]) => void): void { currentLogger = logger } @@ -28,7 +28,7 @@ export function printResults(results: Results, colors: boolean, compare: boolean let compared = '' let standardErrorPadding = 0 - const entries: Array = Object.entries(results) + const entries: PrintInfo[] = Object.entries(results) .sort((a, b) => (!a[1].success ? -1 : b[1].mean - a[1].mean)) .map(([name, result]) => { if (!result.success) { @@ -72,7 +72,7 @@ export function printResults(results: Results, colors: boolean, compare: boolean let currentColor = 0 - const rows: Array> = entries.map(entry => { + const rows: string[][] = entries.map(entry => { if (entry.error) { const row = [ styler(`{{gray}}${entry.name}{{-}}`), diff --git a/test/fixture/sample.ts b/test/fixture/sample.ts index 509e5c1..bf0cbf1 100644 --- a/test/fixture/sample.ts +++ b/test/fixture/sample.ts @@ -9,7 +9,7 @@ const subject = cronometro( { single() { - subject.replace(pattern, m => replacements[m]) + subject.replaceAll(pattern, m => replacements[m]) }, multiple() { subject.replaceAll('1', 'a').replaceAll('2', 'b').replaceAll('3', 'c') diff --git a/test/print.test.ts b/test/print.test.ts index 1d85e97..7b8e5f8 100644 --- a/test/print.test.ts +++ b/test/print.test.ts @@ -8,7 +8,7 @@ import { setLogger } from '../src/print.js' function removeStyle(source: string): string { // eslint-disable-next-line no-control-regex - return source.replace(/\u001B\[\d+m/g, '') + return source.replaceAll(/\u001B\[\d+m/g, '') } const loggerSpy = sinon.spy()