@symbo.ls/utils 2.11.512 → 3.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/dist/cjs/date.js CHANGED
@@ -24,8 +24,7 @@ __export(date_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(date_exports);
26
26
  var formatDate = (timestamp) => {
27
- if (!timestamp)
28
- return "";
27
+ if (!timestamp) return "";
29
28
  const d = new Date(timestamp);
30
29
  const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
31
30
  const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
@@ -33,8 +33,7 @@ var detectHeightOnInit = (element, state) => {
33
33
  }
34
34
  }
35
35
  if (state.active) {
36
- if (props.height === "auto")
37
- return;
36
+ if (props.height === "auto") return;
38
37
  element.update({
39
38
  props: { height: state.clientHeight }
40
39
  }, { preventBeforeUpdateListener: true, preventChildrenUpdate: true });
package/dist/cjs/index.js CHANGED
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.js
21
- var src_exports = {};
22
- __export(src_exports, {
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
23
  arrayzeValue: () => arrayzeValue,
24
24
  copyJavaScriptToClipboard: () => copyJavaScriptToClipboard,
25
25
  copyStringToClipboard: () => copyStringToClipboard,
@@ -40,23 +40,22 @@ __export(src_exports, {
40
40
  toTitleCase: () => toTitleCase,
41
41
  toggleFullscreen: () => toggleFullscreen
42
42
  });
43
- module.exports = __toCommonJS(src_exports);
43
+ module.exports = __toCommonJS(index_exports);
44
44
 
45
- // ../../../domql/packages/utils/dist/esm/globals.js
45
+ // node_modules/@domql/utils/dist/esm/globals.js
46
46
  var window2 = globalThis;
47
47
  var document2 = window2.document;
48
48
 
49
- // ../../../domql/packages/utils/dist/esm/types.js
49
+ // node_modules/@domql/utils/dist/esm/types.js
50
50
  var isObject = (arg) => {
51
- if (arg === null)
52
- return false;
51
+ if (arg === null) return false;
53
52
  return typeof arg === "object" && arg.constructor === Object;
54
53
  };
55
54
  var isString = (arg) => typeof arg === "string";
56
55
  var isNumber = (arg) => typeof arg === "number";
57
56
  var isArray = (arg) => Array.isArray(arg);
58
57
 
59
- // ../../../domql/packages/utils/dist/esm/cookie.js
58
+ // node_modules/@domql/utils/dist/esm/cookie.js
60
59
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
61
60
 
62
61
  // src/browser.js
@@ -80,15 +79,13 @@ var findClosestNumber = (number, arr) => {
80
79
  };
81
80
  var findClosestNumberInFactory = (val, factory) => {
82
81
  val = parseFloat(val);
83
- if (isObject(factory))
84
- factory = Object.values(factory);
82
+ if (isObject(factory)) factory = Object.values(factory);
85
83
  return findClosestNumber(val, factory);
86
84
  };
87
85
 
88
86
  // src/date.js
89
87
  var formatDate = (timestamp) => {
90
- if (!timestamp)
91
- return "";
88
+ if (!timestamp) return "";
92
89
  const d = new Date(timestamp);
93
90
  const ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(d);
94
91
  const mo = new Intl.DateTimeFormat("en", { month: "short" }).format(d);
@@ -159,8 +156,7 @@ var loadJavascriptFileEmbedSync = (FILE_URL, doc = document, fallback, type = "t
159
156
  scriptEle.type = type;
160
157
  scriptEle.text = xhr.responseText;
161
158
  doc.body.appendChild(scriptEle);
162
- if (typeof fallback === "function")
163
- fallback();
159
+ if (typeof fallback === "function") fallback();
164
160
  } else {
165
161
  throw new Error(`Failed to load the script ${FILE_URL}`);
166
162
  }
@@ -232,18 +228,13 @@ var toTitleCase = (str) => str && str.replace(
232
228
  );
233
229
  var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
234
230
  var toDescriptionCase = (str = "") => {
235
- if (typeof str !== "string")
236
- return;
231
+ if (typeof str !== "string") return;
237
232
  const result = str.replace(/([A-Z])/g, " $1");
238
233
  return result.charAt(0).toUpperCase() + result.slice(1);
239
234
  };
240
235
  var arrayzeValue = (val) => {
241
- if (isArray(val))
242
- return val;
243
- if (isString(val))
244
- return val.split(" ");
245
- if (isObject(val))
246
- return Object.values(val);
247
- if (isNumber(val))
248
- return [val];
236
+ if (isArray(val)) return val;
237
+ if (isString(val)) return val.split(" ");
238
+ if (isObject(val)) return Object.values(val);
239
+ if (isNumber(val)) return [val];
249
240
  };
package/dist/cjs/load.js CHANGED
@@ -80,8 +80,7 @@ var loadJavascriptFileEmbedSync = (FILE_URL, doc = document, fallback, type = "t
80
80
  scriptEle.type = type;
81
81
  scriptEle.text = xhr.responseText;
82
82
  doc.body.appendChild(scriptEle);
83
- if (typeof fallback === "function")
84
- fallback();
83
+ if (typeof fallback === "function") fallback();
85
84
  } else {
86
85
  throw new Error(`Failed to load the script ${FILE_URL}`);
87
86
  }
@@ -25,19 +25,18 @@ __export(scaling_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(scaling_exports);
27
27
 
28
- // ../../../domql/packages/utils/dist/esm/globals.js
28
+ // node_modules/@domql/utils/dist/esm/globals.js
29
29
  var window2 = globalThis;
30
30
  var document2 = window2.document;
31
31
 
32
- // ../../../domql/packages/utils/dist/esm/types.js
32
+ // node_modules/@domql/utils/dist/esm/types.js
33
33
  var isObject = (arg) => {
34
- if (arg === null)
35
- return false;
34
+ if (arg === null) return false;
36
35
  return typeof arg === "object" && arg.constructor === Object;
37
36
  };
38
37
  var isArray = (arg) => Array.isArray(arg);
39
38
 
40
- // ../../../domql/packages/utils/dist/esm/cookie.js
39
+ // node_modules/@domql/utils/dist/esm/cookie.js
41
40
  var isMobile = (() => typeof navigator === "undefined" ? false : /Mobi/.test(navigator.userAgent))();
42
41
 
43
42
  // src/scaling.js
@@ -48,7 +47,6 @@ var findClosestNumber = (number, arr) => {
48
47
  };
49
48
  var findClosestNumberInFactory = (val, factory) => {
50
49
  val = parseFloat(val);
51
- if (isObject(factory))
52
- factory = Object.values(factory);
50
+ if (isObject(factory)) factory = Object.values(factory);
53
51
  return findClosestNumber(val, factory);
54
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/utils",
3
- "version": "2.11.512",
3
+ "version": "3.0.1",
4
4
  "author": "symbo.ls",
5
5
  "files": [
6
6
  "src",
@@ -26,5 +26,5 @@
26
26
  "dependencies": {
27
27
  "@domql/utils": "^2.5.0"
28
28
  },
29
- "gitHead": "72e3686d3c934501b7bffb459ce6d0d271bc0f8d"
29
+ "gitHead": "a4e7f586f7e4f60bd7b6a8388bdacc3ae1879433"
30
30
  }