From e00c8a90bdbc8f6326bc4e2971b3c11c97513a8f Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Fri, 8 Nov 2024 21:31:33 +0100 Subject: [PATCH] Try to remove dependency --- human-formatter/index.js | 4 ++-- package.json | 1 - pnpm-lock.yaml | 3 --- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/human-formatter/index.js b/human-formatter/index.js index f15a9f9..68045d0 100644 --- a/human-formatter/index.js +++ b/human-formatter/index.js @@ -1,10 +1,10 @@ import { once } from 'node:events' import os from 'node:os' import { Transform } from 'node:stream' +import { stripVTControlCharacters } from 'node:util' import pico from 'picocolors' import pino from 'pino' import abstractTransport from 'pino-abstract-transport' -import stripAnsi from 'strip-ansi' import { mulberry32, onceXmur3 } from './utils.js' @@ -50,7 +50,7 @@ function formatNow() { } function rightPag(str, length) { - let add = length - stripAnsi(str).length + let add = length - stripVTControlCharacters(str).length for (let i = 0; i < add; i++) str += ' ' return str } diff --git a/package.json b/package.json index 1bd4136..00d13d6 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "pino": "9.5.0", "pino-abstract-transport": "^2.0.0", "semver": "^7.6.3", - "strip-ansi": "^7.1.0", "tinyglobby": "^0.2.9", "url-pattern": "^1.0.3", "ws": "^8.18.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99d7f3f..c31852a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,9 +41,6 @@ importers: semver: specifier: ^7.6.3 version: 7.6.3 - strip-ansi: - specifier: ^7.1.0 - version: 7.1.0 tinyglobby: specifier: ^0.2.9 version: 0.2.9