os-detect 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Danil Lisin Vladimirovich (macrulez)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,38 +1,218 @@
1
- # os-detect
1
+ <div align="center" style="background:#111827;border-radius:20px;padding:28px 20px 20px;margin-bottom:32px">
2
+ <h1 style="color:#f9fafb;margin:0 0 32px;font-size:2.2em;letter-spacing:-0.03em;font-weight:700;font-family:sans-serif">
3
+ os-detect
4
+ </h1>
5
+ <img
6
+ src="https://s3.twcstorage.ru/c9a2cc89-780f97fd-311d-4a1a-b86f-c25665c9dc46/images/npm/os-detect.webp"
7
+ alt="vue-virtual-scroller-kit"
8
+ style="max-width:100%;width:auto;height:300px;border-radius:12px"
9
+ />
10
+ </div>
2
11
 
3
- Simple OS and device type detection for browsers (no dependencies).
12
+ A lightweight utility for detecting the operating system and device type in browsers, Node.js, and SSR. With React hooks and Vue composables. No dependencies.
4
13
 
5
14
  ## Installation
6
15
 
7
- ```
16
+ ```bash
8
17
  npm install os-detect
9
18
  ```
10
19
 
11
20
  ## Usage
12
21
 
22
+ ```ts
23
+ import {
24
+ getOS,
25
+ detectIsIOS, detectIsMacOS, detectIsAndroid,
26
+ detectIsWindows, detectIsLinux, detectIsChromeOS,
27
+ detectIsWindows11,
28
+ isMobileDevice, isDesktopDevice,
29
+ } from 'os-detect';
30
+
31
+ // Get OS as a string
32
+ getOS(); // 'ios' | 'macos' | 'android' | 'windows' | 'linux' | 'chromeos' | 'unknown'
33
+
34
+ // Boolean detection
35
+ detectIsIOS(); // true on iPhone, iPod, iPad (including iPadOS 13+)
36
+ detectIsMacOS(); // true on macOS desktop (correctly excludes iPadOS 13+)
37
+ detectIsAndroid(); // true on Android phones and tablets
38
+ detectIsWindows(); // true on Windows desktop or laptop
39
+ detectIsLinux(); // true on Linux desktop (excludes Android and ChromeOS)
40
+ detectIsChromeOS(); // true on ChromeOS devices
41
+
42
+ // Async: Windows 11 check
43
+ const isWin11 = await detectIsWindows11(); // true | false
44
+
45
+ // Device category
46
+ isMobileDevice(); // true if iOS or Android
47
+ isDesktopDevice(); // true if macOS, Windows, Linux, or ChromeOS
48
+ ```
49
+
50
+ CommonJS:
13
51
  ```js
