We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f51f8a2 commit eaef450Copy full SHA for eaef450
README.md
@@ -109,6 +109,7 @@ isCode, // 是否是验证码,长度默认为6,第二个参数可修改
109
isFunction // 是否是函数
110
isTrue // 是否是布尔 true 或者是字符 'true'
111
isURL // 是否是 URL
112
+inBrowser // 是否在浏览器
113
```
114
### cloneDeep
115
```js
src/test.ts
@@ -114,3 +114,8 @@ export const isTrue = (val: unknown) => val === true || val === 'true'
export const isURL = (url: string): boolean => {
return /^((ht|f)tps?):\/\/?/.test(url)
116
}
117
+
118
+/**
119
+ * 是否在浏览器中
120
+ */
121
+export const inBrowser = typeof window !== 'undefined'
0 commit comments