JavaScript inArray()/indexOf() to .includes()

This commit is contained in:
djmaze 2020-07-20 14:33:33 +02:00
parent ec3fd5b7e4
commit db2d95d684
20 changed files with 69 additions and 86 deletions

View file

@ -1,5 +1,5 @@
import window from 'window';
import { isUnd, isNormal, isArray, inArray } from 'Common/Utils';
import { isUnd, isNormal, isArray } from 'Common/Utils';
let SETTINGS = window.__rlah_data() || null;
SETTINGS = isNormal(SETTINGS) ? SETTINGS : {};
@ -37,5 +37,5 @@ export function appSettingsGet(name) {
*/
export function capa(name) {
const values = settingsGet('Capa');
return isArray(values) && isNormal(name) && -1 < inArray(name, values);
return isArray(values) && isNormal(name) && values.includes(name);
}