@oscarpalmer/atoms 0.204.0 → 0.205.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 (69) hide show
  1. package/dist/array/filter.d.mts +1 -1
  2. package/dist/array/find.d.mts +3 -3
  3. package/dist/array/first.d.mts +3 -4
  4. package/dist/array/first.mjs +1 -1
  5. package/dist/array/group-by.d.mts +3 -3
  6. package/dist/array/index.d.mts +2 -5
  7. package/dist/array/index.mjs +2 -5
  8. package/dist/array/last.d.mts +3 -4
  9. package/dist/array/last.mjs +1 -1
  10. package/dist/array/move.d.mts +4 -4
  11. package/dist/array/push.d.mts +2 -1
  12. package/dist/array/push.mjs +1 -1
  13. package/dist/array/select.d.mts +95 -84
  14. package/dist/array/select.mjs +6 -6
  15. package/dist/array/sort.d.mts +6 -6
  16. package/dist/array/swap.d.mts +3 -3
  17. package/dist/array/swap.mjs +1 -1
  18. package/dist/array/to-map.d.mts +3 -3
  19. package/dist/array/to-record.d.mts +3 -3
  20. package/dist/beacon.mjs +2 -2
  21. package/dist/color/constants.d.mts +14 -41
  22. package/dist/color/instance.d.mts +0 -1
  23. package/dist/color/misc/state.d.mts +2 -29
  24. package/dist/color/models.d.mts +18 -4
  25. package/dist/function/limit.d.mts +4 -4
  26. package/dist/function/once.d.mts +6 -8
  27. package/dist/function/retry.d.mts +2 -2
  28. package/dist/index.d.mts +1011 -1020
  29. package/dist/index.mjs +113 -102
  30. package/dist/internal/array/compact.d.mts +1 -1
  31. package/dist/internal/array/find.d.mts +4 -4
  32. package/dist/internal/array/index-of.d.mts +3 -3
  33. package/dist/internal/array/insert.d.mts +1 -1
  34. package/dist/internal/array/match.d.mts +1 -1
  35. package/dist/internal/array/sets.d.mts +1 -1
  36. package/dist/internal/function/assert.d.mts +7 -7
  37. package/dist/internal/function/limit.d.mts +1 -1
  38. package/dist/internal/function/work.d.mts +4 -4
  39. package/dist/internal/herald.d.mts +1 -1
  40. package/dist/internal/math/aggregate.d.mts +2 -2
  41. package/dist/internal/result/misc.d.mts +6 -6
  42. package/dist/internal/sized/map.d.mts +2 -2
  43. package/dist/internal/value/compare.d.mts +7 -19
  44. package/dist/internal/value/equal.d.mts +8 -31
  45. package/dist/internal/value/handlers.d.mts +2 -5
  46. package/dist/internal/value/has.d.mts +3 -3
  47. package/dist/is.d.mts +6 -6
  48. package/dist/is.mjs +2 -2
  49. package/dist/promise/helpers.d.mts +2 -2
  50. package/dist/promise/index.d.mts +7 -7
  51. package/dist/promise/models.d.mts +1 -1
  52. package/dist/promise/timed.d.mts +1 -1
  53. package/dist/queue.d.mts +1 -1
  54. package/dist/result/index.d.mts +1 -1
  55. package/dist/result/index.mjs +3 -1
  56. package/dist/result/match.d.mts +3 -3
  57. package/dist/result/work/flow.d.mts +1 -1
  58. package/dist/result/work/pipe.d.mts +1 -1
  59. package/dist/sized/set.d.mts +1 -1
  60. package/dist/string/fuzzy.d.mts +4 -4
  61. package/dist/string/normalize.d.mts +1 -1
  62. package/dist/string/template.d.mts +1 -2
  63. package/dist/value/clone.d.mts +8 -20
  64. package/dist/value/diff.d.mts +1 -1
  65. package/dist/value/freeze.d.mts +4 -4
  66. package/dist/value/merge.d.mts +5 -5
  67. package/dist/value/transform.d.mts +1 -1
  68. package/package.json +25 -10
  69. package/plugin/index.js +1 -1
