diff --git a/.eslintrc.js b/.eslintrc.js index ad01982684..2bf9cfa590 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -148,7 +148,6 @@ module.exports = { 'unicorn/no-hex-escape': 'off', 'unicorn/no-instanceof-array': 'off', 'unicorn/no-process-exit': 'off', - 'unicorn/no-typeof-undefined': 'off', 'unicorn/no-useless-switch-case': 'off', 'unicorn/no-useless-undefined': 'off', 'unicorn/prefer-array-find': 'off', diff --git a/src/definitions/behaviors/api.js b/src/definitions/behaviors/api.js index 8aa7918744..bba1ff445c 100644 --- a/src/definitions/behaviors/api.js +++ b/src/definitions/behaviors/api.js @@ -19,7 +19,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -34,7 +34,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -126,7 +126,7 @@ decode: { json: function (response) { - if (response !== undefined && typeof response == 'string') { + if (response !== undefined && typeof response === 'string') { try { response = JSON.parse(response); } catch (e) { @@ -431,8 +431,8 @@ if (useFormDataApi) { formData = new FormData($form[0]); - settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false; - settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false; + settings.processData = settings.processData !== undefined ? settings.processData : false; + settings.contentType = settings.contentType !== undefined ? settings.contentType : false; } else { var formArray = $form.serializeArray(), @@ -1000,7 +1000,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 259a254c0e..b50eadddc0 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -29,7 +29,7 @@ query = arguments[0], legacyParameters = arguments[1], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -302,7 +302,7 @@ }, // duck type rule test shorthandRules: function (rules) { - return (typeof rules == 'string' || Array.isArray(rules)); + return (typeof rules === 'string' || Array.isArray(rules)); }, empty: function ($field) { if (!$field || $field.length === 0) { @@ -507,7 +507,7 @@ if (!Array.isArray(rules) && typeof rules === 'object') { fullFields[name] = rules; } else { - if (typeof rules == 'string') { + if (typeof rules === 'string') { rules = [rules]; } fullFields[name] = { @@ -873,7 +873,7 @@ $prompt = $fieldGroup.children(selector.prompt), promptExists = ($prompt.length !== 0) ; - errors = (typeof errors == 'string') + errors = (typeof errors === 'string') ? [errors] : errors; module.verbose('Adding field error state', identifier); @@ -1229,7 +1229,7 @@ showErrors = (showErrors !== undefined) ? showErrors : true; - if (typeof field == 'string') { + if (typeof field === 'string') { module.verbose('Validating field', field); fieldName = field; field = validation[field]; @@ -1436,7 +1436,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { @@ -1732,7 +1732,7 @@ return $.fn.form.settings.rules.range(value, range, 'integer'); }, range: function (value, range, regExp) { - if (typeof regExp == 'string') { + if (typeof regExp === 'string') { regExp = $.fn.form.settings.regExp[regExp]; } if (!(regExp instanceof RegExp)) { @@ -1778,10 +1778,10 @@ // is value (case insensitive) is: function (value, text) { - text = (typeof text == 'string') + text = (typeof text === 'string') ? text.toLowerCase() : text; - value = (typeof value == 'string') + value = (typeof value === 'string') ? value.toLowerCase() : value; @@ -1795,10 +1795,10 @@ // value is not another value (case insensitive) not: function (value, notValue) { - value = (typeof value == 'string') + value = (typeof value === 'string') ? value.toLowerCase() : value; - notValue = (typeof notValue == 'string') + notValue = (typeof notValue === 'string') ? notValue.toLowerCase() : notValue; @@ -1952,7 +1952,7 @@ }, valid = {}, validCard = false, - requiredTypes = (typeof cardTypes == 'string') + requiredTypes = (typeof cardTypes === 'string') ? cardTypes.split(',') : false, unionPay, diff --git a/src/definitions/behaviors/state.js b/src/definitions/behaviors/state.js index 5242f2e91b..aa12298d1a 100644 --- a/src/definitions/behaviors/state.js +++ b/src/definitions/behaviors/state.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -29,7 +29,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -515,7 +515,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/behaviors/visibility.js b/src/definitions/behaviors/visibility.js index 866857fca2..808247fdca 100755 --- a/src/definitions/behaviors/visibility.js +++ b/src/definitions/behaviors/visibility.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue, @@ -1123,7 +1123,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/globals/site.js b/src/definitions/globals/site.js index 1ed6ac237e..4fa8448bdb 100644 --- a/src/definitions/globals/site.js +++ b/src/definitions/globals/site.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (window !== undefined && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -25,7 +25,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), settings = ($.isPlainObject(parameters)) @@ -71,13 +71,13 @@ module.verbose('Console not available, normalizing events'); module.disable.console(); } - if (typeof console.group == 'undefined' || typeof console.groupEnd == 'undefined' || typeof console.groupCollapsed == 'undefined') { + if (console.group === undefined || console.groupEnd === undefined || console.groupCollapsed === undefined) { module.verbose('Console group not available, normalizing events'); window.console.group = function () {}; window.console.groupEnd = function () {}; window.console.groupCollapsed = function () {}; } - if (typeof console.markTimeline == 'undefined') { + if (console.markTimeline === undefined) { module.verbose('Mark timeline not available, normalizing events'); window.console.markTimeline = function () {}; } @@ -357,7 +357,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/accordion.js b/src/definitions/modules/accordion.js index 4fc42310da..4f9e1557e2 100644 --- a/src/definitions/modules/accordion.js +++ b/src/definitions/modules/accordion.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -27,7 +27,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -478,7 +478,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/calendar.js b/src/definitions/modules/calendar.js index b2b4117016..a0fb3db7d4 100644 --- a/src/definitions/modules/calendar.js +++ b/src/definitions/modules/calendar.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -30,7 +30,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue, timeGapTable = { @@ -1486,7 +1486,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index 50abe9acd1..45f491d475 100644 --- a/src/definitions/modules/checkbox.js +++ b/src/definitions/modules/checkbox.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -166,7 +166,7 @@ }, preventDefaultOnInputTarget: function () { - if (typeof event !== 'undefined' && event !== null && $(event.target).is(selector.input)) { + if (event !== undefined && event !== null && $(event.target).is(selector.input)) { module.verbose('Preventing default check action after manual check action'); event.preventDefault(); } @@ -763,7 +763,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index 44daee6281..aaca873f3a 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -27,7 +27,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -573,7 +573,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 9439735f4c..c105f83316 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -30,7 +30,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -1809,7 +1809,7 @@ return $module.data(metadata.defaultValue); }, placeholderText: function () { - if (settings.placeholder != 'auto' && typeof settings.placeholder == 'string') { + if (settings.placeholder != 'auto' && typeof settings.placeholder === 'string') { return settings.placeholder; } @@ -1917,7 +1917,7 @@ } return (!module.has.selectInput() && module.is.multiple()) - ? (typeof value == 'string') // delimited string + ? (typeof value === 'string') // delimited string ? (raw ? value : module.escape.htmlEntities(value)).split(settings.delimiter) : '' : value; @@ -1928,7 +1928,7 @@ remoteValues = false ; if (values) { - if (typeof values == 'string') { + if (typeof values === 'string') { values = [values]; } $.each(values, function (index, value) { @@ -3852,7 +3852,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/embed.js b/src/definitions/modules/embed.js index f5e0ce438f..e96320bcc9 100644 --- a/src/definitions/modules/embed.js +++ b/src/definitions/modules/embed.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -29,7 +29,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -490,7 +490,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/flyout.js b/src/definitions/modules/flyout.js index 23d5fbb31c..bb74ff2047 100644 --- a/src/definitions/modules/flyout.js +++ b/src/definitions/modules/flyout.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -34,7 +34,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame @@ -1232,7 +1232,7 @@ ; passedArguments = passedArguments || queryArguments; context = element || context; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 06a28e9934..fd8941acb8 100755 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -32,7 +32,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame @@ -1240,7 +1240,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/nag.js b/src/definitions/modules/nag.js index 6b69b56bb7..99d46e6ac4 100644 --- a/src/definitions/modules/nag.js +++ b/src/definitions/modules/nag.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -403,7 +403,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index ef75c0a245..96ed21c1da 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -36,7 +36,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -1242,7 +1242,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/progress.js b/src/definitions/modules/progress.js index e901823007..47d56713e2 100644 --- a/src/definitions/modules/progress.js +++ b/src/definitions/modules/progress.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -29,7 +29,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue @@ -109,7 +109,7 @@ ? element : !isNaN(element) ? [element] - : typeof element == 'string' + : typeof element === 'string' ? element.split(',') : []; }, @@ -486,7 +486,7 @@ }, duration: function (duration) { duration = duration || settings.duration; - duration = (typeof duration == 'number') + duration = (typeof duration === 'number') ? duration + 'ms' : duration; module.verbose('Setting progress bar transition duration', duration); @@ -498,7 +498,7 @@ }, percent: function (percents) { percents = module.helper.forceArray(percents).map(function (percent) { - percent = (typeof percent == 'string') + percent = (typeof percent === 'string') ? +(percent.replace('%', '')) : percent; @@ -858,7 +858,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/rating.js b/src/definitions/modules/rating.js index 015d1fa5ce..0438dffb00 100644 --- a/src/definitions/modules/rating.js +++ b/src/definitions/modules/rating.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -410,7 +410,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/search.js b/src/definitions/modules/search.js index 244728e52a..cb7db09a56 100644 --- a/src/definitions/modules/search.js +++ b/src/definitions/modules/search.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -663,7 +663,7 @@ $.each(searchFields, function (index, field) { $.each(source, function (label, content) { var - fieldExists = (typeof content[field] == 'string') || (typeof content[field] == 'number') + fieldExists = (typeof content[field] === 'string') || (typeof content[field] === 'number') ; if (fieldExists) { var text; @@ -807,7 +807,7 @@ if (settings.cache) { module.verbose('Checking cache for generated html for query', name); - return (typeof cache == 'object') && (cache[name] !== undefined) + return (typeof cache === 'object') && (cache[name] !== undefined) ? cache[name] : false; } @@ -1183,7 +1183,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/shape.js b/src/definitions/modules/shape.js index bb69941326..323399380f 100644 --- a/src/definitions/modules/shape.js +++ b/src/definitions/modules/shape.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -27,7 +27,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame @@ -209,7 +209,7 @@ duration: function (duration) { duration = duration || settings.duration; - duration = (typeof duration == 'number') + duration = (typeof duration === 'number') ? duration + 'ms' : duration; module.verbose('Setting animation duration', duration); @@ -700,7 +700,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/sidebar.js b/src/definitions/modules/sidebar.js index 66624243c6..5b2a934f07 100644 --- a/src/definitions/modules/sidebar.js +++ b/src/definitions/modules/sidebar.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -34,7 +34,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), requestAnimationFrame = window.requestAnimationFrame @@ -958,7 +958,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/slider.js b/src/definitions/modules/slider.js index 7be83d8883..c1ab97c21c 100644 --- a/src/definitions/modules/slider.js +++ b/src/definitions/modules/slider.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -31,7 +31,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'], @@ -1198,7 +1198,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/sticky.js b/src/definitions/modules/sticky.js index d30b359504..463b8f9016 100755 --- a/src/definitions/modules/sticky.js +++ b/src/definitions/modules/sticky.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -29,7 +29,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -791,7 +791,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/tab.js b/src/definitions/modules/tab.js index b7cc02ea39..01b708be6f 100644 --- a/src/definitions/modules/tab.js +++ b/src/definitions/modules/tab.js @@ -19,7 +19,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -35,7 +35,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), initializedHistory = false, @@ -288,7 +288,7 @@ set: { auto: function () { var - url = (typeof settings.path == 'string') + url = (typeof settings.path === 'string') ? settings.path.replace(/\/$/, '') + '/{$tab}' : '/{$tab}' ; @@ -452,7 +452,7 @@ evaluateScripts = (evaluateScripts !== undefined) ? evaluateScripts : settings.evaluateScripts; - if (typeof settings.cacheType == 'string' && settings.cacheType.toLowerCase() == 'dom' && typeof html !== 'string') { + if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() == 'dom' && typeof html !== 'string') { $tab .empty() .append($(html).clone(true)) @@ -498,7 +498,7 @@ if (settings.loadOnce) { module.cache.add(fullTabPath, true); - } else if (typeof settings.cacheType == 'string' && settings.cacheType.toLowerCase() == 'dom' && $tab.children().length > 0) { + } else if (typeof settings.cacheType === 'string' && settings.cacheType.toLowerCase() == 'dom' && $tab.children().length > 0) { setTimeout(function () { var $clone = $tab.children().clone(true) @@ -716,7 +716,7 @@ pathName = activeTabPath; } - return typeof pathName == 'string' + return typeof pathName === 'string' ? pathName.split('/') : [pathName]; }, @@ -835,7 +835,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/toast.js b/src/definitions/modules/toast.js index 9ca4cc1bc9..35f69803d0 100644 --- a/src/definitions/modules/toast.js +++ b/src/definitions/modules/toast.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -28,7 +28,7 @@ performance = [], query = arguments[0], - methodInvoked = (typeof query == 'string'), + methodInvoked = (typeof query === 'string'), queryArguments = [].slice.call(arguments, 1), returnedValue ; @@ -711,7 +711,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) { diff --git a/src/definitions/modules/transition.js b/src/definitions/modules/transition.js index 544ab00d2f..f0196eef02 100644 --- a/src/definitions/modules/transition.js +++ b/src/definitions/modules/transition.js @@ -15,7 +15,7 @@ return typeof obj === 'function' && typeof obj.nodeType !== 'number'; } - window = (typeof window != 'undefined' && window.Math == Math) + window = (window !== undefined && window.Math === Math) ? window : globalThis; @@ -314,7 +314,7 @@ }, duration: function (animationName, duration) { duration = duration || settings.duration; - duration = (typeof duration == 'number') + duration = (typeof duration === 'number') ? duration + 'ms' : duration; if (duration || duration === 0) { @@ -488,24 +488,24 @@ }, get: { settings: function (animation, duration, onComplete) { - if (typeof animation == 'object') { // single settings object + if (typeof animation === 'object') { // single settings object return $.extend(true, {}, $.fn.transition.settings, animation); - } else if (typeof onComplete == 'function') { // all arguments provided + } else if (typeof onComplete === 'function') { // all arguments provided return $.extend({}, $.fn.transition.settings, { animation: animation, onComplete: onComplete, duration: duration, }); - } else if (typeof duration == 'string' || typeof duration == 'number') { // only duration provided + } else if (typeof duration === 'string' || typeof duration === 'number') { // only duration provided return $.extend({}, $.fn.transition.settings, { animation: animation, duration: duration, }); - } else if (typeof duration == 'object') { // duration is actually settings object + } else if (typeof duration === 'object') { // duration is actually settings object return $.extend({}, $.fn.transition.settings, duration, { animation: animation, }); - } else if (typeof duration == 'function') { // duration is actually callback + } else if (typeof duration === 'function') { // duration is actually callback return $.extend({}, $.fn.transition.settings, { animation: animation, onComplete: duration, @@ -933,7 +933,7 @@ ; passedArguments = passedArguments || queryArguments; context = context || element; - if (typeof query == 'string' && object !== undefined) { + if (typeof query === 'string' && object !== undefined) { query = query.split(/[\. ]/); maxDepth = query.length - 1; $.each(query, function (depth, value) {