14
- const osDetect = require('os-detect');
52
+ const { getOS, detectIsIOS, isMobileDevice } = require('os-detect');
53
+ ```
54
+
55
+ UMD via `<script>` tag:
56
+ ```html
57
+ <script src="https://unpkg.com/os-detect/dist/index.umd.js"></script>
58
+ <script>
59
+ console.log(OsDetect.getOS());
60
+ console.log(OsDetect.detectIsIOS());
61
+ console.log(OsDetect.isMobileDevice());
62
+ </script>
63
+ ```
64
+
65
+ ---
66
+
67
+ ## React
68
+
69
+ ```tsx
70
+ import { useOS, useIsWindows11 } from 'os-detect/react';
71
+
72
+ function App() {
73
+ const os = useOS(); // 'windows' | 'macos' | 'ios' | ...
74
+ const isWin11 = useIsWindows11(); // null (loading) → true | false
75
+
76
+ return (
77
+ <div>
78
+ <p>OS: {os}</p>
79
+ {isWin11 === null && <p>Detecting Windows version...</p>}
80
+ {isWin11 === true && <p>Windows 11</p>}
81
+ {isWin11 === false && os === 'windows' && <p>Windows 10 or older</p>}
82
+ </div>
83
+ );
84
+ }
85
+ ```
86
+
87
+ Requires React 17+.
88
+
89
+ ---
90
+
91
+ ## Vue
92
+
93
+ ```vue
94
+ <script setup lang="ts">
95
+ import { useOS, useIsWindows11 } from 'os-detect/vue';
96
+
97
+ const os = useOS(); // Readonly<Ref<OS>>
98
+ const isWin11 = useIsWindows11(); // Readonly<Ref<boolean | null>>
99
+ </script>
100
+
101
+ <template>
102
+ <p>OS: {{ os }}</p>
103
+ <p v-if="isWin11 === null">Detecting Windows version...</p>
104
+ <p v-else-if="isWin11">Windows 11</p>
105
+ <p v-else-if="os === 'windows'">Windows 10 or older</p>
106
+ </template>
107
+ ```
108
+
109
+ Requires Vue 3+.
110
+
111
+ ---
112
+
113
+ ## Node.js & SSR
114
+
115
+ All functions work in Node.js via `process.platform`:
116
+
117
+ ```ts
118
+ import { getOS, detectIsWindows, detectIsWindows11 } from 'os-detect';
119
+
120
+ // Reads process.platform — no browser required
121
+ getOS(); // 'macos' | 'windows' | 'linux' | 'android' | 'unknown'
122
+ detectIsWindows(); // true on Windows
15
123
 