@@ -38,9 +38,6 @@ export declare function hasValue<Data extends PlainObject, Path extends NestedKe
38
38
  * ```
39
39
  */
40
40
  export declare function hasValue<Data extends PlainObject>(data: Data, path: string, ignoreCase?: boolean): boolean;
41
- export declare namespace hasValue {
42
- var get: typeof hasValueResult;
43
- }
44
41
  /**
45
42
  * Check if a property is defined in an object, and get its value if it is
46
43
  *
@@ -83,4 +80,7 @@ export declare function hasValueResult<Data extends PlainObject, Path extends Ne
83
80
  * ```
84
81
  */
85
82
  export declare function hasValueResult<Data extends PlainObject>(data: Data, path: string, ignoreCase?: boolean): Result<unknown, string>;
83
+ export declare namespace hasValue {
84
+ export var get: typeof hasValueResult;
85
+ }
86
86
  //#endregion
package/dist/is.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTypedArray } from "./internal/is.mjs";
1
+ import { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTemplateStringsArray, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTemplateStringsArray, isTypedArray } from "./internal/is.mjs";
2
2
  //#region src/is.d.ts
3
3
  /**
4
4
  * Is the value empty, or only containing `null` or `undefined` values?
@@ -27,14 +27,14 @@ export declare function isNonNullable<Value>(value: Value): value is Exclude<Val
27
27
  * @param value Value to check
28
28
  * @returns `true` if the value is not `undefined`, `null`, or matches an empty string, otherwise `false`
29
29
  */
30
- export declare function isNonNullableOrEmpty<Value>(value: Value): value is Exclude<Value, undefined | null | ''>;
30
+ export declare function isNonNullableOrEmpty<Value>(value: Value): value is Exclude<Value, undefined | null | "">;
31
31
  /**
32
32
  * Is the value not `undefined`, `null`, or stringified as a whitespace-only string?
33
33
  *
34
34
  * @param value Value to check
35
35
  * @returns `true` if the value is not `undefined`, `null`, or matches a whitespace-only string, otherwise `false`
36
36
  */
37
- export declare function isNonNullableOrWhitespace<Value>(value: Value): value is Exclude<Value, undefined | null | ''>;
37
+ export declare function isNonNullableOrWhitespace<Value>(value: Value): value is Exclude<Value, undefined | null | "">;
38
38
  /**
39
39
  * Is the value not a number or a number-like string?
40
40
  *
@@ -62,14 +62,14 @@ export declare function isNullable(value: unknown): value is undefined | null;
62
62
  * @param value Value to check
63
63
  * @returns `true` if the value is nullable or matches an empty string, otherwise `false`
64
64
  */
65
- export declare function isNullableOrEmpty(value: unknown): value is undefined | null | '';
65
+ export declare function isNullableOrEmpty(value: unknown): value is undefined | null | "";
66
66
  /**
67
67
  * Is the value `undefined`, `null`, or stringified as a whitespace-only string?
68
68
  *
69
69
  * @param value Value to check
70
70
  * @returns `true` if the value is nullable or matches a whitespace-only string, otherwise `false`
71
71
  */
72
- export declare function isNullableOrWhitespace(value: unknown): value is undefined | null | '';
72
+ export declare function isNullableOrWhitespace(value: unknown): value is undefined | null | "";
73
73
  /**
74
74
  * Is the value a number or a number-like string?
75
75
  *
@@ -85,4 +85,4 @@ export declare function isNumerical(value: unknown): value is number | `${number
85
85
  */
86
86
  export declare function isObject(value: unknown): value is object;
87
87
  //#endregion
88
- export { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTypedArray };
88
+ export { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTemplateStringsArray, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTemplateStringsArray, isTypedArray };
package/dist/is.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTypedArray } from "./internal/is.mjs";
1
+ import { isArrayOrPlainObject, isConstructor, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonInstanceOf, isNonKey, isNonNumber, isNonPlainObject, isNonPrimitive, isNonTemplateStringsArray, isNonTypedArray, isNumber, isPlainObject, isPrimitive, isTemplateStringsArray, isTypedArray } from "./internal/is.mjs";
2
2
  import { getArray } from "./internal/array/get.mjs";
3
3
  import { getString } from "./internal/string/misc.mjs";
4
4
  //#region src/is.ts
@@ -120,4 +120,4 @@ function isObject(value) {
120
120
  }
121
121
  const EXPRESSION_WHITESPACE = /^\s*$/;
122
122
  //#endregion
