yummies 5.7.1 → 5.8.0

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 (391) hide show
  1. package/async.js +26 -59
  2. package/async.js.map +1 -0
  3. package/common.d.ts +1 -1
  4. package/common.d.ts.map +1 -1
  5. package/common.js +5 -13
  6. package/common.js.map +1 -0
  7. package/complex/global-config.d.ts +1 -1
  8. package/complex/global-config.d.ts.map +1 -1
  9. package/complex/index.d.ts +3 -3
  10. package/complex/index.d.ts.map +1 -1
  11. package/complex/modules-factory.d.ts +1 -1
  12. package/complex/modules-factory.d.ts.map +1 -1
  13. package/complex.js +66 -0
  14. package/complex.js.map +1 -0
  15. package/cookie.d.ts +1 -1
  16. package/cookie.d.ts.map +1 -1
  17. package/cookie.js +4 -8
  18. package/cookie.js.map +1 -0
  19. package/css.d.ts +1 -1
  20. package/css.js +2780 -49
  21. package/css.js.map +1 -0
  22. package/data.js +32 -50
  23. package/data.js.map +1 -0
  24. package/date-time.d.ts +2 -3
  25. package/date-time.d.ts.map +1 -1
  26. package/date-time.js +588 -154
  27. package/date-time.js.map +1 -0
  28. package/device.js +23 -20
  29. package/device.js.map +1 -0
  30. package/encodings.js +269 -265
  31. package/encodings.js.map +1 -0
  32. package/errors.d.ts +1 -1
  33. package/errors.d.ts.map +1 -1
  34. package/errors.js +8 -29
  35. package/errors.js.map +1 -0
  36. package/file.js +19 -23
  37. package/file.js.map +1 -0
  38. package/format/_exports.d.ts +4 -4
  39. package/format/_exports.d.ts.map +1 -1
  40. package/format/index.d.ts +1 -1
  41. package/format/index.d.ts.map +1 -1
  42. package/format/number.d.ts +1 -1
  43. package/format/number.d.ts.map +1 -1
  44. package/format/percent.d.ts +2 -2
  45. package/format/percent.d.ts.map +1 -1
  46. package/format.js +27 -0
  47. package/format.js.map +1 -0
  48. package/html.d.ts +2 -2
  49. package/html.d.ts.map +1 -1
  50. package/html.js +636 -169
  51. package/html.js.map +1 -0
  52. package/id.js +25 -70
  53. package/id.js.map +1 -0
  54. package/imports.js +22 -37
  55. package/imports.js.map +1 -0
  56. package/math.d.ts +1 -1
  57. package/math.d.ts.map +1 -1
  58. package/math.js +10 -14
  59. package/math.js.map +1 -0
  60. package/media.js +54 -96
  61. package/media.js.map +1 -0
  62. package/mobx/apply-observable.d.ts +1 -1
  63. package/mobx/apply-observable.d.ts.map +1 -1
  64. package/mobx/create-enhanced-atom.d.ts +2 -2
  65. package/mobx/create-enhanced-atom.d.ts.map +1 -1
  66. package/mobx/deep-observable-struct.d.ts +1 -1
  67. package/mobx/deep-observable-struct.d.ts.map +1 -1
  68. package/mobx/get-mobx-administration.d.ts +2 -2
  69. package/mobx/get-mobx-administration.d.ts.map +1 -1
  70. package/mobx/index.d.ts +5 -5
  71. package/mobx/index.d.ts.map +1 -1
  72. package/mobx.js +89 -0
  73. package/mobx.js.map +1 -0
  74. package/ms.js +12 -17
  75. package/ms.js.map +1 -0
  76. package/number.js +9 -12
  77. package/number.js.map +1 -0
  78. package/package.json +93 -92
  79. package/parser/_exports.d.ts +3 -3
  80. package/parser/_exports.d.ts.map +1 -1
  81. package/parser/index.d.ts +1 -1
  82. package/parser/index.d.ts.map +1 -1
  83. package/parser/number.d.ts +1 -1
  84. package/parser/number.d.ts.map +1 -1
  85. package/parser/percent.d.ts +2 -2
  86. package/parser/percent.d.ts.map +1 -1
  87. package/parser/string.d.ts +1 -1
  88. package/parser/string.d.ts.map +1 -1
  89. package/parser.js +15 -0
  90. package/parser.js.map +1 -0
  91. package/price.js +13 -16
  92. package/price.js.map +1 -0
  93. package/random.js +11 -13
  94. package/random.js.map +1 -0
  95. package/react/hooks/index.d.ts +21 -21
  96. package/react/hooks/index.d.ts.map +1 -1
  97. package/react/hooks/use-click-outside.d.ts +1 -1
  98. package/react/hooks/use-define-ref.d.ts +1 -1
  99. package/react/hooks/use-element-ref.d.ts +1 -1
  100. package/react/hooks/use-event.d.ts +1 -1
  101. package/react/hooks/use-event.d.ts.map +1 -1
  102. package/react/hooks/use-initial-height.d.ts +1 -1
  103. package/react/hooks/use-last-value-ref.d.ts +1 -1
  104. package/react/hooks/use-resize-observer.d.ts +1 -1
  105. package/react/hooks/use-sync-ref.d.ts +1 -1
  106. package/react/hooks/use-toggle.d.ts +1 -1
  107. package/react/hooks/use-value.d.ts +1 -1
  108. package/react/index.d.ts +1 -1
  109. package/react/index.d.ts.map +1 -1
  110. package/react.js +152 -0
  111. package/react.js.map +1 -0
  112. package/sound.js +7 -11
  113. package/sound.js.map +1 -0
  114. package/text.js +20 -46
  115. package/text.js.map +1 -0
  116. package/type-guard/_exports.d.ts +1 -1
  117. package/type-guard/_exports.d.ts.map +1 -1
  118. package/type-guard/index.d.ts +1 -1
  119. package/type-guard/index.d.ts.map +1 -1
  120. package/type-guard.js +5 -0
  121. package/type-guard.js.map +1 -0
  122. package/utility-types.d.ts.map +1 -0
  123. package/utility-types.js +2 -0
  124. package/utility-types.js.map +1 -0
  125. package/utils/types.js +2 -1
  126. package/utils/types.js.map +1 -0
  127. package/vibrate.js +6 -7
  128. package/vibrate.js.map +1 -0
  129. package/~index-C3wKHvHr.js +80 -0
  130. package/~index-C3wKHvHr.js.map +1 -0
  131. package/~number-EWff2XI6.js +25 -0
  132. package/~number-EWff2XI6.js.map +1 -0
  133. package/~number-baxVnzrJ.js +32 -0
  134. package/~number-baxVnzrJ.js.map +1 -0
  135. package/async.cjs +0 -70
  136. package/async.d.cts +0 -28
  137. package/async.d.cts.map +0 -1
  138. package/common.cjs +0 -18
  139. package/common.d.cts +0 -15
  140. package/common.d.cts.map +0 -1
  141. package/complex/counter.cjs +0 -21
  142. package/complex/counter.d.cts +0 -15
  143. package/complex/counter.d.cts.map +0 -1
  144. package/complex/counter.js +0 -17
  145. package/complex/global-config.cjs +0 -46
  146. package/complex/global-config.d.cts +0 -11
  147. package/complex/global-config.d.cts.map +0 -1
  148. package/complex/global-config.js +0 -41
  149. package/complex/index.cjs +0 -19
  150. package/complex/index.d.cts +0 -4
  151. package/complex/index.d.cts.map +0 -1
  152. package/complex/index.js +0 -3
  153. package/complex/modules-factory.cjs +0 -50
  154. package/complex/modules-factory.d.cts +0 -49
  155. package/complex/modules-factory.d.cts.map +0 -1
  156. package/complex/modules-factory.js +0 -46
  157. package/cookie.cjs +0 -13
  158. package/cookie.d.cts +0 -3
  159. package/cookie.d.cts.map +0 -1
  160. package/css.cjs +0 -64
  161. package/css.d.cts +0 -42
  162. package/css.d.cts.map +0 -1
  163. package/data.cjs +0 -58
  164. package/data.d.cts +0 -4
  165. package/data.d.cts.map +0 -1
  166. package/date-time.cjs +0 -171
  167. package/date-time.d.cts +0 -28
  168. package/date-time.d.cts.map +0 -1
  169. package/device.cjs +0 -28
  170. package/device.d.cts +0 -8
  171. package/device.d.cts.map +0 -1
  172. package/encodings.cjs +0 -270
  173. package/encodings.d.cts +0 -2
  174. package/encodings.d.cts.map +0 -1
  175. package/errors.cjs +0 -34
  176. package/errors.d.cts +0 -19
  177. package/errors.d.cts.map +0 -1
  178. package/file.cjs +0 -29
  179. package/file.d.cts +0 -3
  180. package/file.d.cts.map +0 -1
  181. package/format/_exports.cjs +0 -20
  182. package/format/_exports.d.cts +0 -5
  183. package/format/_exports.d.cts.map +0 -1
  184. package/format/_exports.js +0 -4
  185. package/format/constants.cjs +0 -6
  186. package/format/constants.d.cts +0 -4
  187. package/format/constants.d.cts.map +0 -1
  188. package/format/constants.js +0 -3
  189. package/format/index.cjs +0 -40
  190. package/format/index.d.cts +0 -3
  191. package/format/index.d.cts.map +0 -1
  192. package/format/index.js +0 -4
  193. package/format/number.cjs +0 -48
  194. package/format/number.d.cts +0 -36
  195. package/format/number.d.cts.map +0 -1
  196. package/format/number.js +0 -44
  197. package/format/percent.cjs +0 -27
  198. package/format/percent.d.cts +0 -15
  199. package/format/percent.d.cts.map +0 -1
  200. package/format/percent.js +0 -23
  201. package/format/skip-spaces.cjs +0 -8
  202. package/format/skip-spaces.d.cts +0 -5
  203. package/format/skip-spaces.d.cts.map +0 -1
  204. package/format/skip-spaces.js +0 -4
  205. package/html.cjs +0 -202
  206. package/html.d.cts +0 -44
  207. package/html.d.cts.map +0 -1
  208. package/id.cjs +0 -76
  209. package/id.d.cts +0 -63
  210. package/id.d.cts.map +0 -1
  211. package/imports.cjs +0 -45
  212. package/imports.d.cts +0 -15
  213. package/imports.d.cts.map +0 -1
  214. package/math.cjs +0 -23
  215. package/math.d.cts +0 -13
  216. package/math.d.cts.map +0 -1
  217. package/media.cjs +0 -115
  218. package/media.d.cts +0 -20
  219. package/media.d.cts.map +0 -1
  220. package/mobx/apply-observable.cjs +0 -16
  221. package/mobx/apply-observable.d.cts +0 -4
  222. package/mobx/apply-observable.d.cts.map +0 -1
  223. package/mobx/apply-observable.js +0 -12
  224. package/mobx/create-enhanced-atom.cjs +0 -16
  225. package/mobx/create-enhanced-atom.d.cts +0 -11
  226. package/mobx/create-enhanced-atom.d.cts.map +0 -1
  227. package/mobx/create-enhanced-atom.js +0 -12
  228. package/mobx/deep-observable-struct.cjs +0 -61
  229. package/mobx/deep-observable-struct.d.cts +0 -7
  230. package/mobx/deep-observable-struct.d.cts.map +0 -1
  231. package/mobx/deep-observable-struct.js +0 -57
  232. package/mobx/get-mobx-administration.cjs +0 -6
  233. package/mobx/get-mobx-administration.d.cts +0 -6
  234. package/mobx/get-mobx-administration.d.cts.map +0 -1
  235. package/mobx/get-mobx-administration.js +0 -2
  236. package/mobx/index.cjs +0 -21
  237. package/mobx/index.d.cts +0 -6
  238. package/mobx/index.d.cts.map +0 -1
  239. package/mobx/index.js +0 -5
  240. package/mobx/lazy-observe.cjs +0 -66
  241. package/mobx/lazy-observe.d.cts +0 -14
  242. package/mobx/lazy-observe.d.cts.map +0 -1
  243. package/mobx/lazy-observe.js +0 -62
  244. package/ms.cjs +0 -22
  245. package/ms.d.cts +0 -19
  246. package/ms.d.cts.map +0 -1
  247. package/number.cjs +0 -16
  248. package/number.d.cts +0 -8
  249. package/number.d.cts.map +0 -1
  250. package/parser/_exports.cjs +0 -19
  251. package/parser/_exports.d.cts +0 -4
  252. package/parser/_exports.d.cts.map +0 -1
  253. package/parser/_exports.js +0 -3
  254. package/parser/index.cjs +0 -40
  255. package/parser/index.d.cts +0 -3
  256. package/parser/index.d.cts.map +0 -1
  257. package/parser/index.js +0 -4
  258. package/parser/number.cjs +0 -48
  259. package/parser/number.d.cts +0 -21
  260. package/parser/number.d.cts.map +0 -1
  261. package/parser/number.js +0 -44
  262. package/parser/percent.cjs +0 -8
  263. package/parser/percent.d.cts +0 -4
  264. package/parser/percent.d.cts.map +0 -1
  265. package/parser/percent.js +0 -4
  266. package/parser/string.cjs +0 -18
  267. package/parser/string.d.cts +0 -7
  268. package/parser/string.d.cts.map +0 -1
  269. package/parser/string.js +0 -14
  270. package/price.cjs +0 -21
  271. package/price.d.cts +0 -6
  272. package/price.d.cts.map +0 -1
  273. package/random.cjs +0 -25
  274. package/random.d.cts +0 -9
  275. package/random.d.cts.map +0 -1
  276. package/react/hooks/index.cjs +0 -37
  277. package/react/hooks/index.d.cts +0 -22
  278. package/react/hooks/index.d.cts.map +0 -1
  279. package/react/hooks/index.js +0 -21
  280. package/react/hooks/use-abort-controller.cjs +0 -15
  281. package/react/hooks/use-abort-controller.d.cts +0 -2
  282. package/react/hooks/use-abort-controller.d.cts.map +0 -1
  283. package/react/hooks/use-abort-controller.js +0 -11
  284. package/react/hooks/use-abort-signal.cjs +0 -8
  285. package/react/hooks/use-abort-signal.d.cts +0 -2
  286. package/react/hooks/use-abort-signal.d.cts.map +0 -1
  287. package/react/hooks/use-abort-signal.js +0 -4
  288. package/react/hooks/use-click-outside.cjs +0 -17
  289. package/react/hooks/use-click-outside.d.cts +0 -9
  290. package/react/hooks/use-click-outside.d.cts.map +0 -1
  291. package/react/hooks/use-click-outside.js +0 -13
  292. package/react/hooks/use-constant.cjs +0 -19
  293. package/react/hooks/use-constant.d.cts +0 -9
  294. package/react/hooks/use-constant.d.cts.map +0 -1
  295. package/react/hooks/use-constant.js +0 -15
  296. package/react/hooks/use-define-ref.cjs +0 -19
  297. package/react/hooks/use-define-ref.d.cts +0 -10
  298. package/react/hooks/use-define-ref.d.cts.map +0 -1
  299. package/react/hooks/use-define-ref.js +0 -15
  300. package/react/hooks/use-element-ref.cjs +0 -12
  301. package/react/hooks/use-element-ref.d.cts +0 -2
  302. package/react/hooks/use-element-ref.d.cts.map +0 -1
  303. package/react/hooks/use-element-ref.js +0 -8
  304. package/react/hooks/use-event-listener.cjs +0 -17
  305. package/react/hooks/use-event-listener.d.cts +0 -8
  306. package/react/hooks/use-event-listener.d.cts.map +0 -1
  307. package/react/hooks/use-event-listener.js +0 -13
  308. package/react/hooks/use-event.cjs +0 -23
  309. package/react/hooks/use-event.d.cts +0 -3
  310. package/react/hooks/use-event.d.cts.map +0 -1
  311. package/react/hooks/use-event.js +0 -19
  312. package/react/hooks/use-flag.cjs +0 -19
  313. package/react/hooks/use-flag.d.cts +0 -8
  314. package/react/hooks/use-flag.d.cts.map +0 -1
  315. package/react/hooks/use-flag.js +0 -15
  316. package/react/hooks/use-force-update.cjs +0 -11
  317. package/react/hooks/use-force-update.d.cts +0 -2
  318. package/react/hooks/use-force-update.d.cts.map +0 -1
  319. package/react/hooks/use-force-update.js +0 -7
  320. package/react/hooks/use-initial-height.cjs +0 -15
  321. package/react/hooks/use-initial-height.d.cts +0 -5
  322. package/react/hooks/use-initial-height.d.cts.map +0 -1
  323. package/react/hooks/use-initial-height.js +0 -11
  324. package/react/hooks/use-instance.cjs +0 -31
  325. package/react/hooks/use-instance.d.cts +0 -27
  326. package/react/hooks/use-instance.d.cts.map +0 -1
  327. package/react/hooks/use-instance.js +0 -27
  328. package/react/hooks/use-intersection-observer.cjs +0 -14
  329. package/react/hooks/use-intersection-observer.d.cts +0 -2
  330. package/react/hooks/use-intersection-observer.d.cts.map +0 -1
  331. package/react/hooks/use-intersection-observer.js +0 -10
  332. package/react/hooks/use-last-defined-value.cjs +0 -12
  333. package/react/hooks/use-last-defined-value.d.cts +0 -2
  334. package/react/hooks/use-last-defined-value.d.cts.map +0 -1
  335. package/react/hooks/use-last-defined-value.js +0 -8
  336. package/react/hooks/use-last-value-ref.cjs +0 -12
  337. package/react/hooks/use-last-value-ref.d.cts +0 -2
  338. package/react/hooks/use-last-value-ref.d.cts.map +0 -1
  339. package/react/hooks/use-last-value-ref.js +0 -8
  340. package/react/hooks/use-life-cycle.cjs +0 -14
  341. package/react/hooks/use-life-cycle.d.cts +0 -5
  342. package/react/hooks/use-life-cycle.d.cts.map +0 -1
  343. package/react/hooks/use-life-cycle.js +0 -10
  344. package/react/hooks/use-resize-observer.cjs +0 -15
  345. package/react/hooks/use-resize-observer.d.cts +0 -2
  346. package/react/hooks/use-resize-observer.d.cts.map +0 -1
  347. package/react/hooks/use-resize-observer.js +0 -11
  348. package/react/hooks/use-sync-ref.cjs +0 -10
  349. package/react/hooks/use-sync-ref.d.cts +0 -2
  350. package/react/hooks/use-sync-ref.d.cts.map +0 -1
  351. package/react/hooks/use-sync-ref.js +0 -6
  352. package/react/hooks/use-toggle.cjs +0 -10
  353. package/react/hooks/use-toggle.d.cts +0 -2
  354. package/react/hooks/use-toggle.d.cts.map +0 -1
  355. package/react/hooks/use-toggle.js +0 -6
  356. package/react/hooks/use-value.cjs +0 -12
  357. package/react/hooks/use-value.d.cts +0 -5
  358. package/react/hooks/use-value.d.cts.map +0 -1
  359. package/react/hooks/use-value.js +0 -8
  360. package/react/hooks/use-visibility-state.cjs +0 -18
  361. package/react/hooks/use-visibility-state.d.cts +0 -2
  362. package/react/hooks/use-visibility-state.d.cts.map +0 -1
  363. package/react/hooks/use-visibility-state.js +0 -14
  364. package/react/index.cjs +0 -17
  365. package/react/index.d.cts +0 -2
  366. package/react/index.d.cts.map +0 -1
  367. package/react/index.js +0 -1
  368. package/sound.cjs +0 -16
  369. package/sound.d.cts +0 -7
  370. package/sound.d.cts.map +0 -1
  371. package/storage.cjs +0 -48
  372. package/storage.d.cts +0 -39
  373. package/storage.d.cts.map +0 -1
  374. package/storage.js +0 -43
  375. package/text.cjs +0 -53
  376. package/text.d.cts +0 -15
  377. package/text.d.cts.map +0 -1
  378. package/type-guard/_exports.cjs +0 -129
  379. package/type-guard/_exports.d.cts +0 -86
  380. package/type-guard/_exports.d.cts.map +0 -1
  381. package/type-guard/_exports.js +0 -125
  382. package/type-guard/index.cjs +0 -40
  383. package/type-guard/index.d.cts +0 -3
  384. package/type-guard/index.d.cts.map +0 -1
  385. package/type-guard/index.js +0 -4
  386. package/utils/types.cjs +0 -2
  387. package/utils/types.d.cts +0 -395
  388. package/utils/types.d.cts.map +0 -1
  389. package/vibrate.cjs +0 -12
  390. package/vibrate.d.cts +0 -5
  391. package/vibrate.d.cts.map +0 -1
