umaki 0.13.0 → 0.13.2

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 (273) hide show
  1. package/README.md +15 -0
  2. package/dist/LICENSE.txt +1 -32
  3. package/dist/_virtual/_rolldown/runtime.cjs +22 -0
  4. package/dist/index.cjs +138 -0
  5. package/dist/index.es.js +17 -71
  6. package/dist/libs/callback/index.cjs +16 -0
  7. package/dist/libs/callback/index.es.js +12 -4
  8. package/dist/libs/callback/tap-async.cjs +7 -0
  9. package/dist/libs/callback/tap-async.es.js +6 -7
  10. package/dist/libs/callback/tap.cjs +6 -0
  11. package/dist/libs/callback/tap.es.js +5 -6
  12. package/dist/libs/config/_internal.cjs +3 -0
  13. package/dist/libs/config/_internal.es.js +3 -4
  14. package/dist/libs/config/default-config.cjs +3 -0
  15. package/dist/libs/config/default-config.es.js +3 -6
  16. package/dist/libs/config/get-config.cjs +10 -0
  17. package/dist/libs/config/get-config.es.js +6 -8
  18. package/dist/libs/config/index.cjs +19 -0
  19. package/dist/libs/config/index.es.js +12 -6
  20. package/dist/libs/config/set-config.cjs +15 -0
  21. package/dist/libs/config/set-config.d.ts +1 -0
  22. package/dist/libs/config/set-config.es.js +13 -6
  23. package/dist/libs/control/bg-scroll-stop.cjs +8 -0
  24. package/dist/libs/control/bg-scroll-stop.d.ts +1 -0
  25. package/dist/libs/control/bg-scroll-stop.es.js +6 -6
  26. package/dist/libs/control/copy-to-clipboard.cjs +11 -0
  27. package/dist/libs/control/copy-to-clipboard.es.js +10 -13
  28. package/dist/libs/control/index.cjs +22 -0
  29. package/dist/libs/control/index.es.js +12 -7
  30. package/dist/libs/control/pd.cjs +3 -0
  31. package/dist/libs/control/pd.es.js +3 -4
  32. package/dist/libs/control/scroll-to-hash.cjs +30 -0
  33. package/dist/libs/control/scroll-to-hash.d.ts +1 -0
  34. package/dist/libs/control/scroll-to-hash.es.js +29 -35
  35. package/dist/libs/control/video-play-control.cjs +19 -0
  36. package/dist/libs/control/video-play-control.es.js +17 -20
  37. package/dist/libs/convert/change-date-string-to-specific-format.cjs +15 -0
  38. package/dist/libs/convert/change-date-string-to-specific-format.es.js +7 -10
  39. package/dist/libs/convert/hex-to-rgb.cjs +17 -0
  40. package/dist/libs/convert/hex-to-rgb.es.js +16 -21
  41. package/dist/libs/convert/index.cjs +20 -0
  42. package/dist/libs/convert/index.es.js +12 -6
  43. package/dist/libs/convert/json-string-to-json-object.cjs +9 -0
  44. package/dist/libs/convert/json-string-to-json-object.es.js +8 -9
  45. package/dist/libs/convert/rgb-to-hex.cjs +8 -0
  46. package/dist/libs/convert/rgb-to-hex.es.js +7 -8
  47. package/dist/libs/eventControl/debounce.cjs +13 -0
  48. package/dist/libs/eventControl/debounce.es.js +12 -15
  49. package/dist/libs/eventControl/index.cjs +16 -0
  50. package/dist/libs/eventControl/index.es.js +12 -4
  51. package/dist/libs/eventControl/throttle.cjs +13 -0
  52. package/dist/libs/eventControl/throttle.es.js +12 -15
  53. package/dist/libs/get/get-aspect-ratio.cjs +11 -0
  54. package/dist/libs/get/get-aspect-ratio.es.js +9 -9
  55. package/dist/libs/get/get-class-names.cjs +5 -0
  56. package/dist/libs/get/get-class-names.es.js +4 -6
  57. package/dist/libs/get/get-document-height.cjs +6 -0
  58. package/dist/libs/get/get-document-height.d.ts +1 -0
  59. package/dist/libs/get/get-document-height.es.js +5 -3
  60. package/dist/libs/get/get-event-paths.cjs +18 -0
  61. package/dist/libs/get/get-event-paths.es.js +17 -22
  62. package/dist/libs/get/get-gcd.cjs +10 -0
  63. package/dist/libs/get/get-gcd.d.ts +1 -0
  64. package/dist/libs/get/get-gcd.es.js +8 -8
  65. package/dist/libs/get/get-gravatar-url.cjs +10 -0
  66. package/dist/libs/get/get-gravatar-url.d.ts +4 -0
  67. package/dist/libs/get/get-gravatar-url.es.js +6 -7
  68. package/dist/libs/get/get-orientation.cjs +6 -0
  69. package/dist/libs/get/get-orientation.es.js +5 -9
  70. package/dist/libs/get/get-parent-list.cjs +7 -0
  71. package/dist/libs/get/get-parent-list.es.js +6 -7
  72. package/dist/libs/get/get-query-params.cjs +22 -0
  73. package/dist/libs/get/get-query-params.d.ts +1 -0
  74. package/dist/libs/get/get-query-params.es.js +18 -18
  75. package/dist/libs/get/get-random-int.cjs +10 -0
  76. package/dist/libs/get/get-random-int.d.ts +5 -1
  77. package/dist/libs/get/get-random-int.es.js +9 -10
  78. package/dist/libs/get/get-relative-time.cjs +44 -0
  79. package/dist/libs/get/get-relative-time.es.js +42 -26
  80. package/dist/libs/get/get-rem.cjs +6 -0
  81. package/dist/libs/get/get-rem.d.ts +1 -0
  82. package/dist/libs/get/get-rem.es.js +5 -8
  83. package/dist/libs/get/get-rendered-line-height.cjs +52 -0
  84. package/dist/libs/get/get-rendered-line-height.es.js +50 -55
  85. package/dist/libs/get/get-scrollbar-width.cjs +6 -0
  86. package/dist/libs/get/get-scrollbar-width.d.ts +1 -0
  87. package/dist/libs/get/get-scrollbar-width.es.js +5 -3
  88. package/dist/libs/get/get-session-storage.cjs +10 -0
  89. package/dist/libs/get/get-session-storage.es.js +6 -7
  90. package/dist/libs/get/get-string-length.cjs +4 -0
  91. package/dist/libs/get/get-string-length.es.js +3 -4
  92. package/dist/libs/get/get-style-property-value-to-number.cjs +4 -0
  93. package/dist/libs/get/get-style-property-value-to-number.es.js +3 -4
  94. package/dist/libs/get/get-style-property-value.cjs +6 -0
  95. package/dist/libs/get/get-style-property-value.d.ts +1 -0
  96. package/dist/libs/get/get-style-property-value.es.js +5 -3
  97. package/dist/libs/get/get-ua-data.cjs +22 -0
  98. package/dist/libs/get/get-ua-data.es.js +17 -20
  99. package/dist/libs/get/index.cjs +50 -0
  100. package/dist/libs/get/index.es.js +14 -23
  101. package/dist/libs/is/check-device-size.cjs +8 -0
  102. package/dist/libs/is/check-device-size.es.js +6 -9
  103. package/dist/libs/is/index.cjs +34 -0
  104. package/dist/libs/is/index.es.js +13 -14
  105. package/dist/libs/is/is-after-date-time.cjs +9 -0
  106. package/dist/libs/is/is-after-date-time.es.js +5 -8
  107. package/dist/libs/is/is-between-date-time.cjs +14 -0
  108. package/dist/libs/is/is-between-date-time.es.js +8 -11
  109. package/dist/libs/is/is-exist-all-elements.cjs +5 -0
  110. package/dist/libs/is/is-exist-all-elements.es.js +4 -5
  111. package/dist/libs/is/is-in-viewport.cjs +63 -0
  112. package/dist/libs/is/is-in-viewport.es.js +61 -64
  113. package/dist/libs/is/is-ipad.cjs +10 -0
  114. package/dist/libs/is/is-ipad.es.js +7 -10
  115. package/dist/libs/is/is-key-exists.cjs +5 -0
  116. package/dist/libs/is/is-key-exists.es.js +4 -5
  117. package/dist/libs/is/is-online.cjs +6 -0
  118. package/dist/libs/is/is-online.es.js +5 -8
  119. package/dist/libs/is/is-safari.cjs +8 -0
  120. package/dist/libs/is/is-safari.es.js +6 -9
  121. package/dist/libs/is/is-scrollable.cjs +7 -0
  122. package/dist/libs/is/is-scrollable.es.js +6 -7
  123. package/dist/libs/is/is-touch-support.cjs +9 -0
  124. package/dist/libs/is/is-touch-support.es.js +8 -10
  125. package/dist/libs/remove/index.cjs +20 -0
  126. package/dist/libs/remove/index.es.js +12 -6
  127. package/dist/libs/remove/remove-all-html-tags.cjs +12 -0
  128. package/dist/libs/remove/remove-all-html-tags.d.ts +7 -1
  129. package/dist/libs/remove/remove-all-html-tags.es.js +8 -10
  130. package/dist/libs/remove/remove-attribute.cjs +5 -0
  131. package/dist/libs/remove/remove-attribute.es.js +4 -5
  132. package/dist/libs/remove/remove-session-storage.cjs +8 -0
  133. package/dist/libs/remove/remove-session-storage.es.js +4 -5
  134. package/dist/libs/remove/remove-style-property-value.cjs +6 -0
  135. package/dist/libs/remove/remove-style-property-value.d.ts +1 -0
  136. package/dist/libs/remove/remove-style-property-value.es.js +5 -5
  137. package/dist/libs/security/html-sanitize.cjs +19 -0
  138. package/dist/libs/security/html-sanitize.d.ts +8 -0
  139. package/dist/libs/security/html-sanitize.es.js +13 -6
  140. package/dist/libs/security/index.cjs +15 -0
  141. package/dist/libs/security/index.es.js +12 -5
  142. package/dist/libs/set/index.cjs +24 -0
  143. package/dist/libs/set/index.es.js +12 -8
  144. package/dist/libs/set/set-100vh.cjs +7 -0
  145. package/dist/libs/set/set-100vh.d.ts +1 -0
  146. package/dist/libs/set/set-100vh.es.js +6 -6
  147. package/dist/libs/set/set-100vw.cjs +7 -0
  148. package/dist/libs/set/set-100vw.d.ts +1 -0
  149. package/dist/libs/set/set-100vw.es.js +6 -6
  150. package/dist/libs/set/set-attribute.cjs +5 -0
  151. package/dist/libs/set/set-attribute.es.js +4 -5
  152. package/dist/libs/set/set-scroll-position-to-center.cjs +11 -0
  153. package/dist/libs/set/set-scroll-position-to-center.es.js +10 -9
  154. package/dist/libs/set/set-session-storage.cjs +8 -0
  155. package/dist/libs/set/set-session-storage.es.js +4 -5
  156. package/dist/libs/set/set-style-property-value.cjs +6 -0
  157. package/dist/libs/set/set-style-property-value.d.ts +1 -0
  158. package/dist/libs/set/set-style-property-value.es.js +5 -5
  159. package/dist/libs/to/index.cjs +16 -0
  160. package/dist/libs/to/index.es.js +12 -4
  161. package/dist/libs/to/to-boolean.cjs +5 -0
  162. package/dist/libs/to/to-boolean.es.js +4 -5
  163. package/dist/libs/to/to-positive-number.cjs +3 -0
  164. package/dist/libs/to/to-positive-number.es.js +3 -4
  165. package/dist/libs/transform/index.cjs +14 -0
  166. package/dist/libs/transform/index.es.js +12 -4
  167. package/dist/libs/transform/wrap-text-with-spans.cjs +17 -0
  168. package/dist/libs/transform/wrap-text-with-spans.es.js +15 -20
  169. package/dist/libs/wait/index.cjs +16 -0
  170. package/dist/libs/wait/index.es.js +12 -4
  171. package/dist/libs/wait/sleep.cjs +5 -0
  172. package/dist/libs/wait/sleep.es.js +4 -5
  173. package/dist/libs/wait/wait-for-all-media-loaded.cjs +31 -0
  174. package/dist/libs/wait/wait-for-all-media-loaded.d.ts +1 -0
  175. package/dist/libs/wait/wait-for-all-media-loaded.es.js +30 -43
  176. package/package.json +38 -36
  177. package/dist/_virtual/_commonjsHelpers.cjs.js +0 -6
  178. package/dist/_virtual/_commonjsHelpers.es.js +0 -6
  179. package/dist/_virtual/isBetween.cjs.js +0 -7
  180. package/dist/_virtual/isBetween.cjs2.js +0 -4
  181. package/dist/_virtual/isBetween.es.js +0 -7
  182. package/dist/_virtual/isBetween.es2.js +0 -4
  183. package/dist/_virtual/timezone.cjs.js +0 -7
  184. package/dist/_virtual/timezone.cjs2.js +0 -4
  185. package/dist/_virtual/timezone.es.js +0 -7
  186. package/dist/_virtual/timezone.es2.js +0 -4
  187. package/dist/_virtual/utc.cjs.js +0 -7
  188. package/dist/_virtual/utc.cjs2.js +0 -4
  189. package/dist/_virtual/utc.es.js +0 -7
  190. package/dist/_virtual/utc.es2.js +0 -4
  191. package/dist/index.cjs.js +0 -128
  192. package/dist/libs/callback/index.cjs.js +0 -6
  193. package/dist/libs/callback/tap-async.cjs.js +0 -8
  194. package/dist/libs/callback/tap.cjs.js +0 -7
  195. package/dist/libs/config/_internal.cjs.js +0 -5
  196. package/dist/libs/config/default-config.cjs.js +0 -6
  197. package/dist/libs/config/get-config.cjs.js +0 -11
  198. package/dist/libs/config/index.cjs.js +0 -9
  199. package/dist/libs/config/set-config.cjs.js +0 -8
  200. package/dist/libs/control/bg-scroll-stop.cjs.js +0 -8
  201. package/dist/libs/control/copy-to-clipboard.cjs.js +0 -14
  202. package/dist/libs/control/index.cjs.js +0 -12
  203. package/dist/libs/control/pd.cjs.js +0 -4
  204. package/dist/libs/control/scroll-to-hash.cjs.js +0 -36
  205. package/dist/libs/control/video-play-control.cjs.js +0 -22
  206. package/dist/libs/convert/change-date-string-to-specific-format.cjs.js +0 -14
  207. package/dist/libs/convert/hex-to-rgb.cjs.js +0 -22
  208. package/dist/libs/convert/index.cjs.js +0 -10
  209. package/dist/libs/convert/json-string-to-json-object.cjs.js +0 -10
  210. package/dist/libs/convert/rgb-to-hex.cjs.js +0 -9
  211. package/dist/libs/eventControl/debounce.cjs.js +0 -16
  212. package/dist/libs/eventControl/index.cjs.js +0 -6
  213. package/dist/libs/eventControl/throttle.cjs.js +0 -16
  214. package/dist/libs/get/get-aspect-ratio.cjs.js +0 -11
  215. package/dist/libs/get/get-class-names.cjs.js +0 -7
  216. package/dist/libs/get/get-document-height.cjs.js +0 -4
  217. package/dist/libs/get/get-event-paths.cjs.js +0 -23
  218. package/dist/libs/get/get-gcd.cjs.js +0 -10
  219. package/dist/libs/get/get-gravatar-url.cjs.js +0 -9
  220. package/dist/libs/get/get-orientation.cjs.js +0 -10
  221. package/dist/libs/get/get-parent-list.cjs.js +0 -8
  222. package/dist/libs/get/get-query-params.cjs.js +0 -20
  223. package/dist/libs/get/get-random-int.cjs.js +0 -11
  224. package/dist/libs/get/get-relative-time.cjs.js +0 -28
  225. package/dist/libs/get/get-rem.cjs.js +0 -9
  226. package/dist/libs/get/get-rendered-line-height.cjs.js +0 -57
  227. package/dist/libs/get/get-scrollbar-width.cjs.js +0 -4
  228. package/dist/libs/get/get-session-storage.cjs.js +0 -9
  229. package/dist/libs/get/get-string-length.cjs.js +0 -5
  230. package/dist/libs/get/get-style-property-value-to-number.cjs.js +0 -5
  231. package/dist/libs/get/get-style-property-value.cjs.js +0 -4
  232. package/dist/libs/get/get-ua-data.cjs.js +0 -23
  233. package/dist/libs/get/index.cjs.js +0 -40
  234. package/dist/libs/is/check-device-size.cjs.js +0 -11
  235. package/dist/libs/is/index.cjs.js +0 -24
  236. package/dist/libs/is/is-after-date-time.cjs.js +0 -10
  237. package/dist/libs/is/is-between-date-time.cjs.js +0 -14
  238. package/dist/libs/is/is-exist-all-elements.cjs.js +0 -6
  239. package/dist/libs/is/is-in-viewport.cjs.js +0 -66
  240. package/dist/libs/is/is-ipad.cjs.js +0 -13
  241. package/dist/libs/is/is-key-exists.cjs.js +0 -6
  242. package/dist/libs/is/is-online.cjs.js +0 -9
  243. package/dist/libs/is/is-safari.cjs.js +0 -11
  244. package/dist/libs/is/is-scrollable.cjs.js +0 -8
  245. package/dist/libs/is/is-touch-support.cjs.js +0 -11
  246. package/dist/libs/remove/index.cjs.js +0 -10
  247. package/dist/libs/remove/remove-all-html-tags.cjs.js +0 -12
  248. package/dist/libs/remove/remove-attribute.cjs.js +0 -6
  249. package/dist/libs/remove/remove-session-storage.cjs.js +0 -7
  250. package/dist/libs/remove/remove-style-property-value.cjs.js +0 -6
  251. package/dist/libs/security/html-sanitize.cjs.js +0 -9
  252. package/dist/libs/security/index.cjs.js +0 -5
  253. package/dist/libs/set/index.cjs.js +0 -14
  254. package/dist/libs/set/set-100vh.cjs.js +0 -7
  255. package/dist/libs/set/set-100vw.cjs.js +0 -7
  256. package/dist/libs/set/set-attribute.cjs.js +0 -6
  257. package/dist/libs/set/set-scroll-position-to-center.cjs.js +0 -10
  258. package/dist/libs/set/set-session-storage.cjs.js +0 -7
  259. package/dist/libs/set/set-style-property-value.cjs.js +0 -6
  260. package/dist/libs/to/index.cjs.js +0 -6
  261. package/dist/libs/to/to-boolean.cjs.js +0 -6
  262. package/dist/libs/to/to-positive-number.cjs.js +0 -4
  263. package/dist/libs/transform/index.cjs.js +0 -4
  264. package/dist/libs/transform/wrap-text-with-spans.cjs.js +0 -22
  265. package/dist/libs/wait/index.cjs.js +0 -6
  266. package/dist/libs/wait/sleep.cjs.js +0 -6
  267. package/dist/libs/wait/wait-for-all-media-loaded.cjs.js +0 -44
  268. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isBetween.cjs.js +0 -23
  269. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isBetween.es.js +0 -23
  270. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.cjs.js +0 -71
  271. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.es.js +0 -71
  272. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.cjs.js +0 -83
  273. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.es.js +0 -83