123
- export { isArrayOrPlainObject, isConstructor, isEmpty, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isPlainObject, isPrimitive, isTypedArray };
123
+ export { isArrayOrPlainObject, isConstructor, isEmpty, isInstanceOf, isKey, isNonArrayOrPlainObject, isNonConstructor, isNonEmpty, isNonInstanceOf, isNonKey, isNonNullable, isNonNullableOrEmpty, isNonNullableOrWhitespace, isNonNumber, isNonNumerical, isNonObject, isNonPlainObject, isNonPrimitive, isNonTemplateStringsArray, isNonTypedArray, isNullable, isNullableOrEmpty, isNullableOrWhitespace, isNumber, isNumerical, isObject, isPlainObject, isPrimitive, isTemplateStringsArray, isTypedArray };
@@ -1,8 +1,8 @@
1
1
  import { RequiredKeys } from "../models.mjs";
2
2
  import { FulfilledPromise, PromiseOptions, PromiseStrategy, PromisesOptions, PromisesValue, RejectedPromise } from "./models.mjs";
3
3
  //#region src/promise/helpers.d.ts
4
- export declare function createPromiseOptions(input: unknown): RequiredKeys<PromiseOptions, 'time'>;
5
- export declare function createPromisesOptions(input: unknown): RequiredKeys<PromisesOptions, 'strategy'>;
4
+ export declare function createPromiseOptions(input: unknown): RequiredKeys<PromiseOptions, "time">;
5
+ export declare function createPromisesOptions(input: unknown): RequiredKeys<PromisesOptions, "strategy">;
6
6
  export declare function getResultsFromPromises(promised: Array<PromisesValue<unknown>> | Record<string, PromisesValue<unknown>>): unknown;
7
7
  export declare function getStrategyOrDefault(value: unknown): PromiseStrategy;
8
8
  /**
@@ -34,7 +34,7 @@ export declare function attemptPromise<Value>(callback: () => Value, options?: P
34
34
  * @param options Options for handling the _Promises_
35
35
  * @returns List of results
36
36
  */
37
- export declare function promises<Items extends unknown[], Options extends PromisesOptions>(items: [...Items], options?: Options): Promise<Options['strategy'] extends 'first' ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
37
+ export declare function promises<Items extends unknown[], Options extends PromisesOptions>(items: [...Items], options?: Options): Promise<Options["strategy"] extends "first" ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
38
38
  /**
39
39
  * Handle keyed _Promises_, returning their results in a similarly keyed object
40
40
  *
@@ -44,7 +44,7 @@ export declare function promises<Items extends unknown[], Options extends Promis
44
44
  * @param options Options for handling the _Promises_
45
45
  * @returns Keyed object of results
46
46
  */
47
- export declare function promises<Items extends PlainObject, Options extends PromisesOptions>(items: Items, options?: Options): Promise<Options['strategy'] extends 'first' ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
47
+ export declare function promises<Items extends PlainObject, Options extends PromisesOptions>(items: Items, options?: Options): Promise<Options["strategy"] extends "first" ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
48
48
  /**
49
49
  * Handle a list of _Promises_, returning their results in an ordered array
50
50
  *
@@ -54,7 +54,7 @@ export declare function promises<Items extends PlainObject, Options extends Prom
54
54
  * @param strategy Strategy for handling the _Promises_
55
55
  * @returns List of results
56
56
  */
57
- export declare function promises<Items extends unknown[], Strategy extends PromiseStrategy>(items: [...Items], strategy: Strategy): Promise<Strategy extends 'first' ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
57
+ export declare function promises<Items extends unknown[], Strategy extends PromiseStrategy>(items: [...Items], strategy: Strategy): Promise<Strategy extends "first" ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
58
58
  /**
59
59
  * Handle keyed _Promises_, returning their results in a similarly keyed object
60
60
  *
@@ -64,7 +64,7 @@ export declare function promises<Items extends unknown[], Strategy extends Promi
64
64
  * @param strategy Strategy for handling the _Promises_
65
65
  * @returns Keyed object of results
66
66
  */
