Remove _.isNull

This commit is contained in:
djmaze 2020-07-22 10:54:28 +02:00
parent 9c0072d626
commit 178e5f6ef7
2 changed files with 5 additions and 6 deletions

View file

@ -3,7 +3,7 @@ import _ from '_';
import $ from '$'; import $ from '$';
import ko from 'ko'; import ko from 'ko';
import { Notification, UploadErrorCode } from 'Common/Enums'; 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 { $html, $htmlCL } from 'Common/Globals';
import { reload as momentorReload } from 'Common/Momentor'; import { reload as momentorReload } from 'Common/Momentor';
import { langLink } from 'Common/Links'; import { langLink } from 'Common/Links';
@ -98,7 +98,7 @@ export function i18n(key, valueList, defaulValue) {
result = isUnd(defaulValue) ? key : defaulValue; result = isUnd(defaulValue) ? key : defaulValue;
} }
if (!isUnd(valueList) && !isNull(valueList)) { if (!isUnd(valueList) && null !== valueList) {
for (valueName in valueList) { for (valueName in valueList) {
if (Object.prototype.hasOwnProperty.call(valueList, valueName)) { if (Object.prototype.hasOwnProperty.call(valueList, valueName)) {
result = result.replace('%' + valueName + '%', valueList[valueName]); result = result.replace('%' + valueName + '%', valueList[valueName]);

View file

@ -14,12 +14,11 @@ const isArray = Array.isArray;
const isObject = _.isObject; const isObject = _.isObject;
const isFunc = _.isFunction; const isFunc = _.isFunction;
const isUnd = _.isUndefined; const isUnd = _.isUndefined;
const isNull = _.isNull;
const noop = () => {}; // eslint-disable-line no-empty-function const noop = () => {}; // eslint-disable-line no-empty-function
const noopTrue = () => true; const noopTrue = () => true;
const noopFalse = () => false; 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 * @param {Function} func
@ -35,7 +34,7 @@ export function silentTryCatch(func) {
* @returns {boolean} * @returns {boolean}
*/ */
export function isNormal(value) { 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) => { export const windowResize = _.debounce((timeout) => {
if (isUnd(timeout) || isNull(timeout)) { if (isUnd(timeout) || null === timeout) {
$win.trigger('resize'); $win.trigger('resize');
} else { } else {
window.setTimeout(() => { window.setTimeout(() => {