diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a0aa11a..18536a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ Breaking changes: * `BaseComponent`: Renamed `CONFIG_CLASS` to `configClass`. Other notable changes: -* None. +* `loggy-intf`: + * `LoggyIntf`: New static methods `expectInstance()` and + `expectInstanceOrNull()`, to avoid more ad-hoc checks. ### v0.8.5 -- 2024-12-06 diff --git a/src/loggy-intf/export/IntfLogger.js b/src/loggy-intf/export/IntfLogger.js index 94ef9844..7e7f6f9f 100644 --- a/src/loggy-intf/export/IntfLogger.js +++ b/src/loggy-intf/export/IntfLogger.js @@ -117,7 +117,7 @@ export class IntfLogger { * @throws {Error} Thrown if `logger` is not actually a logger or `null`. */ static expectInstanceOrNull(logger) { - return (logger === null) ? logger : this.expectInstance(logger); + return (logger === null) ? null : this.expectInstance(logger); } /**