umaki 0.2.4 → 0.2.6

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 (97) hide show
  1. package/README.md +193 -79
  2. package/dist/LICENSE.txt +32 -0
  3. package/dist/_virtual/_commonjsHelpers.cjs.js +19 -1
  4. package/dist/_virtual/_commonjsHelpers.es.js +16 -5
  5. package/dist/_virtual/isBetween.cjs.js +15 -1
  6. package/dist/_virtual/isBetween.es.js +13 -2
  7. package/dist/index.cjs.js +99 -1
  8. package/dist/index.es.js +97 -86
  9. package/dist/libs/control/bgScrollStop.cjs.js +24 -1
  10. package/dist/libs/control/bgScrollStop.es.js +21 -4
  11. package/dist/libs/control/pd.cjs.js +15 -1
  12. package/dist/libs/control/pd.es.js +13 -2
  13. package/dist/libs/control/scrollToHash.cjs.js +47 -1
  14. package/dist/libs/control/scrollToHash.es.js +42 -16
  15. package/dist/libs/control/videoPlayControl.cjs.js +33 -1
  16. package/dist/libs/control/videoPlayControl.es.js +27 -10
  17. package/dist/libs/convert/changeDateStringToSpecificFormat.cjs.js +16 -1
  18. package/dist/libs/convert/changeDateStringToSpecificFormat.es.js +14 -3
  19. package/dist/libs/convert/jsonStringToJsonObject.cjs.js +20 -1
  20. package/dist/libs/convert/jsonStringToJsonObject.es.js +15 -4
  21. package/dist/libs/get/getAspectRatio.cjs.js +19 -1
  22. package/dist/libs/get/getAspectRatio.es.js +16 -5
  23. package/dist/libs/get/getClassNames.cjs.js +18 -1
  24. package/dist/libs/get/getClassNames.es.js +16 -2
  25. package/dist/libs/get/getDocumentHeight.cjs.js +15 -1
  26. package/dist/libs/get/getDocumentHeight.es.js +13 -2
  27. package/dist/libs/get/getEventPaths.cjs.js +35 -1
  28. package/dist/libs/get/getEventPaths.es.js +30 -12
  29. package/dist/libs/get/getGcd.cjs.js +21 -1
  30. package/dist/libs/get/getGcd.es.js +18 -5
  31. package/dist/libs/get/getOrientation.cjs.js +18 -1
  32. package/dist/libs/get/getOrientation.es.js +16 -2
  33. package/dist/libs/get/getParentList.cjs.js +19 -1
  34. package/dist/libs/get/getParentList.es.js +16 -4
  35. package/dist/libs/get/getQueryParams.cjs.js +30 -1
  36. package/dist/libs/get/getQueryParams.es.js +26 -12
  37. package/dist/libs/get/getRem.cjs.js +18 -1
  38. package/dist/libs/get/getRem.es.js +16 -2
  39. package/dist/libs/get/getScrollbarWidth.cjs.js +15 -1
  40. package/dist/libs/get/getScrollbarWidth.es.js +13 -2
  41. package/dist/libs/get/getSessionStorage.cjs.js +20 -1
  42. package/dist/libs/get/getSessionStorage.es.js +17 -5
  43. package/dist/libs/get/getStringLength.cjs.js +16 -1
  44. package/dist/libs/get/getStringLength.es.js +14 -3
  45. package/dist/libs/get/getStylePropertyValue.cjs.js +15 -1
  46. package/dist/libs/get/getStylePropertyValue.es.js +13 -2
  47. package/dist/libs/get/getStylePropertyValueToNumber.cjs.js +16 -1
  48. package/dist/libs/get/getStylePropertyValueToNumber.es.js +14 -3
  49. package/dist/libs/get/getUaData.cjs.js +34 -1
  50. package/dist/libs/get/getUaData.es.js +30 -12
  51. package/dist/libs/is/isBetweenDateTime.cjs.js +25 -1
  52. package/dist/libs/is/isBetweenDateTime.es.js +21 -8
  53. package/dist/libs/is/isExistAllElements.cjs.js +17 -1
  54. package/dist/libs/is/isExistAllElements.es.js +15 -2
  55. package/dist/libs/is/isIpad.cjs.js +21 -1
  56. package/dist/libs/is/isIpad.es.js +18 -6
  57. package/dist/libs/is/isKeyExists.cjs.js +17 -1
  58. package/dist/libs/is/isKeyExists.es.js +15 -2
  59. package/dist/libs/is/isSafari.cjs.js +22 -1
  60. package/dist/libs/is/isSafari.es.js +19 -5
  61. package/dist/libs/is/isScrollable.cjs.js +19 -1
  62. package/dist/libs/is/isScrollable.es.js +16 -4
  63. package/dist/libs/is/isTouchSupport.cjs.js +16 -1
  64. package/dist/libs/is/isTouchSupport.es.js +14 -3
  65. package/dist/libs/remove/removeAllHtmlTags.cjs.js +23 -1
  66. package/dist/libs/remove/removeAllHtmlTags.es.js +21 -7
  67. package/dist/libs/remove/removeAttribute.cjs.js +17 -1
  68. package/dist/libs/remove/removeAttribute.es.js +14 -3
  69. package/dist/libs/remove/removeSessionStorage.cjs.js +18 -1
  70. package/dist/libs/remove/removeSessionStorage.es.js +15 -4
  71. package/dist/libs/remove/removeStylePropertyValue.cjs.js +17 -1
  72. package/dist/libs/remove/removeStylePropertyValue.es.js +14 -3
  73. package/dist/libs/set/set100vh.cjs.js +18 -1
  74. package/dist/libs/set/set100vh.es.js +15 -4
  75. package/dist/libs/set/set100vw.cjs.js +18 -1
  76. package/dist/libs/set/set100vw.es.js +15 -4
  77. package/dist/libs/set/setAttribute.cjs.js +17 -1
  78. package/dist/libs/set/setAttribute.es.js +14 -3
  79. package/dist/libs/set/setScrollPositionToCenter.cjs.js +21 -1
  80. package/dist/libs/set/setScrollPositionToCenter.es.js +18 -4
  81. package/dist/libs/set/setSessionStorage.cjs.js +18 -1
  82. package/dist/libs/set/setSessionStorage.es.js +15 -4
  83. package/dist/libs/set/setStylePropertyValue.cjs.js +17 -1
  84. package/dist/libs/set/setStylePropertyValue.es.js +14 -3
  85. package/dist/libs/to/toBoolean.cjs.js +17 -1
  86. package/dist/libs/to/toBoolean.es.js +15 -2
  87. package/dist/libs/to/toPositiveNumber.cjs.js +15 -1
  88. package/dist/libs/to/toPositiveNumber.es.js +13 -2
  89. package/dist/libs/transform/wrapTextWithSpans.cjs.js +31 -1
  90. package/dist/libs/transform/wrapTextWithSpans.es.js +27 -13
  91. package/dist/libs/wait/sleep.cjs.js +17 -1
  92. package/dist/libs/wait/sleep.es.js +15 -2
  93. package/dist/libs/wait/waitForAllMediaLoaded.cjs.js +55 -1
  94. package/dist/libs/wait/waitForAllMediaLoaded.es.js +47 -20
  95. package/dist/node_modules/dayjs/plugin/isBetween.cjs.js +30 -1
  96. package/dist/node_modules/dayjs/plugin/isBetween.es.js +25 -14
  97. package/package.json +2 -1
