]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Avoid boolean type check
authorJordan Eldredge <jordan@jordaneldredge.com>
Sun, 6 Nov 2016 03:29:18 +0000 (20:29 -0700)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 7 Nov 2016 09:56:19 +0000 (01:56 -0800)
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.

src/lib/create/from-anything.js

index 11e15089d583cde23dcc8e5e8c598a25b0fa76e7..b812952260437e79a0ed33a48ac12ac00a13b464 100644 (file)
@@ -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;
     }