package/README.md CHANGED
@@ -36,6 +36,14 @@ Umaki is your one-stop solution for web development utilities, bringing together
36
36
  import { foo } from "umaki";
37
37
  ```
38
38
 
39
+ Category subpaths are also available to keep bundles small:
40
+
41
+ ```ts
42
+ import { debounce } from "umaki/eventControl";
43
+ ```
44
+
45
+ CommonJS (`require("umaki")`) is supported as well. Some dependencies are ESM-only, so loading umaki with `require` from Node.js needs a version that supports `require(esm)` (Node.js 20.19+ or 22.12+).
46
+
39
47
  ## Configuration
40
48
 
41
49
  ### setConfig
@@ -955,6 +963,9 @@ const output = removeAllHtmlTags(input);
955
963
  console.log(output); // 'Hello World!'
956
964
  ```
957
965
 
966
+ > [!NOTE]
967
+ > The result is an HTML string, not plain text. When the input contains `<`, special characters are escaped (e.g. `removeAllHtmlTags("Tom & Jerry <b>!</b>")` returns `'Tom &amp; Jerry !'`). It is safe to insert as HTML, but do not decode it and insert it as HTML. To keep safe markup instead, use [`sanitizeHtml`](#sanitizehtml).
968
+
958
969
  [View file →](src/libs/remove/remove-all-html-tags.ts)
959
970
 
960
971
  ### removeAttribute
@@ -1194,6 +1205,10 @@ This function uses `isomorphic-dompurify` and has the following features:
1194
1205
  - Removes dangerous HTML tags and attributes by default
1195
1206
  - Allows flexible control through custom configuration
1196
1207
  - Can be used on both server-side and client-side
1208
+ - Always returns a string (`RETURN_DOM`, `RETURN_DOM_FRAGMENT`, `RETURN_TRUSTED_TYPE` and `IN_PLACE` are ignored)
1209
+
1210
+ > [!WARNING]
1211
+ > The result is safe only as HTML element content (e.g. `innerHTML`). Do not use it for attribute values, URLs, `<script>` or CSS. Options such as `ALLOWED_URI_REGEXP`, `ADD_TAGS` and `ALLOW_UNKNOWN_PROTOCOLS` can weaken the protection.
1197
1212
 
1198
1213
  [View file →](src/libs/security/html-sanitize.ts)
1199
1214
 
package/dist/LICENSE.txt CHANGED
@@ -1,32 +1 @@
1
- Name: dayjs
2
- Version: 1.11.19
3
- License: MIT
4
- Private: false
5
- Description: 2KB immutable date time library alternative to Moment.js with the same modern API
6
- Repository: https://github.com/iamkun/dayjs.git
7
- Homepage: https://day.js.org
8
- Author: iamkun
9
- License Copyright:
10
- ===
11
-
12
- MIT License
13
-
14
- Copyright (c) 2018-present, iamkun
15
-
16
- Permission is hereby granted, free of charge, to any person obtaining a copy
17
- of this software and associated documentation files (the "Software"), to deal
18
- in the Software without restriction, including without limitation the rights
19
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
- copies of the Software, and to permit persons to whom the Software is
21
- furnished to do so, subject to the following conditions:
22
-
23
- The above copyright notice and this permission notice shall be included in all
24
- copies or substantial portions of the Software.
25
-
26
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
- SOFTWARE.
1
+ No third parties dependencies
@@ -0,0 +1,22 @@
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ exports.__toESM = __toESM;
package/dist/index.cjs ADDED
@@ -0,0 +1,138 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
+ const require_tap = require("./libs/callback/tap.cjs");
14
+ const require_tap_async = require("./libs/callback/tap-async.cjs");
15
+ const require_default_config = require("./libs/config/default-config.cjs");
16
+ const require_get_config = require("./libs/config/get-config.cjs");
17
+ const require_set_config = require("./libs/config/set-config.cjs");
18
+ const require_get_scrollbar_width = require("./libs/get/get-scrollbar-width.cjs");
19
+ const require_bg_scroll_stop = require("./libs/control/bg-scroll-stop.cjs");
20
+ const require_copy_to_clipboard = require("./libs/control/copy-to-clipboard.cjs");
21
+ const require_pd = require("./libs/control/pd.cjs");
22
+ const require_scroll_to_hash = require("./libs/control/scroll-to-hash.cjs");
23
+ const require_to_boolean = require("./libs/to/to-boolean.cjs");
24
+ const require_video_play_control = require("./libs/control/video-play-control.cjs");
25
+ const require_change_date_string_to_specific_format = require("./libs/convert/change-date-string-to-specific-format.cjs");
26
+ const require_hex_to_rgb = require("./libs/convert/hex-to-rgb.cjs");
27
+ const require_json_string_to_json_object = require("./libs/convert/json-string-to-json-object.cjs");
28
+ const require_rgb_to_hex = require("./libs/convert/rgb-to-hex.cjs");
29
+ const require_debounce = require("./libs/eventControl/debounce.cjs");
30
+ const require_throttle = require("./libs/eventControl/throttle.cjs");
31
+ const require_to_positive_number = require("./libs/to/to-positive-number.cjs");
32
+ const require_get_gcd = require("./libs/get/get-gcd.cjs");
33
+ const require_get_aspect_ratio = require("./libs/get/get-aspect-ratio.cjs");
34
+ const require_get_class_names = require("./libs/get/get-class-names.cjs");
35
+ const require_get_document_height = require("./libs/get/get-document-height.cjs");
36
+ const require_get_event_paths = require("./libs/get/get-event-paths.cjs");
37
+ const require_get_gravatar_url = require("./libs/get/get-gravatar-url.cjs");
38
+ const require_get_orientation = require("./libs/get/get-orientation.cjs");
39
+ const require_get_parent_list = require("./libs/get/get-parent-list.cjs");
40
+ const require_get_query_params = require("./libs/get/get-query-params.cjs");
41
+ const require_get_random_int = require("./libs/get/get-random-int.cjs");
42
+ const require_get_relative_time = require("./libs/get/get-relative-time.cjs");
43
+ const require_get_rem = require("./libs/get/get-rem.cjs");
44
+ const require_get_rendered_line_height = require("./libs/get/get-rendered-line-height.cjs");
45
+ const require_get_session_storage = require("./libs/get/get-session-storage.cjs");
46
+ const require_get_string_length = require("./libs/get/get-string-length.cjs");
47
+ const require_get_style_property_value = require("./libs/get/get-style-property-value.cjs");
48
+ const require_get_style_property_value_to_number = require("./libs/get/get-style-property-value-to-number.cjs");
49
+ const require_is_touch_support = require("./libs/is/is-touch-support.cjs");
50
+ const require_get_ua_data = require("./libs/get/get-ua-data.cjs");
51
+ const require_check_device_size = require("./libs/is/check-device-size.cjs");
52
+ const require_is_after_date_time = require("./libs/is/is-after-date-time.cjs");
53
+ const require_is_between_date_time = require("./libs/is/is-between-date-time.cjs");
54
+ const require_is_exist_all_elements = require("./libs/is/is-exist-all-elements.cjs");
55
+ const require_is_in_viewport = require("./libs/is/is-in-viewport.cjs");
56
+ const require_is_ipad = require("./libs/is/is-ipad.cjs");
57
+ const require_is_key_exists = require("./libs/is/is-key-exists.cjs");
58
+ const require_is_online = require("./libs/is/is-online.cjs");
59
+ const require_is_safari = require("./libs/is/is-safari.cjs");
60
+ const require_is_scrollable = require("./libs/is/is-scrollable.cjs");
61
+ const require_remove_all_html_tags = require("./libs/remove/remove-all-html-tags.cjs");
62
+ const require_remove_attribute = require("./libs/remove/remove-attribute.cjs");
63
+ const require_remove_session_storage = require("./libs/remove/remove-session-storage.cjs");
64
+ const require_remove_style_property_value = require("./libs/remove/remove-style-property-value.cjs");
65
+ const require_html_sanitize = require("./libs/security/html-sanitize.cjs");
66
+ const require_set_100vh = require("./libs/set/set-100vh.cjs");
67
+ const require_set_100vw = require("./libs/set/set-100vw.cjs");
68
+ const require_set_attribute = require("./libs/set/set-attribute.cjs");
69
+ const require_set_scroll_position_to_center = require("./libs/set/set-scroll-position-to-center.cjs");
70
+ const require_set_session_storage = require("./libs/set/set-session-storage.cjs");
71
+ const require_set_style_property_value = require("./libs/set/set-style-property-value.cjs");
72
+ const require_wrap_text_with_spans = require("./libs/transform/wrap-text-with-spans.cjs");
73
+ const require_sleep = require("./libs/wait/sleep.cjs");
74
+ const require_wait_for_all_media_loaded = require("./libs/wait/wait-for-all-media-loaded.cjs");
75
+ exports.bgScrollStop = require_bg_scroll_stop.bgScrollStop;
76
+ exports.changeDateStringToSpecificFormat = require_change_date_string_to_specific_format.changeDateStringToSpecificFormat;
77
+ exports.checkDeviceSize = require_check_device_size.checkDeviceSize;
78
+ exports.copyToClipboard = require_copy_to_clipboard.copyToClipboard;
79
+ exports.debounce = require_debounce.debounce;
80
+ exports.defaultConfig = require_default_config.defaultConfig;
81
+ exports.getAspectRatio = require_get_aspect_ratio.getAspectRatio;
82
+ exports.getClassNames = require_get_class_names.getClassNames;
83
+ exports.getConfig = require_get_config.getConfig;
84
+ exports.getConfigValue = require_get_config.getConfigValue;
85
+ exports.getDocumentHeight = require_get_document_height.getDocumentHeight;
86
+ exports.getEventPaths = require_get_event_paths.getEventPaths;
87
+ exports.getGcd = require_get_gcd.getGcd;
88
+ exports.getGravatarUrl = require_get_gravatar_url.getGravatarUrl;
89
+ exports.getOrientation = require_get_orientation.getOrientation;
90
+ exports.getParentList = require_get_parent_list.getParentList;
91
+ exports.getQueryParams = require_get_query_params.getQueryParams;
92
+ exports.getRandomInt = require_get_random_int.getRandomInt;
93
+ exports.getRelativeTime = require_get_relative_time.getRelativeTime;
94
+ exports.getRem = require_get_rem.getRem;
95
+ exports.getRenderedLineHeight = require_get_rendered_line_height.getRenderedLineHeight;
96
+ exports.getScrollbarWidth = require_get_scrollbar_width.getScrollbarWidth;
97
+ exports.getSessionStorage = require_get_session_storage.getSessionStorage;
98
+ exports.getStringLength = require_get_string_length.getStringLength;
99
+ exports.getStylePropertyValue = require_get_style_property_value.getStylePropertyValue;
100
+ exports.getStylePropertyValueToNumber = require_get_style_property_value_to_number.getStylePropertyValueToNumber;
101
+ exports.getUaData = require_get_ua_data.getUaData;
102
+ exports.hexToRgb = require_hex_to_rgb.hexToRgb;
103
+ exports.htmlSanitize = require_html_sanitize.htmlSanitize;
104
+ exports.isAfterDateTime = require_is_after_date_time.isAfterDateTime;
105
+ exports.isBetweenDateTime = require_is_between_date_time.isBetweenDateTime;
106
+ exports.isExistAllElements = require_is_exist_all_elements.isExistAllElements;
107
+ exports.isInViewport = require_is_in_viewport.isInViewport;
108
+ exports.isIpad = require_is_ipad.isIpad;
109
+ exports.isKeyExists = require_is_key_exists.isKeyExists;
110
+ exports.isOnline = require_is_online.isOnline;
111
+ exports.isSafari = require_is_safari.isSafari;
112
+ exports.isScrollable = require_is_scrollable.isScrollable;
113
+ exports.isTouchSupport = require_is_touch_support.isTouchSupport;
114
+ exports.jsonStringToJsonObject = require_json_string_to_json_object.jsonStringToJsonObject;
115
+ exports.pd = require_pd.pd;
116
+ exports.removeAllHtmlTags = require_remove_all_html_tags.removeAllHtmlTags;
117
+ exports.removeAttribute = require_remove_attribute.removeAttribute;
118
+ exports.removeSessionStorage = require_remove_session_storage.removeSessionStorage;
119
+ exports.removeStylePropertyValue = require_remove_style_property_value.removeStylePropertyValue;
120
+ exports.rgbToHex = require_rgb_to_hex.rgbToHex;
121
+ exports.sanitizeHtml = require_html_sanitize.sanitizeHtml;
122
+ exports.scrollToHash = require_scroll_to_hash.scrollToHash;
123
+ exports.set100vh = require_set_100vh.set100vh;
124
+ exports.set100vw = require_set_100vw.set100vw;
125
+ exports.setAttribute = require_set_attribute.setAttribute;
126
+ exports.setConfig = require_set_config.setConfig;
127
+ exports.setScrollPositionToCenter = require_set_scroll_position_to_center.setScrollPositionToCenter;
128
+ exports.setSessionStorage = require_set_session_storage.setSessionStorage;
129
+ exports.setStylePropertyValue = require_set_style_property_value.setStylePropertyValue;
130
+ exports.sleep = require_sleep.sleep;
131
+ exports.tap = require_tap.tap;
132
+ exports.tapAsync = require_tap_async.tapAsync;
133
+ exports.throttle = require_throttle.throttle;
134
+ exports.toBoolean = require_to_boolean.toBoolean;
135
+ exports.toPositiveNumber = require_to_positive_number.toPositiveNumber;
136
+ exports.videoPlayControl = require_video_play_control.videoPlayControl;
137
+ exports.waitForAllMediaLoaded = require_wait_for_all_media_loaded.waitForAllMediaLoaded;
138
+ exports.wrapTextWithSpans = require_wrap_text_with_spans.wrapTextWithSpans;
package/dist/index.es.js CHANGED
@@ -1,12 +1,25 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ */
1
12
  import { tap } from "./libs/callback/tap.es.js";
2
13
  import { tapAsync } from "./libs/callback/tap-async.es.js";
3
14
  import { defaultConfig } from "./libs/config/default-config.es.js";
4
15
  import { getConfig, getConfigValue } from "./libs/config/get-config.es.js";
5
16
  import { setConfig } from "./libs/config/set-config.es.js";
17
+ import { getScrollbarWidth } from "./libs/get/get-scrollbar-width.es.js";
6
18
  import { bgScrollStop } from "./libs/control/bg-scroll-stop.es.js";
7
19
  import { copyToClipboard } from "./libs/control/copy-to-clipboard.es.js";
8
20
  import { pd } from "./libs/control/pd.es.js";
9
21
  import { scrollToHash } from "./libs/control/scroll-to-hash.es.js";
22
+ import { toBoolean } from "./libs/to/to-boolean.es.js";
10
23
  import { videoPlayControl } from "./libs/control/video-play-control.es.js";
11
24
  import { changeDateStringToSpecificFormat } from "./libs/convert/change-date-string-to-specific-format.es.js";
12
25
  import { hexToRgb } from "./libs/convert/hex-to-rgb.es.js";
@@ -14,11 +27,12 @@ import { jsonStringToJsonObject } from "./libs/convert/json-string-to-json-objec
14
27
  import { rgbToHex } from "./libs/convert/rgb-to-hex.es.js";
15
28
  import { debounce } from "./libs/eventControl/debounce.es.js";
16
29
  import { throttle } from "./libs/eventControl/throttle.es.js";
30
+ import { toPositiveNumber } from "./libs/to/to-positive-number.es.js";
31
+ import { getGcd } from "./libs/get/get-gcd.es.js";
17
32
  import { getAspectRatio } from "./libs/get/get-aspect-ratio.es.js";
18
33
  import { getClassNames } from "./libs/get/get-class-names.es.js";
19
34
  import { getDocumentHeight } from "./libs/get/get-document-height.es.js";
20
35
  import { getEventPaths } from "./libs/get/get-event-paths.es.js";
21
- import { getGcd } from "./libs/get/get-gcd.es.js";
22
36
  import { getGravatarUrl } from "./libs/get/get-gravatar-url.es.js";
23
37
  import { getOrientation } from "./libs/get/get-orientation.es.js";
24
38
  import { getParentList } from "./libs/get/get-parent-list.es.js";
@@ -27,11 +41,11 @@ import { getRandomInt } from "./libs/get/get-random-int.es.js";
27
41
  import { getRelativeTime } from "./libs/get/get-relative-time.es.js";
28
42
  import { getRem } from "./libs/get/get-rem.es.js";
29
43
  import { getRenderedLineHeight } from "./libs/get/get-rendered-line-height.es.js";
30
- import { getScrollbarWidth } from "./libs/get/get-scrollbar-width.es.js";
31
44
  import { getSessionStorage } from "./libs/get/get-session-storage.es.js";
32
45
  import { getStringLength } from "./libs/get/get-string-length.es.js";
33
46
  import { getStylePropertyValue } from "./libs/get/get-style-property-value.es.js";
34
47
  import { getStylePropertyValueToNumber } from "./libs/get/get-style-property-value-to-number.es.js";
48
+ import { isTouchSupport } from "./libs/is/is-touch-support.es.js";
35
49
  import { getUaData } from "./libs/get/get-ua-data.es.js";
36
50
  import { checkDeviceSize } from "./libs/is/check-device-size.es.js";
37
51
  import { isAfterDateTime } from "./libs/is/is-after-date-time.es.js";
@@ -43,7 +57,6 @@ import { isKeyExists } from "./libs/is/is-key-exists.es.js";
43
57
  import { isOnline } from "./libs/is/is-online.es.js";
44
58
  import { isSafari } from "./libs/is/is-safari.es.js";
45
59
  import { isScrollable } from "./libs/is/is-scrollable.es.js";
46
- import { isTouchSupport } from "./libs/is/is-touch-support.es.js";
47
60
  import { removeAllHtmlTags } from "./libs/remove/remove-all-html-tags.es.js";
48
61
  import { removeAttribute } from "./libs/remove/remove-attribute.es.js";
49
62
  import { removeSessionStorage } from "./libs/remove/remove-session-storage.es.js";
@@ -55,74 +68,7 @@ import { setAttribute } from "./libs/set/set-attribute.es.js";
55
68
  import { setScrollPositionToCenter } from "./libs/set/set-scroll-position-to-center.es.js";
56
69
  import { setSessionStorage } from "./libs/set/set-session-storage.es.js";
57
70
  import { setStylePropertyValue } from "./libs/set/set-style-property-value.es.js";
58
- import { toBoolean } from "./libs/to/to-boolean.es.js";
59
- import { toPositiveNumber } from "./libs/to/to-positive-number.es.js";
60
71
  import { wrapTextWithSpans } from "./libs/transform/wrap-text-with-spans.es.js";
61
72
  import { sleep } from "./libs/wait/sleep.es.js";
62
73
  import { waitForAllMediaLoaded } from "./libs/wait/wait-for-all-media-loaded.es.js";
63
- export {
64
- bgScrollStop,
65
- changeDateStringToSpecificFormat,
66
- checkDeviceSize,
67
- copyToClipboard,
68
- debounce,
69
- defaultConfig,
70
- getAspectRatio,
71
- getClassNames,
72
- getConfig,
73
- getConfigValue,
74
- getDocumentHeight,
75
- getEventPaths,
76
- getGcd,
77
- getGravatarUrl,
78
- getOrientation,
79
- getParentList,
80
- getQueryParams,
81
- getRandomInt,
82
- getRelativeTime,
83
- getRem,
84
- getRenderedLineHeight,
85
- getScrollbarWidth,
86
- getSessionStorage,
87
- getStringLength,
88
- getStylePropertyValue,
89
- getStylePropertyValueToNumber,
90
- getUaData,
91
- hexToRgb,
92
- htmlSanitize,
93
- isAfterDateTime,
94
- isBetweenDateTime,
95
- isExistAllElements,
96
- isInViewport,
97
- isIpad,
98
- isKeyExists,
99
- isOnline,
100
- isSafari,
101
- isScrollable,
102
- isTouchSupport,
103
- jsonStringToJsonObject,
104
- pd,
105
- removeAllHtmlTags,
106
- removeAttribute,
107
- removeSessionStorage,
108
- removeStylePropertyValue,
109
- rgbToHex,
110
- sanitizeHtml,
111
- scrollToHash,
112
- set100vh,
113
- set100vw,
114
- setAttribute,
115
- setConfig,
116
- setScrollPositionToCenter,
117
- setSessionStorage,
118
- setStylePropertyValue,
119
- sleep,
120
- tap,
121
- tapAsync,
122
- throttle,
123
- toBoolean,
124
- toPositiveNumber,
125
- videoPlayControl,
126
- waitForAllMediaLoaded,
127
- wrapTextWithSpans
128
- };
74
+ export { bgScrollStop, changeDateStringToSpecificFormat, checkDeviceSize, copyToClipboard, debounce, defaultConfig, getAspectRatio, getClassNames, getConfig, getConfigValue, getDocumentHeight, getEventPaths, getGcd, getGravatarUrl, getOrientation, getParentList, getQueryParams, getRandomInt, getRelativeTime, getRem, getRenderedLineHeight, getScrollbarWidth, getSessionStorage, getStringLength, getStylePropertyValue, getStylePropertyValueToNumber, getUaData, hexToRgb, htmlSanitize, isAfterDateTime, isBetweenDateTime, isExistAllElements, isInViewport, isIpad, isKeyExists, isOnline, isSafari, isScrollable, isTouchSupport, jsonStringToJsonObject, pd, removeAllHtmlTags, removeAttribute, removeSessionStorage, removeStylePropertyValue, rgbToHex, sanitizeHtml, scrollToHash, set100vh, set100vw, setAttribute, setConfig, setScrollPositionToCenter, setSessionStorage, setStylePropertyValue, sleep, tap, tapAsync, throttle, toBoolean, toPositiveNumber, videoPlayControl, waitForAllMediaLoaded, wrapTextWithSpans };
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
+ const require_tap = require("./tap.cjs");
14
+ const require_tap_async = require("./tap-async.cjs");
15
+ exports.tap = require_tap.tap;
16
+ exports.tapAsync = require_tap_async.tapAsync;
@@ -1,6 +1,14 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ */
1
12
  import { tap } from "./tap.es.js";
2
13
  import { tapAsync } from "./tap-async.es.js";
3
- export {
4
- tap,
5
- tapAsync
6
- };
14
+ export { tap, tapAsync };
@@ -0,0 +1,7 @@
1
+ // src/libs/callback/tap-async.ts
2
+ var tapAsync = async (promise, callback) => {
3
+ const value = await promise;
4
+ callback(value);
5
+ return value;
6
+ };
7
+ exports.tapAsync = tapAsync;
@@ -1,8 +1,7 @@
1
- const tapAsync = async (promise, callback) => {
2
- const value = await promise;
3
- callback(value);
4
- return value;
5
- };
6
- export {
7
- tapAsync
1
+ // src/libs/callback/tap-async.ts
2
+ var tapAsync = async (promise, callback) => {
3
+ const value = await promise;
4
+ callback(value);
5
+ return value;
8
6
  };
7
+ export { tapAsync };
@@ -0,0 +1,6 @@
1
+ // src/libs/callback/tap.ts
2
+ var tap = (value, callback) => {
3
+ callback(value);
4
+ return value;
5
+ };
6
+ exports.tap = tap;
@@ -1,7 +1,6 @@
1
- const tap = (value, callback) => {
2
- callback(value);
3
- return value;
4
- };
5
- export {
6
- tap
1
+ // src/libs/callback/tap.ts
2
+ var tap = (value, callback) => {
3
+ callback(value);
4
+ return value;
7
5
  };
6
+ export { tap };
@@ -0,0 +1,3 @@
1
+ // src/libs/config/_internal.ts
2
+ var currentConfig = { ...require("./default-config.cjs").defaultConfig };
3
+ exports.currentConfig = currentConfig;
@@ -1,5 +1,4 @@
1
1
  import { defaultConfig } from "./default-config.es.js";
2
- const currentConfig = { ...defaultConfig };
3
- export {
4
- currentConfig
5
- };
2
+ // src/libs/config/_internal.ts
3
+ var currentConfig = { ...defaultConfig };
4
+ export { currentConfig };
@@ -0,0 +1,3 @@
1
+ // src/libs/config/default-config.ts
2
+ var defaultConfig = { BREAKPOINT: 768 };
3
+ exports.defaultConfig = defaultConfig;
@@ -1,6 +1,3 @@
1
- const defaultConfig = {
2
- BREAKPOINT: 768
3
- };
4
- export {
5
- defaultConfig
6
- };
1
+ // src/libs/config/default-config.ts
2
+ var defaultConfig = { BREAKPOINT: 768 };
3
+ export { defaultConfig };
@@ -0,0 +1,10 @@
1
+ const require__internal = require("./_internal.cjs");
2
+ // src/libs/config/get-config.ts
3
+ var getConfig = () => {
4
+ return { ...require__internal.currentConfig };
5
+ };
6
+ var getConfigValue = (key) => {
7
+ return require__internal.currentConfig[key];
8
+ };
9
+ exports.getConfig = getConfig;
10
+ exports.getConfigValue = getConfigValue;
@@ -1,11 +1,9 @@
1
1
  import { currentConfig } from "./_internal.es.js";
2
- const getConfig = () => {
3
- return { ...currentConfig };
2
+ // src/libs/config/get-config.ts
3
+ var getConfig = () => {
4
+ return { ...currentConfig };
4
5
  };
5
- const getConfigValue = (key) => {
6
- return currentConfig[key];
7
- };
8
- export {
9
- getConfig,
10
- getConfigValue
6
+ var getConfigValue = (key) => {
7
+ return currentConfig[key];
11
8
  };
9
+ export { getConfig, getConfigValue };
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
+ const require_default_config = require("./default-config.cjs");
14
+ const require_get_config = require("./get-config.cjs");
15
+ const require_set_config = require("./set-config.cjs");
16
+ exports.defaultConfig = require_default_config.defaultConfig;
17
+ exports.getConfig = require_get_config.getConfig;
18
+ exports.getConfigValue = require_get_config.getConfigValue;
19
+ exports.setConfig = require_set_config.setConfig;
@@ -1,9 +1,15 @@
1
+ /*!
2
+ * name: umaki
3
+ * version: v0.13.2
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
+ */
1
12
  import { defaultConfig } from "./default-config.es.js";
2
13
  import { getConfig, getConfigValue } from "./get-config.es.js";
3
14
  import { setConfig } from "./set-config.es.js";
4
- export {
5
- defaultConfig,
6
- getConfig,
7
- getConfigValue,
8
- setConfig
9
- };
15
+ export { defaultConfig, getConfig, getConfigValue, setConfig };
@@ -0,0 +1,15 @@
1
+ const require__internal = require("./_internal.cjs");
2
+ // src/libs/config/set-config.ts
3
+ var UNSAFE_KEYS = /* @__PURE__ */ new Set([
4
+ "__proto__",
5
+ "constructor",
6
+ "prototype"
7
+ ]);
8
+ var setConfig = (config) => {
9
+ for (const [key, value] of Object.entries(config)) {
10
+ if (UNSAFE_KEYS.has(key)) continue;
11
+ require__internal.currentConfig[key] = value;
12
+ }
13
+ return { ...require__internal.currentConfig };
14
+ };
15
+ exports.setConfig = setConfig;
@@ -3,5 +3,6 @@ import { UmakiConfig } from './types';
3
3
  * Set or update the configuration
4
4
  * @param config - Configuration object with values to update
5
5
  * @returns The updated configuration object
6
+ * `__proto__`, `constructor` and `prototype` keys are ignored.
6
7
  */
7
8
  export declare const setConfig: (config: Partial<UmakiConfig>) => UmakiConfig;
@@ -1,8 +1,15 @@
1
1
  import { currentConfig } from "./_internal.es.js";
2
- const setConfig = (config) => {
3
- Object.assign(currentConfig, config);
4
- return { ...currentConfig };
5
- };
6
- export {
7
- setConfig
2
+ // src/libs/config/set-config.ts
3
+ var UNSAFE_KEYS = /* @__PURE__ */ new Set([
4
+ "__proto__",
5
+ "constructor",
6
+ "prototype"
7
+ ]);
8
+ var setConfig = (config) => {
9
+ for (const [key, value] of Object.entries(config)) {
10
+ if (UNSAFE_KEYS.has(key)) continue;
11
+ currentConfig[key] = value;
12
+ }
13
+ return { ...currentConfig };
8
14
  };
15
+ export { setConfig };
@@ -0,0 +1,8 @@
1
+ const require_get_scrollbar_width = require("../get/get-scrollbar-width.cjs");
2
+ // src/libs/control/bg-scroll-stop.ts
3
+ var bgScrollStop = (isStop = true) => {
4
+ if (typeof window === "undefined") return;
5
+ document.body.style.paddingRight = isStop ? `${require_get_scrollbar_width.getScrollbarWidth()}px` : "";
6
+ document.body.style.overflow = isStop ? "hidden" : "";
7
+ };
8
+ exports.bgScrollStop = bgScrollStop;
@@ -11,5 +11,6 @@
11
11
  * When `isStop` is false, the function:
12
12
  * - Resets the body's `paddingRight` style.
13
13
  * - Resets the body's `overflow` style to allow background scrolling.
14
+ * Does nothing in SSR environments where window is undefined.
14
15
  */
15
16
  export declare const bgScrollStop: (isStop?: boolean) => void;
@@ -1,8 +1,8 @@
1
1
  import { getScrollbarWidth } from "../get/get-scrollbar-width.es.js";
2
- const bgScrollStop = (isStop = true) => {
3
- document.body.style.paddingRight = isStop ? `${getScrollbarWidth()}px` : "";
4
- document.body.style.overflow = isStop ? "hidden" : "";
5
- };
6
- export {
7
- bgScrollStop
2
+ // src/libs/control/bg-scroll-stop.ts
3
+ var bgScrollStop = (isStop = true) => {
4
+ if (typeof window === "undefined") return;
5
+ document.body.style.paddingRight = isStop ? `${getScrollbarWidth()}px` : "";
6
+ document.body.style.overflow = isStop ? "hidden" : "";
8
7
  };
8
+ export { bgScrollStop };