From bc7a662812907d1f8be9371bbdb3c525cc3ce970 Mon Sep 17 00:00:00 2001 From: Mike Castle Date: Wed, 25 Oct 2023 11:13:12 -0700 Subject: [PATCH] Give `Service` a *shortName* property. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #130. ␄ --- linkedin-tool.user.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linkedin-tool.user.js b/linkedin-tool.user.js index 441e4b2..a2ef200 100644 --- a/linkedin-tool.user.js +++ b/linkedin-tool.user.js @@ -1583,17 +1583,24 @@ return this.#name; } + /** @type {string} - Shorter instance name. */ + get shortName() { + return this.#shortName; + } + /** @param {string} name - Custom portion of this instance. */ constructor(name) { if (new.target === Service) { throw new TypeError('Abstract class; do not instantiate directly.'); } this.#name = `${this.constructor.name}: ${name}`; + this.#shortName = name; this.#logger = new NH.base.Logger(this.#name); } #logger #name + #shortName /** @param {string} name - Name of method that was not implemented. */ #notImplemented(name) {