From 4411f8b160bbca967149b28d4f485987ddc62942 Mon Sep 17 00:00:00 2001 From: Luiz Ferraz Date: Sun, 29 May 2022 15:50:50 -0300 Subject: [PATCH] Add support for readonly properties (#62) --- package-lock.json | 2 +- package.json | 2 +- src/logger.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3367741..c84a251 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-dev", "license": "MIT", "dependencies": { - "@croct/json": "^1.0.0" + "@croct/json": "^1.1" }, "devDependencies": { "@croct/eslint-plugin": "^0.6.0", diff --git a/package.json b/package.json index 0cc9a69..ed561af 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,6 @@ "**/*.ts" ], "dependencies": { - "@croct/json": "^1.0.0" + "@croct/json": "^1.1" } } diff --git a/src/logger.ts b/src/logger.ts index 7184b0f..5eb6ffe 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,9 +1,9 @@ -import {JsonCompatibleObject} from '@croct/json'; +import {ReadonlyJsonCompatibleObject} from '@croct/json'; /** * Additional information about the log message. */ -export type LogDetails = JsonCompatibleObject; +export type LogDetails = ReadonlyJsonCompatibleObject; /** * The severity of the log message. @@ -48,7 +48,7 @@ export type Log = { * The log message. */ message: string, -} & (JsonCompatibleObject extends D ? {details?: D} : {details: D}); +} & (LogDetails extends D ? {details?: D} : {details: D}); /** * A common interface for loggers.