Files
klz-cables.com/.pnpm-store/v10/files/a0/1076cf0f7e8d74752d6e8f6519054cff20165fd1f44568035dad15ecbe9b8f3836e01b6dd394576f433318ba77a99dcdbf1f700822c2590ed823082d51bee9
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

24 lines
968 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findWidthInConsole = exports.stripAnsi = void 0;
const simple_wcswidth_1 = require("simple-wcswidth");
/* eslint-disable no-control-regex */
const colorRegex = /\x1b\[\d{1,3}(;\d{1,3})*m/g; // \x1b[30m \x1b[305m \x1b[38;5m
const stripAnsi = (str) => str.replace(colorRegex, '');
exports.stripAnsi = stripAnsi;
const findWidthInConsole = (str, charLength) => {
let strLen = 0;
str = (0, exports.stripAnsi)(str);
if (charLength) {
Object.entries(charLength).forEach(([key, value]) => {
// count appearance of the key in the string and remove from original string
let regex = new RegExp(key, 'g');
strLen += (str.match(regex) || []).length * value;
str = str.replace(key, '');
});
}
strLen += (0, simple_wcswidth_1.wcswidth)(str);
return strLen;
};
exports.findWidthInConsole = findWidthInConsole;