@untemps/user-permissions-utils 1.1.33 → 1.1.34

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.
Files changed (2) hide show
  1. package/README.md +24 -0
  2. package/package.json +8 -1
package/README.md CHANGED
@@ -54,6 +54,30 @@ const init = async () => {
54
54
  }
55
55
  ```
56
56
 
57
+ `isNavigatorPermissionsSupported`:
58
+
59
+ Returns `true` if the browser supports `navigator.permissions`
60
+
61
+ ```javascript
62
+ import { isNavigatorPermissionsSupported } from '@untemps/user-permissions-utils'
63
+
64
+ if (!isNavigatorPermissionsSupported()) {
65
+ console.warn('Navigator Permissions API is not supported in this browser')
66
+ }
67
+ ```
68
+
69
+ `isNavigatorMediaDevicesSupported`:
70
+
71
+ Returns `true` if the browser supports `navigator.mediaDevices`
72
+
73
+ ```javascript
74
+ import { isNavigatorMediaDevicesSupported } from '@untemps/user-permissions-utils'
75
+
76
+ if (!isNavigatorMediaDevicesSupported()) {
77
+ console.warn('Navigator MediaDevices API is not supported in this browser')
78
+ }
79
+ ```
80
+
57
81
  ## Todos
58
82
 
59
83
  - Add permissions-based API:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@untemps/user-permissions-utils",
3
- "version": "1.1.33",
3
+ "version": "1.1.34",
4
4
  "description": "Collection of utility functions to manage user permissions",
5
5
  "repository": "git@github.com:untemps/user-permissions-utils.git",
6
6
  "keywords": [
@@ -16,6 +16,13 @@
16
16
  },
17
17
  "main": "dist/index.js",
18
18
  "module": "dist/index.es.js",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./dist/index.es.js",
22
+ "require": "./dist/index.js",
23
+ "default": "./dist/index.es.js"
24
+ }
25
+ },
19
26
  "files": [
20
27
  "dist"
21
28
  ],