Skip to content

Commit

Permalink
doc: added documentation to hasRelatedAppInstalled method
Browse files Browse the repository at this point in the history
  • Loading branch information
teclone committed Jun 16, 2021
1 parent 44c56d2 commit 3193453
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/browser/hasRelatedAppInstalled/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { isBrowser } from '../../helpers';
import { getGlobal } from '../getGlobal';

/**
* checks if the application has related apps installed
* checks if the application has related apps installed,
* this method causes the browser to load your manifest json file
* @param appPackageName
*/
export const hasRelatedAppInstalled = (
appPackageName: string
): Promise<boolean> => {
const global = getGlobal();
if (global && 'getInstalledRelatedApps' in global.navigator) {
if (isBrowser && 'getInstalledRelatedApps' in global.navigator) {
return global.navigator.getInstalledRelatedApps().then((results) => {
return (
results.length > 0 &&
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export * from './array';
export * from './function';
export * from './generators';
export * from './browser';
export { CASE_STYLES } from './constants';
export * from './constants';

0 comments on commit 3193453

Please sign in to comment.