package/date-time.cjs DELETED
@@ -1,171 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.timeDuration = exports.changeDate = exports.dayTimeDuration = exports.formatDate = void 0;
7
- exports.getFormatDuration = getFormatDuration;
8
- const dayjs_1 = __importDefault(require("dayjs"));
9
- const duration_js_1 = __importDefault(require("dayjs/plugin/duration.js"));
10
- const relativeTime_js_1 = __importDefault(require("dayjs/plugin/relativeTime.js"));
11
- const index_js_1 = require("./format/index.cjs");
12
- const ms_js_1 = require("./ms.cjs");
13
- const text_js_1 = require("./text.cjs");
14
- const index_js_2 = require("./type-guard/index.cjs");
15
- require("dayjs/locale/ru.js");
16
- dayjs_1.default.extend(relativeTime_js_1.default);
17
- dayjs_1.default.extend(duration_js_1.default);
18
- dayjs_1.default.locale('ru');
19
- const toLibFormat = (value, asTime) => {
20
- if (index_js_2.typeGuard.isNumber(value)) {
21
- if (asTime) {
22
- return dayjs_1.default.duration(value);
23
- }
24
- return (0, dayjs_1.default)(value);
25
- }
26
- else if (dayjs_1.default.isDayjs(value)) {
27
- return value;
28
- }
29
- else {
30
- return (0, dayjs_1.default)(value);
31
- }
32
- };
33
- const formatDate = (value, settings) => {
34
- const dateFormat = settings?.format;
35
- const datePattern = settings?.pattern;
36
- const asTime = settings?.asTime;
37
- value = toLibFormat(value, asTime);
38
- if (index_js_2.typeGuard.isUndefined(value) || !value.isValid()) {
39
- return index_js_1.format.NO_VALUE;
40
- }
41
- if (datePattern) {
42
- return value.format(datePattern);
43
- }
44
- switch (dateFormat) {
45
- case 'human': {
46
- return value.fromNow();
47
- }
48
- case 'spent-time': {
49
- return value.fromNow(true);
50
- }
51
- case 'full': {
52
- return value.format('DD MMM YYYY HH:mm:ss');
53
- }
54
- case 'short': {
55
- return value.format('DD MMM HH:mm');
56
- }
57
- case 'time': {
58
- return value.format('HH:mm:ss');
59
- }
60
- case 'time-short': {
61
- return value.format('HH:mm');
62
- }
63
- case 'day': {
64
- return value.format('DD MMM YYYY');
65
- }
66
- case 'month': {
67
- return value.format('MMMM YYYY');
68
- }
69
- default: {
70
- return value.format('DD.MM.YYYY');
71
- }
72
- }
73
- };
74
- exports.formatDate = formatDate;
75
- const dayTimeDuration = (timeInMs) => {
76
- let left = Math.max(timeInMs, 0);
77
- const days = Math.floor(left / ms_js_1.unitsToMs.day);
78
- left = left % ms_js_1.unitsToMs.day;
79
- const hours = Math.floor(left / ms_js_1.unitsToMs.hour);
80
- left = left % ms_js_1.unitsToMs.hour;
81
- const minutes = Math.floor(left / ms_js_1.unitsToMs.min);
82
- left = left % ms_js_1.unitsToMs.min;
83
- const seconds = Math.floor(left / ms_js_1.unitsToMs.sec);
84
- left = left % ms_js_1.unitsToMs.sec;
85
- const milliseconds = Math.floor(left);
86
- return {
87
- days,
88
- hours,
89
- minutes,
90
- seconds,
91
- milliseconds,
92
- };
93
- };
94
- exports.dayTimeDuration = dayTimeDuration;
95
- const changeDate = (date, ...args) => {
96
- let wrappedDate = toLibFormat(date);
97
- for (let i = 0; i < args.length; i += 2) {
98
- const amount = args[i];
99
- const unit = args[i + 1];
100
- if (unit != null) {
101
- wrappedDate = wrappedDate.add(amount, unit);
102
- }
103
- }
104
- return wrappedDate.toDate();
105
- };
106
- exports.changeDate = changeDate;
107
- const timeDuration = (timeInMs) => {
108
- const { days, hours, milliseconds, minutes, seconds } = (0, exports.dayTimeDuration)(timeInMs);
109
- return {
110
- hours: hours + ms_js_1.unitsToMs.day * days,
111
- milliseconds,
112
- minutes,
113
- seconds,
114
- };
115
- };
116
- exports.timeDuration = timeDuration;
117
- const durationFormatLabels = {
118
- days: { compact: 'д', full: ['день', 'дня', 'дней'] },
119
- hours: { compact: 'ч', full: ['час', 'часа', 'часов'] },
120
- minutes: { compact: 'мин', full: ['минута', 'минуты', 'минут'] },
121
- seconds: { compact: 'сек', full: ['секунда', 'секунды', 'секунд'] },
122
- };
123
- function getFormatDuration(...args) {
124
- let compact = false;
125
- let diff = 0;
126
- if (args[0] instanceof Date) {
127
- const startedDate = (0, dayjs_1.default)(args[0]);
128
- const endedDate = (0, dayjs_1.default)(args[1]);
129
- diff = endedDate.diff(startedDate, 'ms');
130
- compact = args[2] === true;
131
- }
132
- else {
133
- diff = args[0];
134
- compact = args[1] === true;
135
- }
136
- const { days, hours, minutes, seconds } = (0, exports.dayTimeDuration)(diff);
137
- const formattedParts = [];
138
- if (days) {
139
- if (compact) {
140
- formattedParts.push(`${days} ${durationFormatLabels.days.compact}`);
141
- }
142
- else {
143
- formattedParts.push(`${days} ${(0, text_js_1.declension)(days, durationFormatLabels.days.full)}`);
144
- }
145
- }
146
- if (hours) {
147
- if (compact) {
148
- formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);
149
- }
150
- else {
151
- formattedParts.push(`${hours} ${(0, text_js_1.declension)(hours, durationFormatLabels.hours.full)}`);
152
- }
153
- }
154
- if (minutes) {
155
- if (compact) {
156
- formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);
157
- }
158
- else {
159
- formattedParts.push(`${minutes} ${(0, text_js_1.declension)(minutes, durationFormatLabels.minutes.full)}`);
160
- }
161
- }
162
- if (seconds) {
163
- if (compact) {
164
- formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);
165
- }
166
- else {
167
- formattedParts.push(`${seconds} ${(0, text_js_1.declension)(seconds, durationFormatLabels.seconds.full)}`);
168
- }
169
- }
170
- return formattedParts.join(' ');
171
- }
package/date-time.d.cts DELETED
@@ -1,28 +0,0 @@
1
- import { type Dayjs, type ManipulateType } from 'dayjs';
2
- import type { Maybe } from "./utils/types.cjs";
3
- import 'dayjs/locale/ru.js';
4
- export type RawDateToFormat = Date | string | number | Dayjs;
5
- export declare const formatDate: (value: Maybe<RawDateToFormat>, settings?: Maybe<{
6
- format?: "human" | "full" | "short" | "day" | "day-only" | "date" | "month" | "spent-time" | "time" | "time-short";
7
- pattern?: string;
8
- asTime?: boolean;
9
- }>) => string;
10
- export declare const dayTimeDuration: (timeInMs: number) => {
11
- days: number;
12
- hours: number;
13
- minutes: number;
14
- seconds: number;
15
- milliseconds: number;
16
- };
17
- type DateChangeParam = [amount: number, unit?: Maybe<ManipulateType>];
18
- export declare const changeDate: (date: Maybe<RawDateToFormat>, ...args: [...DateChangeParam, ...Partial<DateChangeParam>, ...Partial<DateChangeParam>, ...Partial<DateChangeParam>, ...Partial<DateChangeParam>, ...Partial<DateChangeParam>]) => Date;
19
- export declare const timeDuration: (timeInMs: number) => {
20
- hours: number;
21
- milliseconds: number;
22
- minutes: number;
23
- seconds: number;
24
- };
25
- export declare function getFormatDuration(dateA: Date, dateB: Date, compact?: boolean): string;
26
- export declare function getFormatDuration(ms: number, compact?: boolean): string;
27
- export {};
28
- //# sourceMappingURL=date-time.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../src/date-time.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,KAAK,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAQ/D,OAAO,KAAK,EAAE,KAAK,EAAE,0BAAyB;AAE9C,OAAO,oBAAoB,CAAC;AAsB5B,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAE7D,eAAO,MAAM,UAAU,GACrB,OAAO,KAAK,CAAC,eAAe,CAAC,EAC7B,WAAW,KAAK,CAAC;IACf,MAAM,CAAC,EACH,OAAO,GACP,MAAM,GACN,OAAO,GACP,KAAK,GACL,UAAU,GACV,MAAM,GACN,OAAO,GACP,YAAY,GACZ,MAAM,GACN,YAAY,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,WA6CH,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM;;;;;;CAwB/C,CAAC;AAEF,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAEtE,eAAO,MAAM,UAAU,GACrB,MAAM,KAAK,CAAC,eAAe,CAAC,EAC5B,GAAG,MAAM,CACP,GAAG,eAAe,EAClB,GAAG,OAAO,CAAC,eAAe,CAAC,EAC3B,GAAG,OAAO,CAAC,eAAe,CAAC,EAC3B,GAAG,OAAO,CAAC,eAAe,CAAC,EAC3B,GAAG,OAAO,CAAC,eAAe,CAAC,EAC3B,GAAG,OAAO,CAAC,eAAe,CAAC,CAC5B,SAaF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,UAAU,MAAM;;;;;CAU5C,CAAC;AASF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,EACX,KAAK,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAAC;AACV,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC"}
package/device.cjs DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTouchDevice = exports.isTabletDevice = exports.isMobileDevice = exports.checkIsTouchDevice = exports.checkIsTabletDevice = exports.checkIsMobileDevice = exports.getUserAgent = void 0;
4
- const getUserAgent = () => (navigator.userAgent ||
5
- navigator.vendor ||
6
- // @ts-expect-error skip opera
7
- globalThis.opera ||
8
- '').toLowerCase();
9
- exports.getUserAgent = getUserAgent;
10
- const checkIsMobileDevice = () => {
11
- const userAgent = (0, exports.getUserAgent)();
12
- if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(userAgent || '') ||
13
- /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test((userAgent || '').slice(0, 4))) {
14
- return true;
15
- }
16
- return false;
17
- };
18
- exports.checkIsMobileDevice = checkIsMobileDevice;
19
- const checkIsTabletDevice = () => {
20
- const userAgent = (0, exports.getUserAgent)();
21
- return /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(userAgent);
22
- };
23
- exports.checkIsTabletDevice = checkIsTabletDevice;
24
- const checkIsTouchDevice = () => (0, exports.checkIsMobileDevice)() || (0, exports.checkIsTabletDevice)();
25
- exports.checkIsTouchDevice = checkIsTouchDevice;
26
- exports.isMobileDevice = (0, exports.checkIsMobileDevice)();
27
- exports.isTabletDevice = (0, exports.checkIsTabletDevice)();
28
- exports.isTouchDevice = exports.isMobileDevice || exports.isTabletDevice;
package/device.d.cts DELETED
@@ -1,8 +0,0 @@
1
- export declare const getUserAgent: () => any;
2
- export declare const checkIsMobileDevice: () => boolean;
3
- export declare const checkIsTabletDevice: () => boolean;
4
- export declare const checkIsTouchDevice: () => boolean;
5
- export declare const isMobileDevice: boolean;
6
- export declare const isTabletDevice: boolean;
7
- export declare const isTouchDevice: boolean;
8
- //# sourceMappingURL=device.d.ts.map
package/device.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,WAOR,CAAC;AAElB,eAAO,MAAM,mBAAmB,eAe/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAM/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,eACiB,CAAC;AAEjD,eAAO,MAAM,cAAc,SAAwB,CAAC;AAEpD,eAAO,MAAM,cAAc,SAAwB,CAAC;AAEpD,eAAO,MAAM,aAAa,SAAmC,CAAC"}
package/encodings.cjs DELETED
@@ -1,270 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unicodeToWin1251 = unicodeToWin1251;
4
- const DMap = {
5
- 0: 0,
6
- 1: 1,
7
- 2: 2,
8
- 3: 3,
9
- 4: 4,
10
- 5: 5,
11
- 6: 6,
12
- 7: 7,
13
- 8: 8,
14
- 9: 9,
15
- 10: 10,
16
- 11: 11,
17
- 12: 12,
18
- 13: 13,
19
- 14: 14,
20
- 15: 15,
21
- 16: 16,
22
- 17: 17,
23
- 18: 18,
24
- 19: 19,
25
- 20: 20,
26
- 21: 21,
27
- 22: 22,
28
- 23: 23,
29
- 24: 24,
30
- 25: 25,
31
- 26: 26,
32
- 27: 27,
33
- 28: 28,
34
- 29: 29,
35
- 30: 30,
36
- 31: 31,
37
- 32: 32,
38
- 33: 33,
39
- 34: 34,
40
- 35: 35,
41
- 36: 36,
42
- 37: 37,
43
- 38: 38,
44
- 39: 39,
45
- 40: 40,
46
- 41: 41,
47
- 42: 42,
48
- 43: 43,
49
- 44: 44,
50
- 45: 45,
51
- 46: 46,
52
- 47: 47,
53
- 48: 48,
54
- 49: 49,
55
- 50: 50,
56
- 51: 51,
57
- 52: 52,
58
- 53: 53,
59
- 54: 54,
60
- 55: 55,
61
- 56: 56,
62
- 57: 57,
63
- 58: 58,
64
- 59: 59,
65
- 60: 60,
66
- 61: 61,
67
- 62: 62,
68
- 63: 63,
69
- 64: 64,
70
- 65: 65,
71
- 66: 66,
72
- 67: 67,
73
- 68: 68,
74
- 69: 69,
75
- 70: 70,
76
- 71: 71,
77
- 72: 72,
78
- 73: 73,
79
- 74: 74,
80
- 75: 75,
81
- 76: 76,
82
- 77: 77,
83
- 78: 78,
84
- 79: 79,
85
- 80: 80,
86
- 81: 81,
87
- 82: 82,
88
- 83: 83,
89
- 84: 84,
90
- 85: 85,
91
- 86: 86,
92
- 87: 87,
93
- 88: 88,
94
- 89: 89,
95
- 90: 90,
96
- 91: 91,
97
- 92: 92,
98
- 93: 93,
99
- 94: 94,
100
- 95: 95,
101
- 96: 96,
102
- 97: 97,
103
- 98: 98,
104
- 99: 99,
105
- 100: 100,
106
- 101: 101,
107
- 102: 102,
108
- 103: 103,
109
- 104: 104,
110
- 105: 105,
111
- 106: 106,
112
- 107: 107,
113
- 108: 108,
114
- 109: 109,
115
- 110: 110,
116
- 111: 111,
117
- 112: 112,
118
- 113: 113,
119
- 114: 114,
120
- 115: 115,
121
- 116: 116,
122
- 117: 117,
123
- 118: 118,
124
- 119: 119,
125
- 120: 120,
126
- 121: 121,
127
- 122: 122,
128
- 123: 123,
129
- 124: 124,
130
- 125: 125,
131
- 126: 126,
132
- 127: 127,
133
- 1027: 129,
134
- 8225: 135,
135
- 1046: 198,
136
- 8222: 132,
137
- 1047: 199,
138
- 1168: 165,
139
- 1048: 200,
140
- 1113: 154,
141
- 1049: 201,
142
- 1045: 197,
143
- 1050: 202,
144
- 1028: 170,
145
- 160: 160,
146
- 1040: 192,
147
- 1051: 203,
148
- 164: 164,
149
- 166: 166,
150
- 167: 167,
151
- 169: 169,
152
- 171: 171,
153
- 172: 172,
154
- 173: 173,
155
- 174: 174,
156
- 1053: 205,
157
- 176: 176,
158
- 177: 177,
159
- 1114: 156,
160
- 181: 181,
161
- 182: 182,
162
- 183: 183,
163
- 8221: 148,
164
- 187: 187,
165
- 1029: 189,
166
- 1056: 208,
167
- 1057: 209,
168
- 1058: 210,
169
- 8364: 136,
170
- 1112: 188,
171
- 1115: 158,
172
- 1059: 211,
173
- 1060: 212,
174
- 1030: 178,
175
- 1061: 213,
176
- 1062: 214,
177
- 1063: 215,
178
- 1116: 157,
179
- 1064: 216,
180
- 1065: 217,
181
- 1031: 175,
182
- 1066: 218,
183
- 1067: 219,
184
- 1068: 220,
185
- 1069: 221,
186
- 1070: 222,
187
- 1032: 163,
188
- 8226: 149,
189
- 1071: 223,
190
- 1072: 224,
191
- 8482: 153,
192
- 1073: 225,
193
- 8240: 137,
194
- 1118: 162,
195
- 1074: 226,
196
- 1110: 179,
197
- 8230: 133,
198
- 1075: 227,
199
- 1033: 138,
200
- 1076: 228,
201
- 1077: 229,
202
- 8211: 150,
203
- 1078: 230,
204
- 1119: 159,
205
- 1079: 231,
206
- 1042: 194,
207
- 1080: 232,
208
- 1034: 140,
209
- 1025: 168,
210
- 1081: 233,
211
- 1082: 234,
212
- 8212: 151,
213
- 1083: 235,
214
- 1169: 180,
215
- 1084: 236,
216
- 1052: 204,
217
- 1085: 237,
218
- 1035: 142,
219
- 1086: 238,
220
- 1087: 239,
221
- 1088: 240,
222
- 1089: 241,
223
- 1090: 242,
224
- 1036: 141,
225
- 1041: 193,
226
- 1091: 243,
227
- 1092: 244,
228
- 8224: 134,
229
- 1093: 245,
230
- 8470: 185,
231
- 1094: 246,
232
- 1054: 206,
233
- 1095: 247,
234
- 1096: 248,
235
- 8249: 139,
236
- 1097: 249,
237
- 1098: 250,
238
- 1044: 196,
239
- 1099: 251,
240
- 1111: 191,
241
- 1055: 207,
242
- 1100: 252,
243
- 1038: 161,
244
- 8220: 147,
245
- 1101: 253,
246
- 8250: 155,
247
- 1102: 254,
248
- 8216: 145,
249
- 1103: 255,
250
- 1043: 195,
251
- 1105: 184,
252
- 1039: 143,
253
- 1026: 128,
254
- 1106: 144,
255
- 8218: 130,
256
- 1107: 131,
257
- 8217: 146,
258
- 1108: 186,
259
- 1109: 190,
260
- };
261
- function unicodeToWin1251(s) {
262
- const L = [];
263
- for (let i = 0; i < s.length; i++) {
264
- const ord = s.charCodeAt(i);
265
- if (!(ord in DMap))
266
- throw new Error(`Character ${s.charAt(i)} isn't supported by win1251!`);
267
- L.push(String.fromCharCode(DMap[ord]));
268
- }
269
- return L.join('');
270
- }
package/encodings.d.cts DELETED
@@ -1,2 +0,0 @@
1
- export declare function unicodeToWin1251(s: string): string;
2
- //# sourceMappingURL=encodings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"encodings.d.ts","sourceRoot":"","sources":["../src/encodings.ts"],"names":[],"mappings":"AAoQA,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,UASzC"}
package/errors.cjs DELETED
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getErrorText = void 0;
4
- const index_js_1 = require("./type-guard/index.cjs");
5
- /**
6
- * Universal function for transforming any errors into readable error text
7
- *
8
- * This function can be enhanced with custom handlers using:
9
- * - `getErrorText.unknownErrorText`
10
- * - `getErrorText.formatError`
11
- * - `getErrorText.enhance`
12
- */
13
- const getErrorText = (error) => {
14
- if (!error) {
15
- return exports.getErrorText.unknownErrorText;
16
- }
17
- if (index_js_1.typeGuard.isString(error)) {
18
- return error || exports.getErrorText.unknownErrorText;
19
- }
20
- if (error instanceof Error) {
21
- return ((exports.getErrorText.formatError?.(error) ?? error.message) ||
22
- exports.getErrorText.unknownErrorText);
23
- }
24
- if (exports.getErrorText.enhance) {
25
- return exports.getErrorText.enhance(error) ?? exports.getErrorText.unknownErrorText;
26
- }
27
- else {
28
- return exports.getErrorText.unknownErrorText;
29
- }
30
- };
31
- exports.getErrorText = getErrorText;
32
- exports.getErrorText.unknownErrorText = '';
33
- exports.getErrorText.formatError = null;
34
- exports.getErrorText.enhance = null;
package/errors.d.cts DELETED
@@ -1,19 +0,0 @@
1
- import type { Maybe } from "./utils/types.cjs";
2
- type GetErrorTextEnhancer = (error: any) => string;
3
- type GetErrorTextFormatErrorFn = (error: Error) => string;
4
- /**
5
- * Universal function for transforming any errors into readable error text
6
- *
7
- * This function can be enhanced with custom handlers using:
8
- * - `getErrorText.unknownErrorText`
9
- * - `getErrorText.formatError`
10
- * - `getErrorText.enhance`
11
- */
12
- export declare const getErrorText: {
13
- (error: unknown): string;
14
- unknownErrorText: string;
15
- formatError: Maybe<GetErrorTextFormatErrorFn>;
16
- enhance: Maybe<GetErrorTextEnhancer>;
17
- };
18
- export {};
19
- //# sourceMappingURL=errors.d.ts.map
package/errors.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,0BAAyB;AAE9C,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,CAAC;AACnD,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;YAAW,OAAO;;;;CAqB1C,CAAC"}
package/file.cjs DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTextFromFile = exports.getBase64FromFile = void 0;
4
- const getBase64FromFile = (file) => {
5
- return new Promise((resolve, reject) => {
6
- const reader = new FileReader();
7
- reader.readAsDataURL(file);
8
- reader.onload = () => {
9
- resolve(reader.result.toString());
10
- };
11
- reader.onerror = (error) => {
12
- reject(error);
13
- };
14
- });
15
- };
16
- exports.getBase64FromFile = getBase64FromFile;
17
- const getTextFromFile = (file, encoding) => {
18
- return new Promise((resolve, reject) => {
19
- const reader = new FileReader();
20
- reader.readAsText(file, encoding);
21
- reader.onload = () => {
22
- resolve(reader.result.toString());
23
- };
24
- reader.onerror = (error) => {
25
- reject(error);
26
- };
27
- });
28
- };
29
- exports.getTextFromFile = getTextFromFile;
package/file.d.cts DELETED
@@ -1,3 +0,0 @@
1
- export declare const getBase64FromFile: (file: File) => Promise<string>;
2
- export declare const getTextFromFile: (file: File, encoding?: string) => Promise<string>;
3
- //# sourceMappingURL=file.d.ts.map
package/file.d.cts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../src/file.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,GAAI,MAAM,IAAI,oBAW3C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,oBAW5D,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants.cjs"), exports);
18
- __exportStar(require("./number.cjs"), exports);
19
- __exportStar(require("./percent.cjs"), exports);
20
- __exportStar(require("./skip-spaces.cjs"), exports);
@@ -1,5 +0,0 @@
1
- export * from "./constants.cjs";
2
- export * from "./number.cjs";
3
- export * from "./percent.cjs";
4
- export * from "./skip-spaces.cjs";
5
- //# sourceMappingURL=_exports.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_exports.d.ts","sourceRoot":"","sources":["../../src/format/_exports.ts"],"names":[],"mappings":"AAAA,gCAA+B;AAC/B,6BAA4B;AAC5B,8BAA6B;AAC7B,kCAAiC"}
@@ -1,4 +0,0 @@
1
- export * from "./constants.js";
2
- export * from "./number.js";
3
- export * from "./percent.js";
4
- export * from "./skip-spaces.js";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INFINITY = exports.HYPHEN = exports.NO_VALUE = void 0;
4
- exports.NO_VALUE = '–'; // en-dash
5
- exports.HYPHEN = '-';
6
- exports.INFINITY = '∞';
@@ -1,4 +0,0 @@
1
- export declare const NO_VALUE = "\u2013";
2
- export declare const HYPHEN = "-";
3
- export declare const INFINITY = "\u221E";
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/format/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,WAAM,CAAC;AAE5B,eAAO,MAAM,MAAM,MAAM,CAAC;AAE1B,eAAO,MAAM,QAAQ,WAAM,CAAC"}
@@ -1,3 +0,0 @@
1
- export const NO_VALUE = '–'; // en-dash
2
- export const HYPHEN = '-';
3
- export const INFINITY = '∞';