From 47dc26620e54592d5eda42b3fd8ce5cd7069b3b9 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Thu, 27 Dec 2012 11:45:54 -0500 Subject: [PATCH] Narrowed the wordSeparator logic [#105] --- jquery.timeago.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index 0db9f5f..1d0fe7e 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -86,16 +86,8 @@ years < 1.5 && substitute($l.year, 1) || substitute($l.years, Math.round(years)); - switch ($l.wordSeparator) { - case undefined: - var separator = " "; - break; - case null: - var separator = ""; - break; - default: - var separator = $l.wordSeparator; - } + var separator = $l.wordSeparator || ""; + if ($l.wordSeparator === undefined) { separator = " "; } return $.trim([prefix, words, suffix].join(separator)); }, parse: function(iso8601) {