From: Jordan Eldredge Date: Sun, 6 Nov 2016 03:29:18 +0000 (-0700) Subject: Avoid boolean type check X-Git-Tag: 2.16.0~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20841c7c6604378d94d11d9373aa1cfd9f399798;p=thirdparty%2Fmoment.git Avoid boolean type check In #3559 @ichernev stated that he would prefer two strict comparisons (to `true` and `false`) over checking the type. This pull request actualizes that preference. --- diff --git a/src/lib/create/from-anything.js b/src/lib/create/from-anything.js index 11e15089d..b81295226 100644 --- a/src/lib/create/from-anything.js +++ b/src/lib/create/from-anything.js @@ -86,7 +86,7 @@ function configFromInput(config) { export function createLocalOrUTC (input, format, locale, strict, isUTC) { var c = {}; - if (typeof(locale) === 'boolean') { + if (locale === true || locale === false) { strict = locale; locale = undefined; }