Skip to content

Commit

Permalink
feat: reserve IS_WECHATBROWSER
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyongyi committed Aug 30, 2023
1 parent 062d71c commit 004e14f
Show file tree
Hide file tree
Showing 3 changed files with 4,122 additions and 3,353 deletions.
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
nodeLinker: node-modules

packageExtensions:
eslint-module-utils@*:
dependencies:
Expand Down
6 changes: 6 additions & 0 deletions packages/slate-react/src/utils/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export const IS_FIREFOX_LEGACY =
export const IS_UC_MOBILE =
typeof navigator !== 'undefined' && /.*UCBrowser/.test(navigator.userAgent)

// Wechat browser (not including mac wechat)
export const IS_WECHATBROWSER =
typeof navigator !== 'undefined' &&
/.*Wechat/.test(navigator.userAgent) &&
!/.*MacWechat/.test(navigator.userAgent) // avoid lookbehind (buggy in safari < 16.4)

// Check if DOM is available as React does internally.
// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js
export const CAN_USE_DOM = !!(
Expand Down
Loading

0 comments on commit 004e14f

Please sign in to comment.