From 818c79ea7063fb113ace8badbea89ec76c2eab2e Mon Sep 17 00:00:00 2001 From: Arne Date: Wed, 14 Dec 2016 17:34:06 +0100 Subject: [PATCH] Adjust Pattern to respect empty 'placeholderChars' Adjustment of Pattern to reflect #20 --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 3c7c31f..c699236 100644 --- a/lib/index.js +++ b/lib/index.js @@ -74,7 +74,7 @@ function Pattern(source, formatCharacters, placeholderChar, isRevealingMask) { } /** Placeholder character */ - this.placeholderChar = placeholderChar || DEFAULT_PLACEHOLDER_CHAR + this.placeholderChar = typeof placeholderChar === 'string' ? placeholderChar : DEFAULT_PLACEHOLDER_CHAR /** Format character definitions. */ this.formatCharacters = formatCharacters || DEFAULT_FORMAT_CHARACTERS /** Pattern definition string with escape characters. */