16
- console.log(osDetect.detectIsiOS()); // true/false
17
- console.log(osDetect.detectIsMacOS()); // true/false
18
- console.log(osDetect.detectIsAndroid()); // true/false
19
- console.log(osDetect.detectIsWindows()); // true/false
20
- console.log(osDetect.detectIsLinux()); // true/false
21
- console.log(osDetect.isMobileDevice()); // true/false
22
- console.log(osDetect.isDesktopDevice()); // true/false
124
+ // Windows 11 via os.release() build number (>= 22000)
125
+ const isWin11 = await detectIsWindows11();
23
126
  ```
24
127
 
25
- ## API
128
+ | `process.platform` | Detected as |
129
+ |---|---|
130
+ | `darwin` | macOS |
131
+ | `win32` | Windows (32-bit and 64-bit) |
132
+ | `linux` | Linux |
133
+ | `android` | Android |
26
134
 
27
- - `detectIsiOS()`
28
- - `detectIsMacOS()`
29
- - `detectIsAndroid()`
30
- - `detectIsWindows()`
31
- - `detectIsLinux()`
32
- - `isMobileDevice()`
33
- - `isDesktopDevice()`
135
+ Functions that require a browser environment (`detectIsIOS()`, `detectIsChromeOS()`) always return `false` in Node.js.
136
+
137
+ > **SSR hydration note**: In Next.js / Nuxt SSR, `getOS()` returns the **server's** OS, not the client's. To avoid hydration mismatches, wrap detection in `useEffect` (React) or `onMounted` (Vue) so it runs only on the client.
138
+
139
+ ---
140
+
141
+ ## API Reference
142
+
143
+ ### OS String Detection
144
+
145
+ | Function | Returns |
146
+ |---|---|
147
+ | `getOS()` | `'ios'` \| `'macos'` \| `'android'` \| `'windows'` \| `'linux'` \| `'chromeos'` \| `'unknown'` |
148
+
149
+ ### Boolean Detection
150
+
151
+ | Function | Returns `true` when | Node.js |
152
+ |---|---|---|
153
+ | `detectIsIOS()` | iPhone, iPod, or iPad (including iPadOS 13+) | always `false` |
154
+ | `detectIsMacOS()` | macOS desktop (excludes iPadOS 13+) | `process.platform === 'darwin'` |
155
+ | `detectIsAndroid()` | Android phones and tablets | `process.platform === 'android'` |
156
+ | `detectIsWindows()` | Windows desktop or laptop | `process.platform === 'win32'` |
157
+ | `detectIsLinux()` | Linux desktop (excludes Android and ChromeOS) | `process.platform === 'linux'` |
158
+ | `detectIsChromeOS()` | ChromeOS devices | always `false` |
159
+ | `detectIsWindows11()` | Windows 11 — **async**, `Promise<boolean>` | via `os.release()` |
160
+
161
+ ### Device Category
162
+
163
+ | Function | Returns `true` when |
164
+ |---|---|
165
+ | `isMobileDevice()` | iOS or Android |
166
+ | `isDesktopDevice()` | macOS, Windows, Linux, or ChromeOS |
167
+
168
+ > `isMobileDevice()` and `isDesktopDevice()` are **not mutually exclusive** — a device with an unrecognized OS returns `false` for both.
169
+
170
+ ### React Hooks
171
+
172
+ Import from `os-detect/react`:
173
+
174
+ | Hook | Returns |
175
+ |---|---|
176
+ | `useOS()` | `OS` string — synchronous, cached |
177
+ | `useIsWindows11()` | `boolean \| null` — `null` while detecting |
178
+
179
+ ### Vue Composables
180
+
181
+ Import from `os-detect/vue`:
182
+
183
+ | Composable | Returns |
184
+ |---|---|
185
+ | `useOS()` | `Readonly<Ref<OS>>` — synchronous, cached |
186
+ | `useIsWindows11()` | `Readonly<Ref<boolean \| null>>` — `null` while detecting |
187
+
188
+ ---
189
+
190
+ ## Detection Strategy
191
+
192
+ **Browser**: prefers `navigator.userAgentData` (Chrome 90+ / Edge 90+), falls back to `navigator.userAgent` for all other browsers.
193
+
194
+ **Node.js**: reads `process.platform` when `navigator` is absent.
195
+
196
+ Results are cached after the first call — subsequent calls have zero overhead.
197
+
198
+ `detectIsWindows11()` in the browser uses `userAgentData.getHighEntropyValues(['platformVersion'])` — Windows 11 reports `platformVersion >= 13.0.0`. In Node.js it uses `os.release()` — Windows 11 has build number `>= 22000`. Returns `false` if the API is unavailable or the call fails.
199
+
200
+ ### iPadOS 13+ note
201
+
202
+ Since iPadOS 13, Safari sends `Macintosh` in the userAgent string. `detectIsIOS()` correctly identifies these devices using `navigator.maxTouchPoints > 1`, and `detectIsMacOS()` excludes them accordingly.
203
+
204
+ ---
205
+
206
+ ## Migration from v1.x
207
+
208
+ `detectIsiOS()` was renamed to `detectIsIOS()`. The old name still works but logs a deprecation warning and will be removed in v3.0.
209
+
210
+ ```ts
211
+ detectIsiOS() // deprecated — logs console.warn
212
+ detectIsIOS() // use this instead
213
+ ```
34
214
 
35
- All functions return a boolean.
215
+ ---
36
216
 
37
217
  ## Author
38
218
 
@@ -0,0 +1,28 @@
1
+ declare function detectIsIOS(): boolean;
2
+ declare function detectIsMacOS(): boolean;
3
+ declare function detectIsAndroid(): boolean;
4
+ declare function detectIsWindows(): boolean;
5
+ declare function detectIsChromeOS(): boolean;
6
+ declare function detectIsLinux(): boolean;
7
+ declare function detectIsWindows11(): Promise<boolean>;
8
+ type OS = 'ios' | 'macos' | 'android' | 'windows' | 'linux' | 'chromeos' | 'unknown';
9
+ declare function getOS(): OS;
10
+ declare function isMobileDevice(): boolean;
11
+ declare function isDesktopDevice(): boolean;
12
+ /** @deprecated Use detectIsIOS() instead. Will be removed in v3.0. */
13
+ declare function detectIsiOS(): boolean;
14
+ declare const osDetect: {
15
+ detectIsIOS: typeof detectIsIOS;
16
+ detectIsMacOS: typeof detectIsMacOS;
17
+ detectIsAndroid: typeof detectIsAndroid;
18
+ detectIsWindows: typeof detectIsWindows;
19
+ detectIsLinux: typeof detectIsLinux;
20
+ detectIsChromeOS: typeof detectIsChromeOS;
21
+ detectIsWindows11: typeof detectIsWindows11;
22
+ getOS: typeof getOS;
23
+ isMobileDevice: typeof isMobileDevice;
24
+ isDesktopDevice: typeof isDesktopDevice;
25
+ detectIsiOS: typeof detectIsiOS;
26
+ };
27
+
28
+ export { type OS, osDetect as default, detectIsAndroid, detectIsChromeOS, detectIsIOS, detectIsLinux, detectIsMacOS, detectIsWindows, detectIsWindows11, detectIsiOS, getOS, isDesktopDevice, isMobileDevice };
@@ -0,0 +1,28 @@
1
+ declare function detectIsIOS(): boolean;
2
+ declare function detectIsMacOS(): boolean;
3
+ declare function detectIsAndroid(): boolean;
4
+ declare function detectIsWindows(): boolean;
5
+ declare function detectIsChromeOS(): boolean;
6
+ declare function detectIsLinux(): boolean;
7
+ declare function detectIsWindows11(): Promise<boolean>;
8
+ type OS = 'ios' | 'macos' | 'android' | 'windows' | 'linux' | 'chromeos' | 'unknown';
9
+ declare function getOS(): OS;
10
+ declare function isMobileDevice(): boolean;
11
+ declare function isDesktopDevice(): boolean;
12
+ /** @deprecated Use detectIsIOS() instead. Will be removed in v3.0. */
13
+ declare function detectIsiOS(): boolean;
14
+ declare const osDetect: {
15
+ detectIsIOS: typeof detectIsIOS;
16
+ detectIsMacOS: typeof detectIsMacOS;
17
+ detectIsAndroid: typeof detectIsAndroid;
18
+ detectIsWindows: typeof detectIsWindows;
19
+ detectIsLinux: typeof detectIsLinux;
20
+ detectIsChromeOS: typeof detectIsChromeOS;
21
+ detectIsWindows11: typeof detectIsWindows11;
22
+ getOS: typeof getOS;
23
+ isMobileDevice: typeof isMobileDevice;
24
+ isDesktopDevice: typeof isDesktopDevice;
25
+ detectIsiOS: typeof detectIsiOS;
26
+ };
27
+
28
+ export { type OS, osDetect as default, detectIsAndroid, detectIsChromeOS, detectIsIOS, detectIsLinux, detectIsMacOS, detectIsWindows, detectIsWindows11, detectIsiOS, getOS, isDesktopDevice, isMobileDevice };
package/dist/index.js ADDED
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default,
34
+ detectIsAndroid: () => detectIsAndroid,
35
+ detectIsChromeOS: () => detectIsChromeOS,
36
+ detectIsIOS: () => detectIsIOS,
37
+ detectIsLinux: () => detectIsLinux,
38
+ detectIsMacOS: () => detectIsMacOS,
39
+ detectIsWindows: () => detectIsWindows,
40
+ detectIsWindows11: () => detectIsWindows11,
41
+ detectIsiOS: () => detectIsiOS,
42
+ getOS: () => getOS,
43
+ isDesktopDevice: () => isDesktopDevice,
44
+ isMobileDevice: () => isMobileDevice
45
+ });
46
+ module.exports = __toCommonJS(index_exports);
47
+ var cachedIsIOS;
48
+ var cachedIsMacOS;
49
+ var cachedIsAndroid;
50
+ var cachedIsWindows;
51
+ var cachedIsLinux;
52
+ var cachedIsChromeOS;
53
+ function getUADataPlatform() {
54
+ if (typeof navigator === "undefined") return null;
55
+ const uaData = navigator.userAgentData;
56
+ if (uaData && typeof uaData.platform === "string") {
57
+ return uaData.platform.toLowerCase();
58
+ }
59
+ return null;
60
+ }
61
+ function getNodePlatform() {
62
+ if (typeof navigator !== "undefined") return null;
63
+ if (typeof process === "undefined" || typeof process.platform !== "string") return null;
64
+ return process.platform;
65
+ }
66
+ function detectIsIOS() {
67
+ if (typeof cachedIsIOS === "boolean") return cachedIsIOS;
68
+ if (typeof navigator === "undefined" || typeof window === "undefined") {
69
+ return cachedIsIOS = false;
70
+ }
71
+ const platform = getUADataPlatform();
72
+ if (platform !== null) {
73
+ cachedIsIOS = platform === "ios";
74
+ return cachedIsIOS;
75
+ }
76
+ const isClassicIOSUA = /iPhone|iPod/.test(navigator.userAgent);
77
+ const isIPadUA = /iPad/.test(navigator.userAgent);
78
+ const isIPadOS = /Macintosh/.test(navigator.userAgent) && typeof navigator.maxTouchPoints === "number" && navigator.maxTouchPoints > 1;
79
+ cachedIsIOS = isClassicIOSUA || isIPadUA || isIPadOS;
80
+ return cachedIsIOS;
81
+ }
82
+ function detectIsMacOS() {
83
+ if (typeof cachedIsMacOS === "boolean") return cachedIsMacOS;
84
+ const nodePlatform = getNodePlatform();
85
+ if (nodePlatform !== null) {
86
+ return cachedIsMacOS = nodePlatform === "darwin";
87
+ }
88
+ if (typeof navigator === "undefined") return cachedIsMacOS = false;
89
+ const platform = getUADataPlatform();
90
+ if (platform !== null) {
91
+ cachedIsMacOS = platform === "macos";
92
+ return cachedIsMacOS;
93
+ }
94
+ const isMacUA = /Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.userAgent);
95
+ cachedIsMacOS = isMacUA && !detectIsIOS();
96
+ return cachedIsMacOS;
97
+ }
98
+ function detectIsAndroid() {
99
+ if (typeof cachedIsAndroid === "boolean") return cachedIsAndroid;
100
+ const nodePlatform = getNodePlatform();
101
+ if (nodePlatform !== null) {
102
+ return cachedIsAndroid = nodePlatform === "android";
103
+ }
104
+ if (typeof navigator === "undefined") return cachedIsAndroid = false;
105
+ const platform = getUADataPlatform();
106
+ if (platform !== null) {
107
+ cachedIsAndroid = platform === "android";
108
+ return cachedIsAndroid;
109
+ }
110
+ cachedIsAndroid = /Android/.test(navigator.userAgent);
111
+ return cachedIsAndroid;
112
+ }
113
+ function detectIsWindows() {
114
+ if (typeof cachedIsWindows === "boolean") return cachedIsWindows;
115
+ const nodePlatform = getNodePlatform();
116
+ if (nodePlatform !== null) {
117
+ return cachedIsWindows = nodePlatform === "win32";
118
+ }
119
+ if (typeof navigator === "undefined") return cachedIsWindows = false;
120
+ const platform = getUADataPlatform();
121
+ if (platform !== null) {
122
+ cachedIsWindows = platform === "windows";
123
+ return cachedIsWindows;
124
+ }
125
+ cachedIsWindows = /Win32|Win64|Windows|WinCE/.test(navigator.userAgent);
126
+ return cachedIsWindows;
127
+ }
128
+ function detectIsChromeOS() {
129
+ if (typeof cachedIsChromeOS === "boolean") return cachedIsChromeOS;
130
+ if (typeof navigator === "undefined") return cachedIsChromeOS = false;
131
+ const platform = getUADataPlatform();
132
+ if (platform !== null) {
133
+ cachedIsChromeOS = platform === "chrome os" || platform === "chromeos";
134
+ return cachedIsChromeOS;
135
+ }
136
+ cachedIsChromeOS = /CrOS/.test(navigator.userAgent);
137
+ return cachedIsChromeOS;
138
+ }
139
+ function detectIsLinux() {
140
+ if (typeof cachedIsLinux === "boolean") return cachedIsLinux;
141
+ const nodePlatform = getNodePlatform();
142
+ if (nodePlatform !== null) {
143
+ return cachedIsLinux = nodePlatform === "linux";
144
+ }
145
+ if (typeof navigator === "undefined") return cachedIsLinux = false;
146
+ const platform = getUADataPlatform();
147
+ if (platform !== null) {
148
+ cachedIsLinux = platform === "linux";
149
+ return cachedIsLinux;
150
+ }
151
+ cachedIsLinux = /Linux/.test(navigator.userAgent) && !detectIsAndroid() && !detectIsChromeOS();
152
+ return cachedIsLinux;
153
+ }
154
+ async function detectIsWindows11() {
155
+ var _a, _b;
156
+ if (!detectIsWindows()) return false;
157
+ if (typeof navigator === "undefined" && typeof process !== "undefined") {
158
+ try {
159
+ const { release } = await import("os");
160
+ const buildNumber = parseInt((_a = release().split(".")[2]) != null ? _a : "0", 10);
161
+ return buildNumber >= 22e3;
162
+ } catch (e) {
163
+ return false;
164
+ }
165
+ }
166
+ try {
167
+ const nav = navigator;
168
+ if (!((_b = nav.userAgentData) == null ? void 0 : _b.getHighEntropyValues)) return false;
169
+ const { platformVersion } = await nav.userAgentData.getHighEntropyValues([
170
+ "platformVersion"
171
+ ]);
172
+ if (!platformVersion) return false;
173
+ const majorVersion = parseInt(platformVersion.split(".")[0], 10);
174
+ return majorVersion >= 13;
175
+ } catch (e) {
176
+ return false;
177
+ }
178
+ }
179
+ function getOS() {
180
+ if (detectIsIOS()) return "ios";
181
+ if (detectIsAndroid()) return "android";
182
+ if (detectIsChromeOS()) return "chromeos";
183
+ if (detectIsLinux()) return "linux";
184
+ if (detectIsMacOS()) return "macos";
185
+ if (detectIsWindows()) return "windows";
186
+ return "unknown";
187
+ }
188
+ function isMobileDevice() {
189
+ return detectIsIOS() || detectIsAndroid();
190
+ }
191
+ function isDesktopDevice() {
192
+ return detectIsMacOS() || detectIsWindows() || detectIsLinux() || detectIsChromeOS();
193
+ }
194
+ function detectIsiOS() {
195
+ if (typeof console !== "undefined") {
196
+ console.warn(
197
+ "[os-detect] detectIsiOS() is deprecated. Use detectIsIOS() instead. Will be removed in v3.0."
198
+ );
199
+ }
200
+ return detectIsIOS();
201
+ }
202
+ var osDetect = {
203
+ detectIsIOS,
204
+ detectIsMacOS,
205
+ detectIsAndroid,
206
+ detectIsWindows,
207
+ detectIsLinux,
208
+ detectIsChromeOS,
209
+ detectIsWindows11,
210
+ getOS,
211
+ isMobileDevice,
212
+ isDesktopDevice,
213
+ detectIsiOS
214
+ };
215
+ var index_default = osDetect;
216
+ // Annotate the CommonJS export names for ESM import in node:
217
+ 0 && (module.exports = {
218
+ detectIsAndroid,
219
+ detectIsChromeOS,
220
+ detectIsIOS,
221
+ detectIsLinux,
222
+ detectIsMacOS,
223
+ detectIsWindows,
224
+ detectIsWindows11,
225
+ detectIsiOS,
226
+ getOS,
227
+ isDesktopDevice,
228
+ isMobileDevice
229
+ });