@@ -1 +1,33 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../to/toBoolean.cjs.js"),i=async(a,r)=>{if(r&&a.paused){if(o.toBoolean(a.dataset.playing))return;const t=a.play();if(t===void 0)return;try{await t,a.currentTime=0,a.dataset.playing="true"}catch{}}r||(a.pause(),a.dataset.playing="false")};exports.videoPlayControl=i;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const toBoolean = require("../to/toBoolean.cjs.js");
15
+ const videoPlayControl = async (videoElement, state) => {
16
+ if (state && videoElement.paused) {
17
+ const isPlaying = toBoolean.toBoolean(videoElement.dataset.playing);
18
+ if (isPlaying) return;
19
+ const playPromise = videoElement.play();
20
+ if (playPromise === void 0) return;
21
+ try {
22
+ await playPromise;
23
+ videoElement.currentTime = 0;
24
+ videoElement.dataset.playing = "true";
25
+ } catch (error) {
26
+ }
27
+ }
28
+ if (!state) {
29
+ videoElement.pause();
30
+ videoElement.dataset.playing = "false";
31
+ }
32
+ };
33
+ exports.videoPlayControl = videoPlayControl;
@@ -1,16 +1,33 @@
1
- import { toBoolean as t } from "../to/toBoolean.es.js";
2
- const p = async (a, r) => {
3
- if (r && a.paused) {
4
- if (t(a.dataset.playing)) return;
5
- const s = a.play();
6
- if (s === void 0) return;
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ import { toBoolean } from "../to/toBoolean.es.js";
13
+ const videoPlayControl = async (videoElement, state) => {
14
+ if (state && videoElement.paused) {
15
+ const isPlaying = toBoolean(videoElement.dataset.playing);
16
+ if (isPlaying) return;
17
+ const playPromise = videoElement.play();
18
+ if (playPromise === void 0) return;
7
19
  try {
8
- await s, a.currentTime = 0, a.dataset.playing = "true";
9
- } catch {
20
+ await playPromise;
21
+ videoElement.currentTime = 0;
22
+ videoElement.dataset.playing = "true";
23
+ } catch (error) {
10
24
  }
11
25
  }
12
- r || (a.pause(), a.dataset.playing = "false");
26
+ if (!state) {
27
+ videoElement.pause();
28
+ videoElement.dataset.playing = "false";
29
+ }
13
30
  };
14
31
  export {
15
- p as videoPlayControl
32
+ videoPlayControl
16
33
  };
@@ -1 +1,16 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("dayjs"),r=(e,t="YYYY年MM月DD日")=>o(e).format(t);exports.changeDateStringToSpecificFormat=r;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const dayjs = require("dayjs");
15
+ const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日") => dayjs(date).format(format);
16
+ exports.changeDateStringToSpecificFormat = changeDateStringToSpecificFormat;
@@ -1,5 +1,16 @@
1
- import r from "dayjs";
2
- const c = (o, t = "YYYY年MM月DD日") => r(o).format(t);
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ import dayjs from "dayjs";
13
+ const changeDateStringToSpecificFormat = (date, format = "YYYY年MM月DD日") => dayjs(date).format(format);
3
14
  export {
4
- c as changeDateStringToSpecificFormat
15
+ changeDateStringToSpecificFormat
5
16
  };
@@ -1 +1,20 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=t=>{try{return JSON.parse(t)}catch{}};exports.jsonStringToJsonObject=r;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const jsonStringToJsonObject = (string) => {
15
+ try {
16
+ return JSON.parse(string);
17
+ } catch (error) {
18
+ }
19
+ };
20
+ exports.jsonStringToJsonObject = jsonStringToJsonObject;
@@ -1,9 +1,20 @@
1
- const o = (r) => {
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const jsonStringToJsonObject = (string) => {
2
13
  try {
3
- return JSON.parse(r);
4
- } catch {
14
+ return JSON.parse(string);
15
+ } catch (error) {
5
16
  }
6
17
  };
7
18
  export {
8
- o as jsonStringToJsonObject
19
+ jsonStringToJsonObject
9
20
  };
@@ -1 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./getGcd.cjs.js"),r=(t,e)=>{const c=o.getGcd(t,e);return{w:t/c,h:e/c}};exports.getAspectRatio=r;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getGcd = require("./getGcd.cjs.js");
15
+ const getAspectRatio = (w, h) => {
16
+ const gcd = getGcd.getGcd(w, h);
17
+ return { w: w / gcd, h: h / gcd };
18
+ };
19
+ exports.getAspectRatio = getAspectRatio;
@@ -1,8 +1,19 @@
1
- import { getGcd as e } from "./getGcd.es.js";
2
- const g = (t, o) => {
3
- const c = e(t, o);
4
- return { w: t / c, h: o / c };
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ import { getGcd } from "./getGcd.es.js";
13
+ const getAspectRatio = (w, h) => {
14
+ const gcd = getGcd(w, h);
15
+ return { w: w / gcd, h: h / gcd };
5
16
  };
6
17
  export {
7
- g as getAspectRatio
18
+ getAspectRatio
8
19
  };
@@ -1 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=t=>String(t.classList).split(" ").filter(s=>s);exports.getClassNames=e;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getClassNames = (target) => {
15
+ const list = String(target.classList).split(" ").filter((v) => v);
16
+ return list;
17
+ };
18
+ exports.getClassNames = getClassNames;
@@ -1,4 +1,18 @@
1
- const l = (s) => String(s.classList).split(" ").filter((t) => t);
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getClassNames = (target) => {
13
+ const list = String(target.classList).split(" ").filter((v) => v);
14
+ return list;
15
+ };
2
16
  export {
3
- l as getClassNames
17
+ getClassNames
4
18
  };
@@ -1 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=()=>document.body.clientHeight-window.innerHeight;exports.getDocumentHeight=e;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getDocumentHeight = () => document.body.clientHeight - window.innerHeight;
15
+ exports.getDocumentHeight = getDocumentHeight;
@@ -1,4 +1,15 @@
1
- const e = () => document.body.clientHeight - window.innerHeight;
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getDocumentHeight = () => document.body.clientHeight - window.innerHeight;
2
13
  export {
3
- e as getDocumentHeight
14
+ getDocumentHeight
4
15
  };
@@ -1 +1,35 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=n=>{var a;let t=((a=n.composedPath)==null?void 0:a.call(n))||null;const e=n.target;if(t!=null)return t=t.indexOf(window)<0?t.concat([window]):t,t;if(e instanceof Window)return[window];const r=(d,c)=>{const i=c||[],o=d.parentNode;return o?r(o,i.concat([o])):c};return[e].concat(r(e,[])).concat([window])};exports.getEventPaths=s;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getEventPaths = (evt) => {
15
+ var _a;
16
+ let path = ((_a = evt.composedPath) == null ? void 0 : _a.call(evt)) || null;
17
+ const target = evt.target;
18
+ if (path != null) {
19
+ path = path.indexOf(window) < 0 ? path.concat([window]) : path;
20
+ return path;
21
+ }
22
+ if (target instanceof Window) {
23
+ return [window];
24
+ }
25
+ const getParents = (node, memo) => {
26
+ const updatedMemo = memo || [];
27
+ const parentNode = node.parentNode;
28
+ if (!parentNode) {
29
+ return memo;
30
+ }
31
+ return getParents(parentNode, updatedMemo.concat([parentNode]));
32
+ };
33
+ return [target].concat(getParents(target, [])).concat([window]);
34
+ };
35
+ exports.getEventPaths = getEventPaths;
@@ -1,17 +1,35 @@
1
- const s = (t) => {
2
- var c;
3
- let n = ((c = t.composedPath) == null ? void 0 : c.call(t)) || null;
4
- const o = t.target;
5
- if (n != null)
6
- return n = n.indexOf(window) < 0 ? n.concat([window]) : n, n;
7
- if (o instanceof Window)
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getEventPaths = (evt) => {
13
+ var _a;
14
+ let path = ((_a = evt.composedPath) == null ? void 0 : _a.call(evt)) || null;
15
+ const target = evt.target;
16
+ if (path != null) {
17
+ path = path.indexOf(window) < 0 ? path.concat([window]) : path;
18
+ return path;
19
+ }
20
+ if (target instanceof Window) {
8
21
  return [window];
9
- const r = (d, a) => {
10
- const i = a || [], e = d.parentNode;
11
- return e ? r(e, i.concat([e])) : a;
22
+ }
23
+ const getParents = (node, memo) => {
24
+ const updatedMemo = memo || [];
25
+ const parentNode = node.parentNode;
26
+ if (!parentNode) {
27
+ return memo;
28
+ }
29
+ return getParents(parentNode, updatedMemo.concat([parentNode]));
12
30
  };
13
- return [o].concat(r(o, [])).concat([window]);
31
+ return [target].concat(getParents(target, [])).concat([window]);
14
32
  };
15
33
  export {
16
- s as getEventPaths
34
+ getEventPaths
17
35
  };
@@ -1 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../to/toPositiveNumber.cjs.js"),i=(r,s)=>{const e=o.toPositiveNumber(Math.abs(r)),t=o.toPositiveNumber(Math.abs(s));return t===0?e:i(t,e%t)};exports.getGcd=i;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const toPositiveNumber = require("../to/toPositiveNumber.cjs.js");
15
+ const getGcd = (a, b) => {
16
+ const positiveA = toPositiveNumber.toPositiveNumber(Math.abs(a));
17
+ const positiveB = toPositiveNumber.toPositiveNumber(Math.abs(b));
18
+ if (positiveB === 0) return positiveA;
19
+ return getGcd(positiveB, positiveA % positiveB);
20
+ };
21
+ exports.getGcd = getGcd;
@@ -1,8 +1,21 @@
1
- import { toPositiveNumber as e } from "../to/toPositiveNumber.es.js";
2
- const s = (i, r) => {
3
- const o = e(Math.abs(i)), t = e(Math.abs(r));
4
- return t === 0 ? o : s(t, o % t);
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ import { toPositiveNumber } from "../to/toPositiveNumber.es.js";
13
+ const getGcd = (a, b) => {
14
+ const positiveA = toPositiveNumber(Math.abs(a));
15
+ const positiveB = toPositiveNumber(Math.abs(b));
16
+ if (positiveB === 0) return positiveA;
17
+ return getGcd(positiveB, positiveA % positiveB);
5
18
  };
6
19
  export {
7
- s as getGcd
20
+ getGcd
8
21
  };
@@ -1 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=()=>window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait";exports.getOrientation=t;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getOrientation = () => {
15
+ const isLandscape = window.matchMedia("(orientation: landscape)").matches;
16
+ return isLandscape ? "landscape" : "portrait";
17
+ };
18
+ exports.getOrientation = getOrientation;
@@ -1,4 +1,18 @@
1
- const t = () => window.matchMedia("(orientation: landscape)").matches ? "landscape" : "portrait";
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getOrientation = () => {
13
+ const isLandscape = window.matchMedia("(orientation: landscape)").matches;
14
+ return isLandscape ? "landscape" : "portrait";
15
+ };
2
16
  export {
3
- t as getOrientation
17
+ getOrientation
4
18
  };
@@ -1 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=t=>{const e=t.parentElement;return e?[t].concat(r(e)):[t]};exports.getParentList=r;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getParentList = (element) => {
15
+ const parentElement = element.parentElement;
16
+ if (!parentElement) return [element];
17
+ return [element].concat(getParentList(parentElement));
18
+ };
19
+ exports.getParentList = getParentList;
@@ -1,7 +1,19 @@
1
- const r = (t) => {
2
- const n = t.parentElement;
3
- return n ? [t].concat(r(n)) : [t];
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getParentList = (element) => {
13
+ const parentElement = element.parentElement;
14
+ if (!parentElement) return [element];
15
+ return [element].concat(getParentList(parentElement));
4
16
  };
5
17
  export {
6
- r as getParentList
18
+ getParentList
7
19
  };
@@ -1 +1,30 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("query-string"),a={arrayFormat:"comma",parseNumbers:!0},u=(t,n)=>{const o={...a,...n},e=s.parse(window.location.search,o);if(!e)return null;const r=e[t];return r??null};exports.getQueryParams=u;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const queryString = require("query-string");
15
+ const queryStringOptions = {
16
+ arrayFormat: "comma",
17
+ parseNumbers: true
18
+ };
19
+ const getQueryParams = (query, parseOptions) => {
20
+ const options = {
21
+ ...queryStringOptions,
22
+ ...parseOptions
23
+ };
24
+ const queryParsed = queryString.parse(window.location.search, options);
25
+ if (!queryParsed) return null;
26
+ const params = queryParsed[query];
27
+ if (params === null || params === void 0) return null;
28
+ return params;
29
+ };
30
+ exports.getQueryParams = getQueryParams;
@@ -1,16 +1,30 @@
1
- import s from "query-string";
2
- const a = {
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ import queryString from "query-string";
13
+ const queryStringOptions = {
3
14
  arrayFormat: "comma",
4
- parseNumbers: !0
5
- }, i = (n, o) => {
6
- const e = {
7
- ...a,
8
- ...o
9
- }, t = s.parse(window.location.search, e);
10
- if (!t) return null;
11
- const r = t[n];
12
- return r ?? null;
15
+ parseNumbers: true
16
+ };
17
+ const getQueryParams = (query, parseOptions) => {
18
+ const options = {
19
+ ...queryStringOptions,
20
+ ...parseOptions
21
+ };
22
+ const queryParsed = queryString.parse(window.location.search, options);
23
+ if (!queryParsed) return null;
24
+ const params = queryParsed[query];
25
+ if (params === null || params === void 0) return null;
26
+ return params;
13
27
  };
14
28
  export {
15
- i as getQueryParams
29
+ getQueryParams
16
30
  };
@@ -1 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>`${e/16}rem`;exports.getRem=t;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getRem = (px) => {
15
+ const baseFontSize = 16;
16
+ return `${px / baseFontSize}rem`;
17
+ };
18
+ exports.getRem = getRem;
@@ -1,4 +1,18 @@
1
- const n = (e) => `${e / 16}rem`;
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.2.6
4
+ * description: A utility that is often used in web production.
5
+ * author: TsubasaHiga
6
+ * homepage: https://github.com/TsubasaHiga/umaki
7
+ * Released under the MIT License
8
+ *
9
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
10
+ * For license information, please see LICENSE.txt
11
+ */
12
+ const getRem = (px) => {
13
+ const baseFontSize = 16;
14
+ return `${px / baseFontSize}rem`;
15
+ };
2
16
  export {
3
- n as getRem
17
+ getRem
4
18
  };
@@ -1 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=()=>window.innerWidth-document.body.clientWidth;exports.getScrollbarWidth=t;
1
+ "use strict";
2
+ /*!
3
+ * name: umaki
4
+ * version: v0.2.6
5
+ * description: A utility that is often used in web production.
6
+ * author: TsubasaHiga
7
+ * homepage: https://github.com/TsubasaHiga/umaki
8
+ * Released under the MIT License
9
+ *
10
+ * This software includes dependencies licensed under MIT, ISC, BSD-3-Clause, and Apache-2.0.
11
+ * For license information, please see LICENSE.txt
12
+ */
13
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
14
+ const getScrollbarWidth = () => window.innerWidth - document.body.clientWidth;
15
+ exports.getScrollbarWidth = getScrollbarWidth;