Skip to content

Commit

Permalink
refactor: copy-paste behaviour from ng-web-apis platform (#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 11, 2024
1 parent 3833db0 commit 8396077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
13 changes: 0 additions & 13 deletions projects/ng-event-plugins/src/utils/is-apple.ts

This file was deleted.

13 changes: 3 additions & 10 deletions projects/ng-event-plugins/src/utils/is-ios.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import {isApple} from './is-apple';

const IOS_REG_EXP = /ipad|iphone|ipod/;

export function isIos(navigator: Navigator): boolean {
return (
IOS_REG_EXP.test(navigator.userAgent.toLowerCase()) ||
(isApple(navigator) && navigator.maxTouchPoints > 1)
);
}
export const isIos = ({userAgent, maxTouchPoints}: Navigator): boolean =>
/ipad|iphone|ipod|mac/i.test(userAgent) ||
(/^((?!chrome|android).)*safari/i.test(userAgent) && maxTouchPoints > 1);

0 comments on commit 8396077

Please sign in to comment.