From 4b1c2be32b2035638af80d3f7d80ad25e36b99c5 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 15 May 2023 14:46:06 +0700 Subject: [PATCH] Fix Node.js 12 compatibility Closes #224 --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index ea5d9bb..a503eb5 100644 --- a/index.js +++ b/index.js @@ -354,15 +354,15 @@ class Ora { return this; } - const prefixText = options.prefixText ?? this.#prefixText; + const prefixText = options.prefixText || this.#prefixText; const fullPrefixText = this.getFullPrefixText(prefixText, ' '); - const symbolText = options.symbol ?? ' '; + const symbolText = options.symbol || ' '; - const text = options.text ?? this.text; + const text = options.text || this.text; const fullText = (typeof text === 'string') ? ' ' + text : ''; - const suffixText = options.suffixText ?? this.#suffixText; + const suffixText = options.suffixText !== undefined ? options.suffixText : this.#suffixText; const fullSuffixText = this.getFullSuffixText(suffixText, ' '); const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + '\n';