@4players/odin-common 1.3.0 → 1.4.0
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/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
- Added `isElectronBrowser`
|
|
6
|
+
- Added `isFirefoxBrowser`
|
|
7
|
+
- Added `isSafariBrowser`
|
|
8
|
+
- Added `isSharedArrayBufferCapable`
|
|
9
|
+
|
|
3
10
|
## 1.3.0
|
|
11
|
+
|
|
4
12
|
- Changed the return type from `Plugin.setOutputDevice` to `Promise<void>` to fix a timing issue
|
|
5
13
|
|
|
6
14
|
## 1.2.3
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBlinkBrowser = exports.isAudioCapable = void 0;
|
|
3
|
+
exports.isSafariBrowser = exports.isFirefoxBrowser = exports.isElectronBrowser = exports.isBlinkBrowser = exports.isSharedArrayBufferCapable = exports.isAudioCapable = void 0;
|
|
4
4
|
function isAudioCapable() {
|
|
5
5
|
return typeof AudioContext !== 'undefined' && typeof Worker !== 'undefined';
|
|
6
6
|
}
|
|
7
7
|
exports.isAudioCapable = isAudioCapable;
|
|
8
|
+
function isSharedArrayBufferCapable() {
|
|
9
|
+
return typeof self !== 'undefined' && self.crossOriginIsolated;
|
|
10
|
+
}
|
|
11
|
+
exports.isSharedArrayBufferCapable = isSharedArrayBufferCapable;
|
|
8
12
|
function isBlinkBrowser() {
|
|
9
13
|
const pattern = /(apple)?webkit\/537\.36/i;
|
|
10
14
|
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
11
15
|
}
|
|
12
16
|
exports.isBlinkBrowser = isBlinkBrowser;
|
|
17
|
+
function isElectronBrowser() {
|
|
18
|
+
const pattern = /electron/i;
|
|
19
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
20
|
+
}
|
|
21
|
+
exports.isElectronBrowser = isElectronBrowser;
|
|
22
|
+
function isFirefoxBrowser() {
|
|
23
|
+
const pattern = /firefox|iceweasel|fxios/i;
|
|
24
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
25
|
+
}
|
|
26
|
+
exports.isFirefoxBrowser = isFirefoxBrowser;
|
|
27
|
+
function isSafariBrowser() {
|
|
28
|
+
const pattern = /safari|applewebkit/i;
|
|
29
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
30
|
+
}
|
|
31
|
+
exports.isSafariBrowser = isSafariBrowser;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
export function isAudioCapable() {
|
|
2
2
|
return typeof AudioContext !== 'undefined' && typeof Worker !== 'undefined';
|
|
3
3
|
}
|
|
4
|
+
export function isSharedArrayBufferCapable() {
|
|
5
|
+
return typeof self !== 'undefined' && self.crossOriginIsolated;
|
|
6
|
+
}
|
|
4
7
|
export function isBlinkBrowser() {
|
|
5
8
|
const pattern = /(apple)?webkit\/537\.36/i;
|
|
6
9
|
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
7
10
|
}
|
|
11
|
+
export function isElectronBrowser() {
|
|
12
|
+
const pattern = /electron/i;
|
|
13
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
14
|
+
}
|
|
15
|
+
export function isFirefoxBrowser() {
|
|
16
|
+
const pattern = /firefox|iceweasel|fxios/i;
|
|
17
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
18
|
+
}
|
|
19
|
+
export function isSafariBrowser() {
|
|
20
|
+
const pattern = /safari|applewebkit/i;
|
|
21
|
+
return (typeof window !== 'undefined' && pattern.test(window.navigator.userAgent));
|
|
22
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export declare function isAudioCapable(): boolean;
|
|
2
|
+
export declare function isSharedArrayBufferCapable(): boolean;
|
|
2
3
|
export declare function isBlinkBrowser(): boolean;
|
|
4
|
+
export declare function isElectronBrowser(): boolean;
|
|
5
|
+
export declare function isFirefoxBrowser(): boolean;
|
|
6
|
+
export declare function isSafariBrowser(): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"zod": "~3.22.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "~6.
|
|
38
|
-
"@typescript-eslint/parser": "~6.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "~6.19.0",
|
|
38
|
+
"@typescript-eslint/parser": "~6.19.0",
|
|
39
39
|
"eslint": "~8.56.0",
|
|
40
40
|
"eslint-config-semistandard": "~17.0.0",
|
|
41
41
|
"eslint-plugin-import": "~2.29.0",
|
|
42
42
|
"eslint-plugin-node": "~11.1.0",
|
|
43
43
|
"eslint-plugin-promise": "~6.1.0",
|
|
44
|
-
"prettier": "~3.
|
|
44
|
+
"prettier": "~3.2.0",
|
|
45
45
|
"testyts": "~1.5.0",
|
|
46
46
|
"typescript": "~5.3.0"
|
|
47
47
|
}
|