mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
perf(all): minify better by using arrow functions (#18730)
This commit is contained in:
@ -46,7 +46,7 @@ export class ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
export function matches(view: ViewController | undefined, id: string, params: ComponentProps | undefined): view is ViewController {
|
||||
export const matches = (view: ViewController | undefined, id: string, params: ComponentProps | undefined): view is ViewController => {
|
||||
if (!view) {
|
||||
return false;
|
||||
}
|
||||
@ -76,9 +76,9 @@ export function matches(view: ViewController | undefined, id: string, params: Co
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
export function convertToView(page: any, params: ComponentProps | undefined): ViewController | null {
|
||||
export const convertToView = (page: any, params: ComponentProps | undefined): ViewController | null => {
|
||||
if (!page) {
|
||||
return null;
|
||||
}
|
||||
@ -86,9 +86,9 @@ export function convertToView(page: any, params: ComponentProps | undefined): Vi
|
||||
return page;
|
||||
}
|
||||
return new ViewController(page, params);
|
||||
}
|
||||
};
|
||||
|
||||
export function convertToViews(pages: any[]): ViewController[] {
|
||||
export const convertToViews = (pages: any[]): ViewController[] => {
|
||||
return pages.map(page => {
|
||||
if (page instanceof ViewController) {
|
||||
return page;
|
||||
@ -98,4 +98,4 @@ export function convertToViews(pages: any[]): ViewController[] {
|
||||
}
|
||||
return convertToView(page, undefined);
|
||||
}).filter(v => v !== null) as ViewController[];
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user