MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / setupPlatforms

Function setupPlatforms

core/src/utils/platform.ts:25–38  ·  view source on GitHub ↗
(win: any = window)

Source from the content-addressed store, hash-verified

23};
24
25export const setupPlatforms = (win: any = window) => {
26 if (typeof win === 'undefined') {
27 return [];
28 }
29
30 win.Ionic = win.Ionic || {};
31
32 let platforms: Platforms[] | undefined | null = win.Ionic.platforms;
33 if (platforms == null) {
34 platforms = win.Ionic.platforms = detectPlatforms(win);
35 platforms.forEach((p) => win.document.documentElement.classList.add(`plt-${p}`));
36 }
37 return platforms;
38};
39
40const detectPlatforms = (win: Window) => {
41 const customPlatformMethods = config.get('platform');

Callers 2

initializeFunction · 0.90
getPlatformsFunction · 0.85

Calls 2

detectPlatformsFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected