Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion angular/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export { IonicRouteStrategy } from './util/ionic-router-reuse-strategy';
export { IonicModule } from './ionic-module';

// UTILS
export { IonicSafeString } from '@ionic/core';
export { IonicSafeString, getPlatforms, isPlatform } from '@ionic/core';

// CORE TYPES
export { Animation, AnimationBuilder, AnimationCallbackOptions, AnimationDirection, AnimationFill, AnimationKeyFrames, AnimationLifecycle, Gesture, GestureConfig, GestureDetail, mdTransitionAnimation, iosTransitionAnimation } from '@ionic/core';
4 changes: 3 additions & 1 deletion core/src/utils/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface IsPlatformSignature {
(win: Window, plt: Platforms): boolean;
}

export const getPlatforms = (win: any) => setupPlatforms(win);
export const getPlatforms = (win?: any) => setupPlatforms(win);

export const isPlatform: IsPlatformSignature = (winOrPlatform: Window | Platforms | undefined, platform?: Platforms) => {
if (typeof winOrPlatform === 'string') {
Expand All @@ -17,6 +17,8 @@ export const isPlatform: IsPlatformSignature = (winOrPlatform: Window | Platform
};

export const setupPlatforms = (win: any = window) => {
if (typeof win === 'undefined') { return []; }

win.Ionic = win.Ionic || {};

let platforms: Platforms[] | undefined | null = win.Ionic.platforms;
Expand Down