Underscore.js _.find() to native Array.find()

This commit is contained in:
djmaze 2020-07-22 10:43:19 +02:00
parent 2404f6466d
commit 9c0072d626
19 changed files with 55 additions and 79 deletions

View file

@ -1,5 +1,4 @@
import window from 'window';
import _ from '_';
import $ from '$';
import key from 'key';
import ko from 'ko';
@ -152,15 +151,7 @@ export const htmlEditorLangsMap = {
/**
* @type {boolean}
*/
let bAllowPdfPreview = !bMobileDevice;
if (bAllowPdfPreview && window.navigator && window.navigator.mimeTypes) {
bAllowPdfPreview = !!_.find(window.navigator.mimeTypes, (type) => type && 'application/pdf' === type.type);
if (!bAllowPdfPreview) {
bAllowPdfPreview = 'undefined' !== typeof window.navigator.mimeTypes['application/pdf'];
}
}
let bAllowPdfPreview = !bMobileDevice && undefined !== window.navigator.mimeTypes['application/pdf'];
export { bAllowPdfPreview };