@oscarpalmer/atoms 0.221.0 → 0.223.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 (331) hide show
  1. package/dist/array/difference.d.mts +1 -3
  2. package/dist/array/difference.mjs +2 -3
  3. package/dist/array/exists.d.mts +1 -3
  4. package/dist/array/exists.mjs +11 -6
  5. package/dist/array/filter.d.mts +1 -3
  6. package/dist/array/filter.mjs +15 -6
  7. package/dist/array/find.d.mts +1 -3
  8. package/dist/array/find.mjs +9 -5
  9. package/dist/array/first.d.mts +1 -3
  10. package/dist/array/first.mjs +10 -5
  11. package/dist/array/flatten.d.mts +1 -3
  12. package/dist/array/flatten.mjs +1 -2
  13. package/dist/array/from.d.mts +1 -3
  14. package/dist/array/from.mjs +1 -2
  15. package/dist/array/group-by.d.mts +1 -3
  16. package/dist/array/group-by.mjs +1 -2
  17. package/dist/array/index.d.mts +4 -4
  18. package/dist/array/insert.d.mts +1 -3
  19. package/dist/array/insert.mjs +2 -3
  20. package/dist/array/intersection.d.mts +1 -3
  21. package/dist/array/intersection.mjs +2 -3
  22. package/dist/array/last.d.mts +1 -3
  23. package/dist/array/last.mjs +12 -5
  24. package/dist/array/move.d.mts +1 -3
  25. package/dist/array/move.mjs +1 -2
  26. package/dist/array/partition.d.mts +1 -3
  27. package/dist/array/partition.mjs +24 -5
  28. package/dist/array/push.d.mts +0 -2
  29. package/dist/array/push.mjs +2 -3
  30. package/dist/array/reverse.d.mts +1 -3
  31. package/dist/array/reverse.mjs +1 -2
  32. package/dist/array/select.d.mts +0 -2
  33. package/dist/array/select.mjs +40 -9
  34. package/dist/array/single.d.mts +1 -3
  35. package/dist/array/single.mjs +9 -7
  36. package/dist/array/slice.d.mts +1 -3
  37. package/dist/array/slice.mjs +1 -2
  38. package/dist/array/sort.d.mts +0 -2
  39. package/dist/array/sort.mjs +2 -3
  40. package/dist/array/splice.d.mts +1 -3
  41. package/dist/array/splice.mjs +2 -3
  42. package/dist/array/swap.d.mts +0 -2
  43. package/dist/array/swap.mjs +2 -3
  44. package/dist/array/to-map.d.mts +1 -3
  45. package/dist/array/to-map.mjs +1 -2
  46. package/dist/array/to-record.d.mts +1 -3
  47. package/dist/array/to-record.mjs +1 -2
  48. package/dist/array/to-set.d.mts +1 -3
  49. package/dist/array/to-set.mjs +1 -2
  50. package/dist/array/toggle.d.mts +1 -3
  51. package/dist/array/toggle.mjs +1 -2
  52. package/dist/array/union.d.mts +1 -3
  53. package/dist/array/union.mjs +2 -3
  54. package/dist/array/unique.d.mts +1 -3
  55. package/dist/array/unique.mjs +18 -5
  56. package/dist/array/update.d.mts +1 -3
  57. package/dist/array/update.mjs +1 -2
  58. package/dist/beacon.d.mts +3 -13
  59. package/dist/beacon.mjs +10 -21
  60. package/dist/color/constants.d.mts +1 -7
  61. package/dist/color/constants.mjs +3 -11
  62. package/dist/color/index.d.mts +0 -2
  63. package/dist/color/index.mjs +4 -5
  64. package/dist/color/instance.d.mts +1 -3
  65. package/dist/color/instance.mjs +5 -8
  66. package/dist/color/misc/alpha.d.mts +1 -3
  67. package/dist/color/misc/alpha.mjs +1 -2
  68. package/dist/color/misc/format.d.mts +1 -3
  69. package/dist/color/misc/format.mjs +1 -2
  70. package/dist/color/misc/get.d.mts +1 -3
  71. package/dist/color/misc/get.mjs +2 -3
  72. package/dist/color/misc/is.d.mts +1 -11
  73. package/dist/color/misc/is.mjs +4 -16
  74. package/dist/color/misc/state.d.mts +1 -3
  75. package/dist/color/misc/state.mjs +4 -5
  76. package/dist/color/space/hex.d.mts +1 -3
  77. package/dist/color/space/hex.mjs +2 -3
  78. package/dist/color/space/hsl.d.mts +1 -3
  79. package/dist/color/space/hsl.mjs +2 -3
  80. package/dist/color/space/hwb.d.mts +1 -3
  81. package/dist/color/space/hwb.mjs +3 -4
  82. package/dist/color/space/rgb.d.mts +1 -3
  83. package/dist/color/space/rgb.mjs +1 -2
  84. package/dist/function/limit.d.mts +1 -3
  85. package/dist/function/limit.mjs +2 -3
  86. package/dist/function/once.d.mts +1 -3
  87. package/dist/function/once.mjs +8 -9
  88. package/dist/function/retry.d.mts +1 -3
  89. package/dist/function/retry.mjs +11 -12
  90. package/dist/herald.d.mts +2 -2
  91. package/dist/herald.mjs +1 -1
  92. package/dist/index.d.mts +81 -359
  93. package/dist/index.mjs +514 -661
  94. package/dist/internal/aborter.d.mts +1 -3
  95. package/dist/internal/aborter.mjs +1 -2
  96. package/dist/internal/array/callbacks.d.mts +2 -4
  97. package/dist/internal/array/callbacks.mjs +1 -2
  98. package/dist/internal/array/chunk.d.mts +1 -3
  99. package/dist/internal/array/chunk.mjs +1 -2
  100. package/dist/internal/array/compact.d.mts +1 -3
  101. package/dist/internal/array/compact.mjs +1 -2
  102. package/dist/internal/array/find.d.mts +2 -8
  103. package/dist/internal/array/find.mjs +31 -124
  104. package/dist/internal/array/get.d.mts +1 -3
  105. package/dist/internal/array/get.mjs +1 -2
  106. package/dist/internal/array/group.d.mts +1 -3
  107. package/dist/internal/array/group.mjs +1 -2
  108. package/dist/internal/array/index-of.d.mts +1 -3
  109. package/dist/internal/array/index-of.mjs +10 -5
  110. package/dist/internal/array/insert.d.mts +1 -3
  111. package/dist/internal/array/insert.mjs +2 -3
  112. package/dist/internal/array/match.d.mts +2 -4
  113. package/dist/internal/array/match.mjs +2 -3
  114. package/dist/internal/array/overlap.d.mts +1 -3
  115. package/dist/internal/array/overlap.mjs +1 -2
  116. package/dist/internal/array/sets.d.mts +1 -3
  117. package/dist/internal/array/sets.mjs +5 -6
  118. package/dist/internal/array/shuffle.d.mts +1 -3
  119. package/dist/internal/array/shuffle.mjs +1 -2
  120. package/dist/internal/array/update.d.mts +1 -3
  121. package/dist/internal/array/update.mjs +1 -2
  122. package/dist/internal/defaults.d.mts +1 -3
  123. package/dist/internal/defaults.mjs +1 -2
  124. package/dist/internal/function/assert.d.mts +1 -3
  125. package/dist/internal/function/assert.mjs +1 -2
  126. package/dist/internal/function/limit.d.mts +2 -4
  127. package/dist/internal/function/limit.mjs +8 -9
  128. package/dist/internal/function/memoize.d.mts +1 -3
  129. package/dist/internal/function/memoize.mjs +4 -5
  130. package/dist/internal/function/misc.d.mts +1 -2
  131. package/dist/internal/function/misc.mjs +7 -3
  132. package/dist/internal/function/work.d.mts +1 -3
  133. package/dist/internal/function/work.mjs +5 -13
  134. package/dist/internal/herald.d.mts +2 -12
  135. package/dist/internal/herald.mjs +9 -33
  136. package/dist/internal/is.d.mts +1 -3
  137. package/dist/internal/is.mjs +1 -2
  138. package/dist/internal/math/aggregate.d.mts +1 -3
  139. package/dist/internal/math/aggregate.mjs +2 -3
  140. package/dist/internal/math/misc.d.mts +1 -3
  141. package/dist/internal/math/misc.mjs +1 -2
  142. package/dist/internal/number.d.mts +1 -3
  143. package/dist/internal/number.mjs +2 -3
  144. package/dist/internal/plan/index.d.mts +1 -3
  145. package/dist/internal/plan/index.mjs +2 -3
  146. package/dist/internal/plan/plan.generate.d.mts +1 -3
  147. package/dist/internal/plan/plan.generate.mjs +67 -22
  148. package/dist/internal/random.d.mts +1 -3
  149. package/dist/internal/random.mjs +1 -2
  150. package/dist/internal/result/attempt.d.mts +1 -3
  151. package/dist/internal/result/attempt.mjs +1 -2
  152. package/dist/internal/result/misc.d.mts +1 -3
  153. package/dist/internal/result/misc.mjs +1 -2
  154. package/dist/internal/sized/map.d.mts +4 -3
  155. package/dist/internal/sized/map.mjs +4 -2
  156. package/dist/internal/sized/misc.d.mts +1 -3
  157. package/dist/internal/sized/misc.mjs +1 -2
  158. package/dist/internal/string/case.d.mts +1 -3
  159. package/dist/internal/string/case.mjs +3 -4
  160. package/dist/internal/string/misc.d.mts +1 -3
  161. package/dist/internal/string/misc.mjs +1 -2
  162. package/dist/internal/subscription.d.mts +1 -3
  163. package/dist/internal/subscription.mjs +16 -29
  164. package/dist/internal/value/compare.d.mts +1 -3
  165. package/dist/internal/value/compare.mjs +2 -3
  166. package/dist/internal/value/equal.d.mts +1 -3
  167. package/dist/internal/value/equal.mjs +3 -4
  168. package/dist/internal/value/get.d.mts +1 -3
  169. package/dist/internal/value/get.mjs +1 -2
  170. package/dist/internal/value/handlers.d.mts +1 -3
  171. package/dist/internal/value/handlers.mjs +1 -2
  172. package/dist/internal/value/has.d.mts +1 -3
  173. package/dist/internal/value/has.mjs +1 -2
  174. package/dist/internal/value/misc.d.mts +1 -3
  175. package/dist/internal/value/misc.mjs +2 -3
  176. package/dist/internal/value/partial.d.mts +1 -3
  177. package/dist/internal/value/partial.mjs +1 -2
  178. package/dist/internal/value/set.d.mts +1 -3
  179. package/dist/internal/value/set.mjs +2 -3
  180. package/dist/is.d.mts +0 -2
  181. package/dist/is.mjs +2 -3
  182. package/dist/logger.d.mts +0 -2
  183. package/dist/logger.mjs +7 -7
  184. package/dist/math.d.mts +0 -2
  185. package/dist/math.mjs +2 -3
  186. package/dist/models/aborter.model.d.mts +1 -3
  187. package/dist/models/aborter.model.mjs +1 -2
  188. package/dist/models/array/array.match.model.d.mts +1 -3
  189. package/dist/models/array/array.match.model.mjs +1 -2
  190. package/dist/models/array/array.misc.model.d.mts +11 -2
  191. package/dist/models/array/array.misc.model.mjs +3 -3
  192. package/dist/models/array/array.sort.model.d.mts +1 -3
  193. package/dist/models/array/array.sort.model.mjs +1 -2
  194. package/dist/models/beacon.model.d.mts +4 -6
  195. package/dist/models/beacon.model.mjs +3 -10
  196. package/dist/models/color.model.d.mts +2 -4
  197. package/dist/models/function/assert.model.d.mts +1 -3
  198. package/dist/models/function/assert.model.mjs +1 -2
  199. package/dist/models/function/limiter.model.d.mts +2 -4
  200. package/dist/models/function/limiter.model.mjs +2 -4
  201. package/dist/models/function/memoize.model.d.mts +2 -4
  202. package/dist/models/function/memoize.model.mjs +1 -2
  203. package/dist/models/function/once.model.d.mts +0 -3
  204. package/dist/models/function/once.model.mjs +3 -5
  205. package/dist/models/function/retry.model.d.mts +1 -3
  206. package/dist/models/function/retry.model.mjs +1 -2
  207. package/dist/models/function/work.model.d.mts +2 -4
  208. package/dist/models/function/work.model.mjs +1 -2
  209. package/dist/models/herald.model.d.mts +8 -7
  210. package/dist/models/herald.model.mjs +3 -10
  211. package/dist/models/index.d.mts +0 -2
  212. package/dist/models/logger.model.d.mts +1 -4
  213. package/dist/models/logger.model.mjs +3 -5
  214. package/dist/models/math.model.d.mts +1 -3
  215. package/dist/models/math.model.mjs +1 -2
  216. package/dist/models/misc.model.d.mts +1 -3
  217. package/dist/models/misc.model.mjs +1 -2
  218. package/dist/models/plan.model.d.mts +35 -37
  219. package/dist/models/plan.model.mjs +1 -2
  220. package/dist/models/promise.model.d.mts +8 -10
  221. package/dist/models/promise.model.mjs +4 -5
  222. package/dist/models/query.model.d.mts +1 -3
  223. package/dist/models/query.model.mjs +1 -2
  224. package/dist/models/queue.model.d.mts +0 -3
  225. package/dist/models/queue.model.mjs +3 -5
  226. package/dist/models/random.model.d.mts +1 -3
  227. package/dist/models/random.model.mjs +1 -2
  228. package/dist/models/result.model.d.mts +0 -2
  229. package/dist/models/string/string.case.model.d.mts +1 -3
  230. package/dist/models/string/string.case.model.mjs +1 -2
  231. package/dist/models/string/string.fuzzy.model.d.mts +0 -3
  232. package/dist/models/string/string.fuzzy.model.mjs +3 -5
  233. package/dist/models/string/string.misc.model.d.mts +1 -3
  234. package/dist/models/string/string.misc.model.mjs +1 -2
  235. package/dist/models/string/string.normalize.model.d.mts +1 -3
  236. package/dist/models/string/string.normalize.model.mjs +1 -2
  237. package/dist/models/string/string.template.model.d.mts +1 -3
  238. package/dist/models/string/string.template.model.mjs +1 -2
  239. package/dist/models/subscription.model.d.mts +4 -23
  240. package/dist/models/subscription.model.mjs +3 -5
  241. package/dist/models/value/value.clone.model.d.mts +1 -3
  242. package/dist/models/value/value.clone.model.mjs +1 -2
  243. package/dist/models/value/value.diff.model.d.mts +1 -3
  244. package/dist/models/value/value.diff.model.mjs +1 -2
  245. package/dist/models/value/value.equal.model.d.mts +0 -2
  246. package/dist/models/value/value.equal.model.mjs +1 -2
  247. package/dist/models/value/value.handler.model.d.mts +1 -3
  248. package/dist/models/value/value.merge.model.d.mts +0 -2
  249. package/dist/models/value/value.merge.model.mjs +1 -2
  250. package/dist/models/value/value.misc.model.d.mts +0 -2
  251. package/dist/models/value/value.misc.model.mjs +1 -2
  252. package/dist/models/value/value.transform.model.d.mts +1 -3
  253. package/dist/models/value/value.transform.model.mjs +1 -2
  254. package/dist/plan/index.d.mts +1 -3
  255. package/dist/plan/index.mjs +2 -3
  256. package/dist/plan/is.d.mts +1 -3
  257. package/dist/plan/is.mjs +1 -2
  258. package/dist/plan/misc.d.mts +1 -3
  259. package/dist/plan/misc.mjs +2 -3
  260. package/dist/plan/models.d.mts +2 -2
  261. package/dist/plan/result.d.mts +8 -10
  262. package/dist/plan/result.mjs +2 -3
  263. package/dist/plan/run.d.mts +8 -10
  264. package/dist/plan/run.mjs +2 -3
  265. package/dist/plan/use.d.mts +1 -3
  266. package/dist/plan/use.mjs +14 -9
  267. package/dist/promise/delay.d.mts +1 -3
  268. package/dist/promise/delay.mjs +2 -3
  269. package/dist/promise/helpers.d.mts +1 -3
  270. package/dist/promise/helpers.mjs +2 -3
  271. package/dist/promise/index.d.mts +0 -2
  272. package/dist/promise/index.mjs +5 -6
  273. package/dist/promise/misc.d.mts +1 -3
  274. package/dist/promise/misc.mjs +2 -3
  275. package/dist/promise/models.d.mts +2 -2
  276. package/dist/promise/models.mjs +1 -1
  277. package/dist/promise/timed.d.mts +1 -3
  278. package/dist/promise/timed.mjs +4 -5
  279. package/dist/query.d.mts +1 -3
  280. package/dist/query.mjs +2 -3
  281. package/dist/queue.d.mts +0 -2
  282. package/dist/queue.mjs +11 -12
  283. package/dist/random.d.mts +0 -2
  284. package/dist/random.mjs +2 -3
  285. package/dist/result/match.d.mts +1 -3
  286. package/dist/result/match.mjs +1 -2
  287. package/dist/result/misc.d.mts +0 -2
  288. package/dist/result/misc.mjs +1 -2
  289. package/dist/result/work/flow.d.mts +1 -3
  290. package/dist/result/work/flow.mjs +5 -12
  291. package/dist/result/work/pipe.d.mts +0 -2
  292. package/dist/result/work/pipe.mjs +2 -3
  293. package/dist/sized/set.d.mts +4 -3
  294. package/dist/sized/set.mjs +4 -2
  295. package/dist/string/fuzzy.d.mts +0 -2
  296. package/dist/string/fuzzy.mjs +5 -7
  297. package/dist/string/index.d.mts +0 -2
  298. package/dist/string/index.mjs +2 -3
  299. package/dist/string/match.d.mts +1 -3
  300. package/dist/string/match.mjs +2 -3
  301. package/dist/string/normalize.d.mts +0 -2
  302. package/dist/string/normalize.mjs +3 -4
  303. package/dist/string/template.d.mts +0 -2
  304. package/dist/string/template.mjs +1 -2
  305. package/dist/subscription.d.mts +2 -2
  306. package/dist/value/clone.d.mts +1 -3
  307. package/dist/value/clone.mjs +2 -3
  308. package/dist/value/collection.d.mts +1 -3
  309. package/dist/value/collection.mjs +1 -2
  310. package/dist/value/diff.d.mts +0 -2
  311. package/dist/value/diff.mjs +1 -2
  312. package/dist/value/freeze.d.mts +1 -3
  313. package/dist/value/freeze.mjs +1 -2
  314. package/dist/value/handle.mjs +1 -1
  315. package/dist/value/merge.d.mts +0 -2
  316. package/dist/value/merge.mjs +1 -2
  317. package/dist/value/omit.d.mts +1 -3
  318. package/dist/value/omit.mjs +1 -2
  319. package/dist/value/pick.d.mts +1 -3
  320. package/dist/value/pick.mjs +1 -2
  321. package/dist/value/shake.d.mts +0 -2
  322. package/dist/value/shake.mjs +1 -2
  323. package/dist/value/smush.d.mts +0 -2
  324. package/dist/value/smush.mjs +2 -3
  325. package/dist/value/transform.d.mts +0 -2
  326. package/dist/value/transform.mjs +1 -2
  327. package/dist/value/unsmush.d.mts +0 -2
  328. package/dist/value/unsmush.mjs +1 -2
  329. package/package.json +6 -6
  330. package/dist/models/array/array.find.model.d.mts +0 -48
  331. package/dist/models/array/array.find.model.mjs +0 -8
