From 856d9515aa7d9aa5acf68f77d5eed7a5bc502a57 Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 23 Oct 2023 17:43:20 +0200 Subject: [PATCH 1/3] Fix colored browser logging --- src/browser/log/log-browser.ts | 8 ++++---- src/common/data/bin.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/browser/log/log-browser.ts b/src/browser/log/log-browser.ts index 7e53b40b..031eadf3 100644 --- a/src/browser/log/log-browser.ts +++ b/src/browser/log/log-browser.ts @@ -84,22 +84,22 @@ export function LoggerBrowserHandler(opt: LogHandlerOptions = {}): LogHandler { case LogLevelInfo: if (opt.levelHelper) args[0] = `I|* ${args[0]}` - console.info(...joinLogStrings(...args)) + console.info(...args) break case LogLevelWarn: if (opt.levelHelper) args[0] = `W|** ${args[0]}` - console.warn(...joinLogStrings(...args)) + console.warn(...args) break case LogLevelError: if (opt.levelHelper) args[0] = `E|*** ${args[0]}` - console.error(...joinLogStrings(...args)) + console.error(...args) break default: if (opt.levelHelper) args[0] = `D| ${args[0]}` - console.debug(...joinLogStrings(...args)) + console.debug(...args) break } } diff --git a/src/common/data/bin.ts b/src/common/data/bin.ts index c09d2fd0..2829f241 100644 --- a/src/common/data/bin.ts +++ b/src/common/data/bin.ts @@ -101,6 +101,8 @@ export function fromHex(hexString: string): Uint8Array { ) } +// Learn about Base64 in browsers: https://web.dev/articles/base64-encoding + /** Regular base64 */ export function toBase64(bin: BinInput, stripPadding = false): string { const bytes = toUint8Array(bin) From fc7ad34e56d51d012152845b9d746bf52a75a1f7 Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 23 Oct 2023 17:44:08 +0200 Subject: [PATCH 2/3] Update dependencies --- package.json | 6 +++--- src/browser/log/log-browser.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d42e5296..65785f09 100644 --- a/package.json +++ b/package.json @@ -69,15 +69,15 @@ "devDependencies": { "@antfu/eslint-config": "^0.43.1", "@antfu/ni": "^0.21.8", - "@types/node": "^20", + "@types/node": "^20.8.7", "c8": "^8.0.1", "cross-fetch": "^4.0.0", "esbuild": "^0.19.5", - "eslint": "^8.51.0", + "eslint": "^8.52.0", "madge": "^6.1.0", "tsup": "^7.2.0", "typescript": "^5.2.2", - "vite": "^4.4.11", + "vite": "^4.5.0", "vitest": "^0.34.6" } } diff --git a/src/browser/log/log-browser.ts b/src/browser/log/log-browser.ts index 031eadf3..1926c8fe 100644 --- a/src/browser/log/log-browser.ts +++ b/src/browser/log/log-browser.ts @@ -5,7 +5,7 @@ import type { LogHandler, LogHandlerOptions, LogMessage } from '../../common/log/log-base' import { LogLevelError, LogLevelInfo, LogLevelWarn } from '../../common/log/log-base' import { browserSelectColorByName } from '../../common/log/log-colors' -import { joinLogStrings, useLevelFilter, useNamespaceFilter } from '../../common/log/log-filter' +import { useLevelFilter, useNamespaceFilter } from '../../common/log/log-filter' import { formatMilliseconds, getTimestamp } from '../../common/time' import { browserSupportsColors } from './log-colors' From 01bc9305ef38e022cff9b755d88369926c94c123 Mon Sep 17 00:00:00 2001 From: Dirk Holtwick Date: Mon, 23 Oct 2023 17:44:11 +0200 Subject: [PATCH 3/3] 0.13.23 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65785f09..bd423a60 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zeed", "type": "module", - "version": "0.13.22", + "version": "0.13.23", "description": "🌱 Simple foundation library", "author": { "name": "Dirk Holtwick",