@symbo.ls/utils 2.11.315 → 2.11.339

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@symbo.ls/utils",
3
- "version": "2.11.315",
3
+ "version": "2.11.339",
4
4
  "main": "src/index.js",
5
5
  "author": "symbo.ls",
6
6
  "license": "ISC",
7
7
  "dependencies": {
8
8
  "@domql/utils": "latest"
9
9
  },
10
- "gitHead": "f7e5836ff0fad163a721cd8a823e2da1a7f346ef"
10
+ "gitHead": "c38a8986f006a25427c7808c3f965ec2ed0150b8"
11
11
  }
package/src/browser.js ADDED
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+
3
+ export const toggleFullscreen = (el) => {
4
+ if (!document.fullscreenElement) {
5
+ el.node.requestFullscreen().catch((err) => {
6
+ console.warn(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`)
7
+ })
8
+ } else {
9
+ document.exitFullscreen()
10
+ }
11
+ }
package/src/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { isString, isObject, isArray, isNumber } from '@domql/utils'
4
4
 
5
+ export * from './browser'
5
6
  export * from './scaling'
6
7
  export * from './date'
7
8
 
@@ -36,7 +37,7 @@ export const toDashCase = val => val
36
37
  .replace(/-+/g, '-') // Replace consecutive dashes with a single dash
37
38
  .replace(/^-|-$/g, '') // Remove leading and trailing dashes
38
39
 
39
- export const toDescriptionCase = str => {
40
+ export const toDescriptionCase = (str = '') => {
40
41
  const result = str.replace(/([A-Z])/g, ' $1')
41
42
  return result.charAt(0).toUpperCase() + result.slice(1)
42
43
  }