perf(all): minify better by using arrow functions (#18730)

This commit is contained in:
Manu MA
2019-07-10 16:33:33 +02:00
committed by Brandy Carney
parent 8beeff2c52
commit 03c1d19e07
99 changed files with 653 additions and 679 deletions

View File

@ -531,26 +531,26 @@ export class Menu implements ComponentInterface, MenuI {
}
}
function computeDelta(
const computeDelta = (
deltaX: number,
isOpen: boolean,
isEndSide: boolean
): number {
): number => {
return Math.max(0, isOpen !== isEndSide ? -deltaX : deltaX);
}
};
function checkEdgeSide(
const checkEdgeSide = (
win: Window,
posX: number,
isEndSide: boolean,
maxEdgeStart: number
): boolean {
): boolean => {
if (isEndSide) {
return posX >= win.innerWidth - maxEdgeStart;
} else {
return posX <= maxEdgeStart;
}
}
};
const SHOW_MENU = 'show-menu';
const SHOW_BACKDROP = 'show-backdrop';

View File

@ -2,12 +2,12 @@ import { newE2EPage } from '@stencil/core/testing';
import { generateE2EUrl } from '../../../utils/test/utils';
export async function testMenu(
export const testMenu = async (
type: string,
selector: string,
menuId = '',
rtl = false
) {
) => {
try {
const pageUrl = generateE2EUrl('menu', type, rtl);
@ -41,4 +41,4 @@ export async function testMenu(
} catch (err) {
throw err;
}
}
};