Add barcode-detector-api-polyfill dependency and update environment variable declarations in SvelteKit project
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* If navigator is present.
|
||||
*/
|
||||
export function hasNavigator() {
|
||||
return typeof navigator !== 'undefined';
|
||||
}
|
||||
/**
|
||||
* If mediaDevices under navigator is supported.
|
||||
*/
|
||||
function isMediaDevicesSupported() {
|
||||
return hasNavigator() && !!navigator.mediaDevices;
|
||||
}
|
||||
/**
|
||||
* If enumerateDevices under navigator is supported.
|
||||
*/
|
||||
export function canEnumerateDevices() {
|
||||
return !!(isMediaDevicesSupported() && navigator.mediaDevices.enumerateDevices);
|
||||
}
|
||||
//# sourceMappingURL=navigator-utils.js.map
|
||||
Reference in New Issue
Block a user