isArray to native Array.isArray

isUnd(*) to native undefined === *
isFunc to native typeof * === 'function'
isObject to native typeof * === 'object'
microtime() to native Date().getTime();
noop to native ()=>{}
noopFalse to native ()=>false
noopTrue to native ()=>true
boolToAjax to native *?'1':'0'
Underscore.js to native
This commit is contained in:
djmaze 2020-07-29 21:49:41 +02:00
parent fa39c7ecba
commit ea48f5060b
72 changed files with 551 additions and 775 deletions

View file

@ -1,5 +1,5 @@
import { MessageSetAction } from 'Common/Enums';
import { trim, pInt, isArray } from 'Common/Utils';
import { trim, pInt } from 'Common/Utils';
let FOLDERS_CACHE = {},
FOLDERS_NAME_CACHE = {},
@ -266,7 +266,7 @@ export function storeMessageFlagsToCache(message) {
* @param {Array} flags
*/
export function storeMessageFlagsToCacheByFolderAndUid(folder, uid, flags) {
if (isArray(flags) && flags.length) {
if (Array.isArray(flags) && flags.length) {
setMessageFlagsToCache(folder, uid, flags);
}
}
@ -280,7 +280,7 @@ export function storeMessageFlagsToCacheBySetAction(folder, uid, setAction) {
let unread = 0;
const flags = getMessageFlagsFromCache(folder, uid);
if (isArray(flags) && flags.length) {
if (Array.isArray(flags) && flags.length) {
if (flags[0]) {
unread = 1;
}