@@ -1,8 +1,6 @@
1
- import "../../models/subscription.model.mjs";
2
- import { isSubscription } from "../../internal/subscription.mjs";
3
1
  import { between } from "../../internal/number.mjs";
4
- import { COLOR_ALPHA, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX } from "../constants.mjs";
5
- //#region src/color/misc/is.ts
2
+ import { COLOR_ALPHA, COLOR_EXPRESSION, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL } from "../constants.mjs";
3
+ // src/color/misc/is.ts
6
4
  function hasKeys(value, keys) {
7
5
  return typeof value === "object" && value !== null && keys.every((key) => key in value);
8
6
  }
@@ -19,16 +17,7 @@ function isBytey(value) {
19
17
  * @returns `true` if the value is a _Color_, otherwise `false`
20
18
  */
21
19
  function isColor(value) {
22
- return typeof value === "object" && value !== null && "$color" in value && value["$color"] === "color";
23
- }
24
- /**
25
- * Is the value a color subscription?
26
- *
27
- * @param value Value to check
28
- * @returns `true` if the value is a color subscription, otherwise `false`
29
- */
30
- function isColorSubscription(value) {
31
- return isSubscription(value) && "$color" in value && value["$color"] === "subscription";
20
+ return typeof value === "object" && value !== null && COLOR_SYMBOL in value;
32
21
  }
33
22
  function isColorValue(value, properties) {
34
23
  if (typeof value !== "object" || value === null) return false;
@@ -156,5 +145,4 @@ const validators = {
156
145
  red: isBytey,
157
146
  whiteness: isPercentage
158
147
  };
159
- //#endregion
160
- export { isColor, isColorSubscription, isHexColor, isHslColor, isHslLike, isHslaColor, isHslaLike, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isRgbColor, isRgbLike, isRgbaColor, isRgbaLike };
148
+ export { isColor, isHexColor, isHslColor, isHslLike, isHslaColor, isHslaLike, isHwbColor, isHwbLike, isHwbaColor, isHwbaLike, isRgbColor, isRgbLike, isRgbaColor, isRgbaLike };
@@ -1,7 +1,5 @@
1
1
  import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
2
- //#region src/color/misc/state.d.ts
3
2
  export declare function getColorFromState<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
4
3
  export declare function getColorState(value: unknown): ColorState;
5
4
  export declare function getStateValue(instance: InternalColor, type: ColorType, alpha: boolean): string | HSLAColor | HSLColor | HWBAColor | HWBColor | RGBAColor | RGBColor;
6
- export declare function setStateValue<Type extends ColorType>(instance: InternalColor, type: Type, value: ColorState[Type], alpha?: number | string): void;
7
- //#endregion
5
+ export declare function setStateValue<Type extends ColorType>(instance: InternalColor, type: Type, value: ColorState[Type], alpha?: number | string): void;
@@ -1,11 +1,11 @@
1
1
  import { COLOR_DEFAULTS, COLOR_KEYS, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL, COLOR_TYPE } from "../constants.mjs";
2
- import { getAlpha } from "./alpha.mjs";
3
- import { isColor } from "./is.mjs";
4
- import { getColorFromRgb, getRgbValues } from "../space/rgb.mjs";
5
2
  import { getColorFromHex, getNormalizedHex } from "../space/hex.mjs";
6
3
  import { getColorFromHsl, getHslValues } from "../space/hsl.mjs";
7
4
  import { getColorFromHwb, getHwbValues } from "../space/hwb.mjs";
8
- //#region src/color/misc/state.ts
5
+ import { getColorFromRgb, getRgbValues } from "../space/rgb.mjs";
6
+ import { getAlpha } from "./alpha.mjs";
7
+ import { isColor } from "./is.mjs";
8
+ // src/color/misc/state.ts
9
9
  function getColorFromState(state, type) {
10
10
  const { origin } = state;
11
11
  if (type === origin) return state[origin];
@@ -85,5 +85,4 @@ const getters = {
85
85
  hwb: getColorFromHwb,
86
86
  rgb: getColorFromRgb
87
87
  };
88
- //#endregion
89
88
  export { getColorFromState, getColorState, getStateValue, setStateValue };
@@ -1,5 +1,4 @@
1
1
  import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
2
- //#region src/color/space/hex.d.ts
3
2
  export declare function getColorFromHex<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
4
3
  export declare function getHexColor(this: InternalColor): string;
5
4
  export declare function getHexaColor(this: InternalColor): string;
@@ -76,5 +75,4 @@ export declare function hexToRgb(value: string): RGBColor;
76
75
  */
77
76
  export declare function hexToRgba(value: string): RGBAColor;
78
77
  export declare function setHexValue(this: InternalColor, value: string): void;
79
- export declare function setHexaValue(this: InternalColor, value: string): void;
80
- //#endregion
78
+ export declare function setHexaValue(this: InternalColor, value: string): void;
@@ -2,9 +2,9 @@ import { join } from "../../internal/string/misc.mjs";
2
2
  import { COLOR_ALPHA, COLOR_DEFAULTS, COLOR_EXPRESSION, COLOR_LENGTHS, COLOR_MAX, COLOR_SYMBOL, COLOR_TYPE } from "../constants.mjs";
3
3
  import { getHexValue, getPercentage } from "../misc/get.mjs";
4
4
  import { isHexColor } from "../misc/is.mjs";
5
- import { convertRgbToHsla, convertRgbToHwba } from "./rgb.mjs";
6
5
  import { getStateValue, setStateValue } from "../misc/state.mjs";
7
- //#region src/color/space/hex.ts
6
+ import { convertRgbToHsla, convertRgbToHwba } from "./rgb.mjs";
7
+ // src/color/space/hex.ts
8
8
  function convertHexToRgba(value) {
9
9
  const normalized = getNormalizedHex(value, true);
10
10
  const pairs = COLOR_EXPRESSION.hexLong.exec(normalized);
@@ -157,5 +157,4 @@ function setHexValueInState(instance, value, alpha) {
157
157
  function setHexaValue(value) {
158
158
  setHexValueInState(this, value, true);
159
159
  }
160
- //#endregion
161
160
  export { getColorFromHex, getHexColor, getHexaColor, getNormalizedHex, hexToHsl, hexToHsla, hexToHwb, hexToHwba, hexToRgb, hexToRgba, setHexValue, setHexaValue };
@@ -1,5 +1,4 @@
1
1
  import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
2
- //#region src/color/space/hsl.d.ts
3
2
  export declare function getColorFromHsl<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
4
3
  export declare function getHslValue(this: InternalColor): HSLColor;
5
4
  export declare function getHslaValue(this: InternalColor): HSLAColor;
@@ -55,5 +54,4 @@ export declare function hslToRgb(hsl: HSLAColor | HSLColor): RGBColor;
55
54
  */
56
55
  export declare function hslToRgba(hsl: HSLAColor | HSLColor): RGBAColor;
57
56
  export declare function setHslValue(this: InternalColor, value: unknown): void;
58
- export declare function setHslaValue(this: InternalColor, value: unknown): void;
59
- //#endregion
57
+ export declare function setHslaValue(this: InternalColor, value: unknown): void;
@@ -3,9 +3,9 @@ import { COLOR_DEFAULTS, COLOR_MAX, COLOR_TYPE } from "../constants.mjs";
3
3
  import { getAlphaValue } from "../misc/alpha.mjs";
4
4
  import { getDegrees, getHexValue, getPercentage } from "../misc/get.mjs";
5
5
  import { isHslLike } from "../misc/is.mjs";
6
- import { convertRgbToHex } from "./rgb.mjs";
7
6
  import { getStateValue, setStateValue } from "../misc/state.mjs";
8
- //#region src/color/space/hsl.ts
7
+ import { convertRgbToHex } from "./rgb.mjs";
8
+ // src/color/space/hsl.ts
9
9
  function convertHslToHwba(input) {
10
10
  let { hue, lightness, saturation } = isHslLike(input) ? getHslValues(input) : { ...COLOR_DEFAULTS.hsl };
11
11
  lightness /= COLOR_MAX.percent;
@@ -150,5 +150,4 @@ function setHSLValueInState(instance, value, alpha) {
150
150
  function setHslaValue(value) {
151
151
  setHSLValueInState(this, value, true);
152
152
  }
153
- //#endregion
154
153
  export { getColorFromHsl, getHslValue, getHslValues, getHslaValue, hslToHex, hslToHwb, hslToHwba, hslToRgb, hslToRgba, setHslValue, setHslaValue };
@@ -1,5 +1,4 @@
1
1
  import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
2
- //#region src/color/space/hwb.d.ts
3
2
  export declare function convertHwbToHsl(input: HWBAColor | HWBColor): HSLAColor;
4
3
  export declare function getColorFromHwb<Type extends ColorType>(state: ColorState, type: Type): NonNullable<ColorState[Type]>;
5
4
  export declare function getHwbValue(this: InternalColor): HWBColor;
@@ -52,5 +51,4 @@ export declare function hwbToRgb(hwb: HWBAColor | HWBColor): RGBColor;
52
51
  */
53
52
  export declare function hwbToRgba(hwb: HWBAColor | HWBColor): RGBAColor;
54
53
  export declare function setHwbValue(this: InternalColor, value: unknown): void;
55
- export declare function setHwbaValue(this: InternalColor, value: unknown): void;
56
- //#endregion
54
+ export declare function setHwbaValue(this: InternalColor, value: unknown): void;
@@ -3,10 +3,10 @@ import { COLOR_DEFAULTS, COLOR_MAX, COLOR_TYPE } from "../constants.mjs";
3
3
  import { getAlphaValue } from "../misc/alpha.mjs";
4
4
  import { getDegrees, getPercentage } from "../misc/get.mjs";
5
5
  import { isHwbLike } from "../misc/is.mjs";
6
- import { rgbToHex } from "./rgb.mjs";
7
- import { hslToRgb, hslToRgba } from "./hsl.mjs";
8
6
  import { getStateValue, setStateValue } from "../misc/state.mjs";
9
- //#region src/color/space/hwb.ts
7
+ import { hslToRgb, hslToRgba } from "./hsl.mjs";
8
+ import { rgbToHex } from "./rgb.mjs";
9
+ // src/color/space/hwb.ts
10
10
  function convertHwbToHsl(input) {
11
11
  let { blackness, hue, whiteness } = isHwbLike(input) ? getHwbValues(input) : COLOR_DEFAULTS.hwb;
12
12
  blackness /= COLOR_MAX.percent;
@@ -129,5 +129,4 @@ function setHwbColorValueInState(instance, value, alpha) {
129
129
  function setHwbaValue(value) {
130
130
  setHwbColorValueInState(this, value, true);
131
131
  }
132
- //#endregion
133
132
  export { convertHwbToHsl, getColorFromHwb, getHwbValue, getHwbValues, getHwbaValue, hwbToHex, hwbToHsl, hwbToHsla, hwbToRgb, hwbToRgba, setHwbValue, setHwbaValue };
@@ -1,5 +1,4 @@
1
1
  import { ColorState, ColorType, HSLAColor, HSLColor, HWBAColor, HWBColor, InternalColor, RGBAColor, RGBColor } from "../../models/color.model.mjs";
2
- //#region src/color/space/rgb.d.ts
3
2
  export declare function convertRgbToHex(rgb: RGBAColor | RGBColor, alpha: boolean): string;
4
3
  export declare function convertRgbToHsla(value: unknown): HSLAColor;
5
4
  export declare function convertRgbToHwba(value: unknown): HWBAColor;
@@ -62,5 +61,4 @@ export declare function rgbToHwb(rgb: RGBAColor | RGBColor): HWBColor;
62
61
  */
63
62
  export declare function rgbToHwba(rgb: RGBAColor | RGBColor): HWBAColor;
64
63
  export declare function setRgbValue(this: InternalColor, value: unknown): void;
65
- export declare function setRgbaValue(this: InternalColor, value: unknown): void;
66
- //#endregion
64
+ export declare function setRgbaValue(this: InternalColor, value: unknown): void;
@@ -5,7 +5,7 @@ import { getAlpha, getAlphaValue } from "../misc/alpha.mjs";
5
5
  import { getHexValue } from "../misc/get.mjs";
6
6
  import { isRgbLike } from "../misc/is.mjs";
7
7
  import { getStateValue, setStateValue } from "../misc/state.mjs";
8
- //#region src/color/space/rgb.ts
8
+ // src/color/space/rgb.ts
9
9
  function convertRgbToHex(rgb, alpha) {
10
10
  const hex = `${join([
11
11
  rgb.red,
@@ -196,5 +196,4 @@ function setRgbColorValueInState(instance, value, alpha) {
196
196
  function setRgbaValue(value) {
197
197
  setRgbColorValueInState(this, value, true);
198
198
  }
199
- //#endregion
200
199
  export { convertRgbToHex, convertRgbToHsla, convertRgbToHwba, getColorFromRgb, getRgbColor, getRgbValues, getRgbaColor, rgbToHex, rgbToHsl, rgbToHsla, rgbToHwb, rgbToHwba, setRgbValue, setRgbaValue };
@@ -1,6 +1,5 @@
1
- import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
2
1
  import { AsyncLimiter, Limiter } from "../models/function/limiter.model.mjs";
3
- //#region src/function/limit.d.ts
2
+ import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
4
3
  /**
5
4
  * Debounce a function, ensuring it is only called after `time` milliseconds have passed
6
5
  *
@@ -51,5 +50,4 @@ export declare namespace debounce {
51
50
  export declare namespace throttle {
52
51
  export var async: typeof asyncThrottle;
53
52
  }
54
- //#endregion
55
53
  export type { AsyncLimiter, Limiter };
@@ -1,6 +1,6 @@
1
- import { LIMITER_DEBOUNCE, LIMITER_THROTTLE } from "../models/function/limiter.model.mjs";
2
1
  import { getAsyncLimiter, getLimiter } from "../internal/function/limit.mjs";
3
- //#region src/function/limit.ts
2
+ import { LIMITER_DEBOUNCE, LIMITER_THROTTLE } from "../models/function/limiter.model.mjs";
3
+ // src/function/limit.ts
4
4
  /**
5
5
  * Debounce a function, ensuring it is only called after `time` milliseconds have passed
6
6
  *
@@ -55,5 +55,4 @@ function throttle(callback, time) {
55
55
  }
56
56
  debounce.async = asyncDebounce;
57
57
  throttle.async = asyncThrottle;
58
- //#endregion
59
58
  export { asyncDebounce, asyncThrottle, debounce, throttle };
@@ -1,6 +1,5 @@
1
- import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
2
1
  import { AsyncOnce, Once } from "../models/function/once.model.mjs";
3
- //#region src/function/once.d.ts
2
+ import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
4
3
  declare function AsyncOnce(this: any, callback: GenericAsyncCallback): void;
5
4
  declare function Once(this: any, callback: GenericCallback): void;
6
5
  /**
@@ -41,5 +40,4 @@ export declare namespace once {
41
40
  export var is: typeof isOnce;
42
41
  export var isAsync: typeof isAsyncOnce;
43
42
  }
44
- //#endregion
45
43
  export type { AsyncOnce, Once };
@@ -1,6 +1,6 @@
1
1
  import { assert } from "../internal/function/assert.mjs";
2
- import { ONCE_MESSAGE_CLEARED, ONCE_MESSAGE_EXPECTATION, ONCE_NAME_ASYNC, ONCE_NAME_SYNC, ONCE_PROPERTY, ONCE_SYMBOL } from "../models/function/once.model.mjs";
3
- //#region src/function/once.ts
2
+ import { ONCE_MESSAGE_CLEARED, ONCE_MESSAGE_EXPECTATION, ONCE_NAME_ASYNC, ONCE_NAME_SYNC, ONCE_SYMBOL } from "../models/function/once.model.mjs";
3
+ // src/function/once.ts
4
4
  function AsyncOnce(callback) {
5
5
  this[ONCE_SYMBOL] = {
6
6
  callback,
@@ -9,10 +9,10 @@ function AsyncOnce(callback) {
9
9
  error: false,
10
10
  finished: false,
11
11
  items: [],
12
+ type: ONCE_NAME_ASYNC,
12
13
  value: void 0
13
14
  };
14
15
  }
15
- AsyncOnce.prototype[ONCE_PROPERTY] = ONCE_NAME_ASYNC;
16
16
  AsyncOnce.prototype.clear = clearOnce;
17
17
  AsyncOnce.prototype.run = runOnceAsync;
18
18
  Object.defineProperties(AsyncOnce.prototype, {
@@ -38,10 +38,10 @@ function Once(callback) {
38
38
  callback,
39
39
  called: false,
40
40
  cleared: false,
41
+ type: ONCE_NAME_SYNC,
41
42
  value: void 0
42
43
  };
43
44
  }
44
- Once.prototype[ONCE_PROPERTY] = ONCE_NAME_SYNC;
45
45
  Once.prototype.clear = clearOnce;
46
46
  Once.prototype.run = runOnce;
47
47
  Object.defineProperties(Once.prototype, {
@@ -104,7 +104,7 @@ function handleOnceResult(state, value, error) {
104
104
  * @returns `true` if the value is an asynchronous once callback, otherwise `false`
105
105
  */
106
106
  function isAsyncOnce(value) {
107
- return isOnceInstance(value, ONCE_NAME_ASYNC);
107
+ return isOnceInstance(ONCE_NAME_ASYNC, value);
108
108
  }
109
109
  /**
110
110
  * Is the value a once callback?
@@ -113,10 +113,10 @@ function isAsyncOnce(value) {
113
113
  * @returns `true` if the value is a once callback, otherwise `false`
114
114
  */
115
115
  function isOnce(value) {
116
- return isOnceInstance(value, ONCE_NAME_SYNC);
116
+ return isOnceInstance(ONCE_NAME_SYNC, value);
117
117
  }
118
- function isOnceInstance(value, name) {
119
- return typeof value === "object" && value !== null && "$once" in value && value["$once"] === name;
118
+ function isOnceInstance(type, value) {
119
+ return typeof value === "object" && value !== null && ONCE_SYMBOL in value && value[ONCE_SYMBOL].type === type;
120
120
  }
121
121
  /**
122
122
  * Create a function that can only be called once, returning the same value on subsequent calls
@@ -163,5 +163,4 @@ asyncOnce.is = isAsyncOnce;
163
163
  once.async = asyncOnce;
164
164
  once.is = isOnce;
165
165
  once.isAsync = isAsyncOnce;
166
- //#endregion
167
166
  export { asyncOnce, isAsyncOnce, isOnce, once };
@@ -1,6 +1,5 @@
1
- import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
2
1
  import { RetryError, RetryOptions } from "../models/function/retry.model.mjs";
3
- //#region src/function/retry.d.ts
2
+ import { GenericAsyncCallback, GenericCallback } from "../models/index.mjs";
4
3
  /**
5
4
  * Retry a callback a specified number of times, with a delay between attempts
6
5
  *
@@ -32,5 +31,4 @@ export declare function retry<Callback extends GenericCallback>(callback: Callba
32
31
  export declare namespace retry {
33
32
  export var async: typeof asyncRetry;
34
33
  }
35
- //#endregion
36
34
  export { RetryError };
@@ -1,10 +1,10 @@
1
+ import { getNumberOrDefault } from "../internal/defaults.mjs";
2
+ import { getLimiter } from "../internal/function/limit.mjs";
1
3
  import { isPlainObject } from "../internal/is.mjs";
2
4
  import { asyncAttempt, attempt } from "../internal/result/attempt.mjs";
3
5
  import { LIMITER_WAIT } from "../models/function/limiter.model.mjs";
4
- import { getNumberOrDefault } from "../internal/defaults.mjs";
5
- import { getLimiter } from "../internal/function/limit.mjs";
6
6
  import { RETRY_MESSAGE_EXPECTATION, RETRY_MESSAGE_FAILED, RetryError } from "../models/function/retry.model.mjs";
7
- //#region src/function/retry.ts
7
+ // src/function/retry.ts
8
8
  /**
9
9
  * Retry a callback a specified number of times, with a delay between attempts
10
10
  *
@@ -17,12 +17,12 @@ import { RETRY_MESSAGE_EXPECTATION, RETRY_MESSAGE_FAILED, RetryError } from "../
17
17
  async function asyncRetry(callback, options) {
18
18
  if (typeof callback !== "function") throw new TypeError(RETRY_MESSAGE_EXPECTATION);
19
19
  async function handle() {
20
- const result = await asyncAttempt(async () => callback());
21
- if (result.ok) {
22
- resolver(result.value);
20
+ const attempted = await asyncAttempt(async () => callback());
21
+ if (attempted.ok) {
22
+ resolver(attempted.value);
23
23
  return;
24
24
  }
25
- if (attempts >= times || !when(result.error)) rejector(new RetryError(RETRY_MESSAGE_FAILED, result.error));
25
+ if (attempts >= times || !when(attempted.error)) rejector(new RetryError(RETRY_MESSAGE_FAILED, attempted.error));
26
26
  else {
27
27
  attempts += 1;
28
28
  limiter.run();
@@ -59,10 +59,10 @@ function retry(callback, options) {
59
59
  const { times, when } = createRetryOptions(options);
60
60
  let last;
61
61
  for (let index = 0; index <= times; index += 1) {
62
- const result = attempt(callback);
63
- if (result.ok) return result.value;
64
- if (index >= times || !when(result.error)) {
65
- last = result.error;
62
+ const attempted = attempt(callback);
63
+ if (attempted.ok) return attempted.value;
64
+ if (index >= times || !when(attempted.error)) {
65
+ last = attempted.error;
66
66
  break;
67
67
  }
68
68
  }
@@ -72,5 +72,4 @@ function shouldRetry() {
72
72
  return true;
73
73
  }
74
74
  retry.async = asyncRetry;
75
- //#endregion
76
75
  export { RetryError, retry };
package/dist/herald.d.mts CHANGED
@@ -1,3 +1,3 @@
1
+ import { herald, isHerald, isHeraldEvents } from "./internal/herald.mjs";
1
2
  import { Herald, HeraldEvents, HeraldOptions } from "./models/herald.model.mjs";
2
- import { herald, isHerald, isHeraldEvents, isHeraldSubscription } from "./internal/herald.mjs";
3
- export { type Herald, type HeraldEvents, type HeraldOptions, herald, isHerald, isHeraldEvents, isHeraldSubscription };
3
+ export { type Herald, type HeraldEvents, type HeraldOptions, herald, isHerald, isHeraldEvents };
package/dist/herald.mjs CHANGED
@@ -1 +1 @@
1
- export { herald, isHerald, isHeraldEvents, isHeraldSubscription } from "./internal/herald.mjs";
1
+ export { herald, isHerald, isHeraldEvents } from "./internal/herald.mjs";