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 window from 'window';
import { pString, pInt, isUnd, isNormal, trim, encodeURIComponent } from 'Common/Utils';
import { pString, pInt, isNormal, trim } from 'Common/Utils';
import * as Settings from 'Storage/Settings';
const ROOT = './',
@ -58,7 +58,7 @@ export function rootUser() {
* @returns {string}
*/
export function attachmentRaw(type, download, customSpecSuffix) {
customSpecSuffix = isUnd(customSpecSuffix) ? AUTH_PREFIX : customSpecSuffix;
customSpecSuffix = undefined === customSpecSuffix ? AUTH_PREFIX : customSpecSuffix;
return (
SERVER_PREFIX +
'/Raw/' +
@ -160,7 +160,7 @@ export function append() {
* @returns {string}
*/
export function change(email) {
return serverRequest('Change') + encodeURIComponent(email) + '/';
return serverRequest('Change') + window.encodeURIComponent(email) + '/';
}
/**
@ -204,7 +204,7 @@ export function messageDownloadLink(requestHash) {
* @returns {string}
*/
export function avatarLink(email) {
return SERVER_PREFIX + '/Raw/0/Avatar/' + encodeURIComponent(email) + '/';
return SERVER_PREFIX + '/Raw/0/Avatar/' + window.encodeURIComponent(email) + '/';
}
/**