From f34800d7255ebf2096d4df76ffbfec1b47085b78 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Mon, 18 May 2020 17:06:18 +0200 Subject: [PATCH] Use private fields --- package.json | 2 +- src/base.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 492972a..b9f3a06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hibas123/logging", - "version": "2.4.4", + "version": "2.4.5", "description": "", "main": "out/index.js", "types": "out/index.d.ts", diff --git a/src/base.ts b/src/base.ts index 21c1442..c68c859 100644 --- a/src/base.ts +++ b/src/base.ts @@ -194,11 +194,11 @@ export class LoggingBase { } } - private $closed = false; + #closed = false; public close() { - if (this.$closed) return; - this.$closed = true; + if (this.#closed) return; + this.#closed = true; this.adapterSet.adapters.forEach((adapter) => { let cached = adapterCache.get(adapter); @@ -319,7 +319,7 @@ export class LoggingBase { message: any[], caller?: { file: string; line: number; column?: number } ) { - if (this.$closed) return; + if (this.#closed) return; let date = new Date().toISOString().replace(/T/, " ").replace(/\..+/, "");