67
- export declare function promises<Items extends PlainObject, Strategy extends PromiseStrategy>(items: Items, strategy: Strategy): Promise<Strategy extends 'first' ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
67
+ export declare function promises<Items extends PlainObject, Strategy extends PromiseStrategy>(items: Items, strategy: Strategy): Promise<Strategy extends "first" ? PromisesUnwrapped<Items> : PromisesValues<PromisesItems<Items>>>;
68
68
  /**
69
69
  * Handle a list of _Promises_, returning their results in an ordered array
70
70
  *
@@ -81,9 +81,6 @@ export declare function promises<Items extends unknown[]>(items: [...Items], sig
81
81
  * @returns Keyed object of results
82
82
  */
83
83
  export declare function promises<Items extends PlainObject>(items: Items, signal?: AbortSignal): Promise<PromisesValues<PromisesItems<Items>>>;
84
- export declare namespace promises {
85
- var result: typeof resultPromises;
86
- }
87
84
  /**
88
85
  * Handle a list of _Promises_, returning their results in an ordered array of results _({@link Result})_
89
86
  *
@@ -106,4 +103,7 @@ export declare function resultPromises<Items extends unknown[]>(items: [...Items
106
103
  * @returns Keyed object of results
107
104
  */
108
105
  export declare function resultPromises<Items extends PlainObject>(items: Items, signal?: AbortSignal): Promise<PromisesResult<PromisesItems<Items>>>;
106
+ export declare namespace promises {
107
+ export var result: typeof resultPromises;
108
+ }
109
109
  //#endregion
@@ -65,7 +65,7 @@ export type PromiseParameters = {
65
65
  * - `complete`: wait for all _Promises_ to settle, then return the results, as an array of fulfilled and/or rejected results
66
66
  * - `first`: rejects on the first rejected _Promise_, and returns an array of values
67
67
  */
68
- export type PromiseStrategy = 'complete' | 'first';
68
+ export type PromiseStrategy = "complete" | "first";
69
69
  /**
70
70
  * An error thrown when a promise times out
71
71
  */
@@ -9,7 +9,7 @@ export declare function getTimedPromise<Value>(promise: Promise<Value>, time: nu
9
9
  * @param options Timed options
10
10
  * @returns Timed _Promise_
11
11
  */
12
- export declare function timed<Value>(promise: Promise<Value>, options: RequiredKeys<PromiseOptions, 'time'>): Promise<Value>;
12
+ export declare function timed<Value>(promise: Promise<Value>, options: RequiredKeys<PromiseOptions, "time">): Promise<Value>;
13
13
  /**
14
14
  * Create a _Promise_ that should be settled within a certain amount of time
15
15
  *
package/dist/queue.d.mts CHANGED
@@ -248,6 +248,6 @@ export declare function queue<Callback extends GenericAsyncCallback>(callback: C
248
248
  */
249
249
  export declare function queue<Callback extends GenericCallback>(callback: Callback, options?: QueueOptions): Queue<Callback, Parameters<Callback>>;
250
250
  export declare namespace queue {
251
- var keyed: typeof keyedQueue;
251
+ export var keyed: typeof keyedQueue;
252
252
  }
253
253
  //#endregion
@@ -54,6 +54,6 @@ export declare function attempt<Value, E>(callback: () => Value, error: E): Exte
54
54
  */
55
55
  export declare function attempt<Value>(callback: () => Value): Result<Value, Error>;
56
56
  export declare namespace attempt {
57
- var async: typeof asyncAttempt;
57
+ export var async: typeof asyncAttempt;
58
58
  }
59
59
  //#endregion
@@ -2,7 +2,9 @@ import { getError, ok } from "../internal/result/misc.mjs";
2
2
  //#region src/result/index.ts
3
3
  async function asyncAttempt(value, err) {
4
4
  try {
5
- let result = typeof value === "function" ? value() : await value;
5
+ let result;
6
+ if (typeof value === "function") result = value();
7
+ else result = value;
6
8
  if (result instanceof Promise) result = await result;
7
9
  return ok(result);
8
10
  } catch (thrown) {
@@ -20,7 +20,7 @@ export declare function asyncMatchResult<Value, Returned, E = Error>(result: Any
20
20
  * @param error Error callback
21
21
  * @returns Matched value-_Promise_
22
22
  */
23
- export declare function asyncMatchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>), ok: ResultMatch<Value, Returned, E>['ok'], error: ResultMatch<Value, Returned, E>['error']): Promise<Returned>;
23
+ export declare function asyncMatchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>), ok: ResultMatch<Value, Returned, E>["ok"], error: ResultMatch<Value, Returned, E>["error"]): Promise<Returned>;
24
24
  /**
25
25
  * Handles a _Result_ with match callbacks
26
26
  *
@@ -37,8 +37,8 @@ export declare function matchResult<Value, Returned, E = Error>(result: AnyResul
37
37
  * @param error Error callback
38
38
  * @returns Matched value
39
39
  */
40
- export declare function matchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | (() => AnyResult<Value, E>), ok: ResultMatch<Value, Returned, E>['ok'], error: ResultMatch<Value, Returned, E>['error']): Returned;
40
+ export declare function matchResult<Value, Returned, E = Error>(result: AnyResult<Value, E> | (() => AnyResult<Value, E>), ok: ResultMatch<Value, Returned, E>["ok"], error: ResultMatch<Value, Returned, E>["error"]): Returned;
41
41
  export declare namespace matchResult {
42
- var async: typeof asyncMatchResult;
42
+ export var async: typeof asyncMatchResult;
43
43
  }
