From 178e5f6ef775acfaa1585d2b50a2561009cf0f1e Mon Sep 17 00:00:00 2001 From: djmaze Date: Wed, 22 Jul 2020 10:54:28 +0200 Subject: [PATCH] Remove _.isNull --- dev/Common/Translator.js | 4 ++-- dev/Common/Utils.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dev/Common/Translator.js b/dev/Common/Translator.js index af18c2238..345d91536 100644 --- a/dev/Common/Translator.js +++ b/dev/Common/Translator.js @@ -3,7 +3,7 @@ import _ from '_'; import $ from '$'; import ko from 'ko'; import { Notification, UploadErrorCode } from 'Common/Enums'; -import { pInt, isUnd, isNull, microtime } from 'Common/Utils'; +import { pInt, isUnd, microtime } from 'Common/Utils'; import { $html, $htmlCL } from 'Common/Globals'; import { reload as momentorReload } from 'Common/Momentor'; import { langLink } from 'Common/Links'; @@ -98,7 +98,7 @@ export function i18n(key, valueList, defaulValue) { result = isUnd(defaulValue) ? key : defaulValue; } - if (!isUnd(valueList) && !isNull(valueList)) { + if (!isUnd(valueList) && null !== valueList) { for (valueName in valueList) { if (Object.prototype.hasOwnProperty.call(valueList, valueName)) { result = result.replace('%' + valueName + '%', valueList[valueName]); diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 438963a39..fbfad8253 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -14,12 +14,11 @@ const isArray = Array.isArray; const isObject = _.isObject; const isFunc = _.isFunction; const isUnd = _.isUndefined; -const isNull = _.isNull; const noop = () => {}; // eslint-disable-line no-empty-function const noopTrue = () => true; const noopFalse = () => false; -export { trim, isArray, isObject, isFunc, isUnd, isNull, noop, noopTrue, noopFalse, jassl }; +export { trim, isArray, isObject, isFunc, isUnd, noop, noopTrue, noopFalse, jassl }; /** * @param {Function} func @@ -35,7 +34,7 @@ export function silentTryCatch(func) { * @returns {boolean} */ export function isNormal(value) { - return !isUnd(value) && !isNull(value); + return !isUnd(value) && null !== value; } /** @@ -1445,7 +1444,7 @@ export function domReady(fn) { } export const windowResize = _.debounce((timeout) => { - if (isUnd(timeout) || isNull(timeout)) { + if (isUnd(timeout) || null === timeout) { $win.trigger('resize'); } else { window.setTimeout(() => {