44
44
  //#endregion
@@ -178,6 +178,6 @@ export declare function attemptFlow<First extends GenericCallback>(first: First,
178
178
  */
179
179
  export declare function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
180
180
  export declare namespace attemptFlow {
181
- var async: typeof attemptAsyncFlow;
181
+ export var async: typeof attemptAsyncFlow;
182
182
  }
183
183
  //#endregion
@@ -179,6 +179,6 @@ export declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth
179
179
  */
180
180
  export declare function attemptPipe<Initial>(initial: GenericCallback | Initial | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): WrapValue<Initial>;
181
181
  export declare namespace attemptPipe {
182
- var async: typeof attemptAsyncPipe;
182
+ export var async: typeof attemptAsyncPipe;
183
183
  }
184
184
  //#endregion
@@ -36,7 +36,7 @@ export declare class SizedSet<Value = unknown> extends Set<Value> {
36
36
  /**
37
37
  * @inheritdoc
38
38
  */
39
- add(value: Value): this;
39
+ override add(value: Value): this;
40
40
  /**
41
41
  * Get a value from the _SizedSet_, if it exists _(and optionally move it to the end)_
42
42
  *
@@ -109,10 +109,6 @@ export declare function fuzzy<Item>(items: Item[], handler?: (item: Item) => str
109
109
  * @returns Fuzzy searcher
110
110
  */
111
111
  export declare function fuzzy<Item>(items: Item[], configuration?: FuzzyConfiguration<Item>): Fuzzy<Item>;
112
- export declare namespace fuzzy {
113
- var is: typeof isFuzzy;
114
- var match: typeof fuzzyMatch;
115
- }
116
112
  /**
117
113
  * Does the needle match the haystack in a fuzzy way?
118
114
  *
@@ -132,4 +128,8 @@ export declare function fuzzyMatch(haystack: string, needle: string): boolean;
132
128
  * @returns `true` if the value is a fuzzy searcher, otherwise `false`
133
129
  */
134
130
  export declare function isFuzzy<Item = unknown>(value: unknown): value is Fuzzy<Item>;
131
+ export declare namespace fuzzy {
132
+ export var is: typeof isFuzzy;
133
+ export var match: typeof fuzzyMatch;
134
+ }
135
135
  //#endregion
@@ -65,6 +65,6 @@ export declare function initializeNormalizer(options?: NormalizeOptions): Normal
65
65
  */
66
66
  export declare function normalize(value: string, options?: NormalizeOptions): string;
67
67
  export declare namespace normalize {
68
- var initialize: typeof initializeNormalizer;
68
+ export var initialize: typeof initializeNormalizer;
69
69
  }
70
70
  //#endregion
@@ -41,7 +41,6 @@ type Templater = {
41
41
  * Render a template string with variables
42
42
  */
43
43
  type TemplaterRenderer = (variables?: PlainObject) => string;
44
- declare function Templater(this: any, options: Required<TemplateOptions>): void;
45
44
  /**
46
45
  * Create a _Templater_ with predefined options
47
46
  *
@@ -67,6 +66,6 @@ export declare function template(strings: TemplateStringsArray, ...values: unkno
67
66
  */
68
67
  export declare function template(value: string, variables?: PlainObject, options?: Partial<TemplateOptions>): string;
69
68
  export declare namespace template {
70
- var initialize: typeof initializeTemplater;
69
+ export var initialize: typeof initializeTemplater;
71
70
  }
72
71
  //#endregion
@@ -1,4 +1,5 @@
1
- import { Constructor, GenericCallback } from "../models.mjs";
1
+ import { Constructor } from "../models.mjs";
2
+ import { ValueHandler } from "../internal/value/handlers.mjs";
2
3
  //#region src/value/clone.d.ts
3
4
  export type CloneOptions = {
4
5
  /**
@@ -47,25 +48,6 @@ export type Cloner = {
47
48
  * @returns Cloned value
48
49
  */
49
50
  export declare function clone<Value>(value: Value, options?: CloneOptions): Value;
50
- export declare namespace clone {
51
- var deregister: typeof deregisterCloner;
52
- var handlers: {
53
- base: {
54
- handlers: WeakMap<WeakKey, string | GenericCallback>;
55
- options: {
56
- callback: GenericCallback;
57
- method?: string;
58
- };
59
- owner: GenericCallback;
60
- deregister: (constructor: Constructor) => void;
61
- get: (first: unknown, second: unknown) => string | GenericCallback | undefined;
62
- register: (constructor: Constructor, handler?: string | GenericCallback) => void;
63
- };
64
- handle(value: unknown, ...parameters: unknown[]): unknown;
65
- };
66
- var initialize: typeof initializeCloner;
67
- var register: typeof registerCloner;
68
- }
69
51
  /**
70
52
  * Copy any kind of value
71
53
  *
@@ -102,4 +84,10 @@ export declare function initializeCloner(options?: CloneOptions): Cloner;
102
84
  * @param handler Method name or clone function _(defaults to method name `clone`)_
103
85
  */
104
86
  export declare function registerCloner<Instance>(constructor: Constructor<Instance>, handler?: string | ((value: Instance) => Instance)): void;
87
+ export declare namespace clone {
88
+ export var deregister: typeof deregisterCloner;
89
+ export var handlers: ValueHandler;
90
+ export var initialize: typeof initializeCloner;
91
+ export var register: typeof registerCloner;
92
+ }
105
93
  //#endregion
@@ -28,7 +28,7 @@ export type DiffResult<First, Second = First> = {
28
28
  */
29
29
  values: Record<string, DiffValue>;
30
30
  };
31
- type DiffType = 'full' | 'none' | 'partial';
31
+ type DiffType = "full" | "none" | "partial";
32
32
  /**
33
33
  * The difference between two values
34
34
  */
@@ -128,10 +128,6 @@ export declare function freeze<Item>(set: Set<Item>): Frozen<Set<Item>>;
128
128
  * @returns Frozen value
129
129
  */
130
130
  export declare function freeze<Value>(value: Value): Value;
131
- export declare namespace freeze {
132
- var flat: typeof flatFreeze;
133
- var is: typeof isFrozen;
134
- }
135
131
  /**
136
132
  * Is the value frozen?
137
133
  *
@@ -141,4 +137,8 @@ export declare namespace freeze {
141
137
  * @returns `true` if the value is frozen, otherwise `false`
142
138
  */
143
139
  export declare function isFrozen(value: unknown): boolean;
140
+ export declare namespace freeze {
141
+ export var flat: typeof flatFreeze;
142
+ export var is: typeof isFrozen;
143
+ }
144
144
  //#endregion
@@ -3,7 +3,7 @@ import { ArrayOrPlainObject, NestedPartial, PlainObject, UnionToIntersection } f
3
3
  /**
4
4
  * Options for assigning values
5
5
  */
6
- export type AssignOptions = Omit<MergeOptions, 'assignValues'>;
6
+ export type AssignOptions = Omit<MergeOptions, "assignValues">;
7
7
  /**
8
8
  * An assigner function for assigning values from one or more objects to the first one
9
9
  */
@@ -71,9 +71,6 @@ export type Merger = {
71
71
  * @returns Assigned value
72
72
  */
73
73
  export declare function assign<To extends PlainObject, From extends PlainObject[]>(to: To, from: [...From], options?: AssignOptions): To & UnionToIntersection<From[number]>;
74
- export declare namespace assign {
75
- var initialize: typeof initializeAssigner;
76
- }
77
74
  /**
78
75
  * Create an assigner with predefined options
79
76
  *
@@ -100,7 +97,10 @@ export declare function initializeMerger(options?: MergeOptions): Merger;
100
97
  * @returns Merged value
101
98
  */
102
99
  export declare function merge<Values extends ArrayOrPlainObject[]>(values: [...Values], options?: MergeOptions): UnionToIntersection<Values[number]>;
100
+ export declare namespace assign {
101
+ export var initialize: typeof initializeAssigner;
102
+ }
103
103
  export declare namespace merge {
104
- var initialize: typeof initializeMerger;
104
+ export var initialize: typeof initializeMerger;
105
105
  }
106
106
  //#endregion
@@ -55,6 +55,6 @@ export declare function transform<Value extends PlainObject, Key extends keyof V
55
55
  */
56
56
  export declare function transform<Value extends PlainObject>(value: Value, transformers: TransformCallbacks<Value>): Value;
57
57
  export declare namespace transform {
58
- var initialize: typeof initializeTransformer;
58
+ export var initialize: typeof initializeTransformer;
59
59
  }
60
60
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oscarpalmer/atoms",
3
- "version": "0.204.0",
3
+ "version": "0.205.0",
4
4
  "description": "Atomic utilities for making your JavaScript better.",
5
5
  "keywords": [
6
6
  "array",
@@ -46,6 +46,10 @@
46
46
  "types": "./dist/array/filter.d.mts",
47
47
  "default": "./dist/array/filter.mjs"
48
48
  },
49
+ "./array/find": {
50
+ "types": "./dist/array/find.d.mts",
51
+ "default": "./dist/array/find.mjs"
52
+ },
49
53
  "./array/first": {
50
54
  "types": "./dist/array/first.d.mts",
51
55
  "default": "./dist/array/first.mjs"
@@ -54,6 +58,10 @@
54
58
  "types": "./dist/array/group-by.d.mts",
55
59
  "default": "./dist/array/group-by.mjs"
56
60
  },
61
+ "./array/index-of": {
62
+ "types": "./dist/internal/array/index-of.d.mts",
63
+ "default": "./dist/internal/array/index-of.mjs"
64
+ },
57
65
  "./array/last": {
58
66
  "types": "./dist/array/last.d.mts",
59
67
  "default": "./dist/array/last.mjs"
@@ -62,6 +70,10 @@
62
70
  "types": "./dist/array/move.d.mts",
63
71
  "default": "./dist/array/move.mjs"
64
72
  },
73
+ "./array/select": {
74
+ "types": "./dist/array/select.d.mts",
75
+ "default": "./dist/array/select.mjs"
76
+ },
65
77
  "./array/sort": {
66
78
  "types": "./dist/array/sort.d.mts",
67
79
  "default": "./dist/array/sort.mjs"
@@ -278,16 +290,19 @@
278
290
  "watch": "npx vite build --watch"
279
291
  },
280
292
  "devDependencies": {
281
- "@oxlint/plugins": "^1.83",
282
- "@types/node": "^26.5",
283
- "@vitest/coverage-istanbul": "^4.1",
284
- "eslint": "^10.10",
285
- "jsdom": "^30",
293
+ "@types/node": "^26.6",
294
+ "@vitest/coverage-istanbul": "5.0.1",
295
+ "eslint": "^10.11",
296
+ "jsdom": "^30.1",
286
297
  "tsdown": "^0.23",
287
- "typescript": "^6",
288
- "vite": "npm:@voidzero-dev/vite-plus-core@latest",
289
- "vite-plus": "latest",
290
- "vitest": "npm:@voidzero-dev/vite-plus-test@latest"
298
+ "typescript": "^7",
299
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
300
+ "vite-plus": "1.0.0",
301
+ "vitest": "5.0.1"
302
+ },
303
+ "overrides": {
304
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.0.0",
305
+ "vitest": "5.0.1"
291
306
  },
292
307
  "packageManager": "npm@11.11.1"
293
308
  }
package/plugin/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import {eslintCompatPlugin} from '@oxlint/plugins';
1
+ import {eslintCompatPlugin} from 'vite-plus/lint/plugins';
2
2
  import {groupBy} from '../dist/array/group-by.mjs';
3
3
  import pkg from '../package.json' with {type: 'json'};
4
4
  import getStringPlugin from './get-string.js';