@oscarpalmer/atoms 0.77.0 → 0.77.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/js/array/chunk.cjs +1 -1
  2. package/dist/js/array/chunk.js +1 -1
  3. package/dist/js/value/equal.cjs +4 -1
  4. package/dist/js/value/equal.js +4 -1
  5. package/package.json +1 -1
  6. package/src/js/array/chunk.ts +1 -1
  7. package/src/js/array/count.ts +6 -6
  8. package/src/js/array/exists.ts +6 -6
  9. package/src/js/array/filter.ts +6 -6
  10. package/src/js/array/find.ts +6 -6
  11. package/src/js/array/group-by.ts +67 -55
  12. package/src/js/array/index-of.ts +6 -6
  13. package/src/js/array/sort.ts +20 -0
  14. package/src/js/array/to-map.ts +55 -47
  15. package/src/js/array/to-record.ts +61 -57
  16. package/src/js/array/unique.ts +6 -6
  17. package/src/js/internal/value/handle.ts +5 -5
  18. package/src/js/value/clone.ts +3 -1
  19. package/src/js/value/equal.ts +4 -1
  20. package/src/js/value/get.ts +9 -9
  21. package/src/js/value/set.ts +10 -11
  22. package/types/array/count.d.cts +34 -2
  23. package/types/array/count.d.ts +3 -3
  24. package/types/array/exists.d.cts +34 -2
  25. package/types/array/exists.d.ts +3 -3
  26. package/types/array/filter.d.cts +34 -2
  27. package/types/array/filter.d.ts +3 -3
  28. package/types/array/find.d.cts +34 -2
  29. package/types/array/find.d.ts +3 -3
  30. package/types/array/group-by.d.cts +44 -12
  31. package/types/array/group-by.d.ts +14 -14
  32. package/types/array/index-of.d.cts +34 -2
  33. package/types/array/index-of.d.ts +3 -3
  34. package/types/array/index.d.cts +88 -46
  35. package/types/array/sort.d.cts +42 -0
  36. package/types/array/sort.d.ts +11 -1
  37. package/types/array/to-map.d.cts +42 -10
  38. package/types/array/to-map.d.ts +13 -13
  39. package/types/array/to-record.d.cts +44 -12
  40. package/types/array/to-record.d.ts +13 -13
  41. package/types/array/unique.d.cts +34 -2
  42. package/types/array/unique.d.ts +3 -3
  43. package/types/index.d.cts +1034 -317
  44. package/types/internal/value/handle.d.cts +27 -2
  45. package/types/internal/value/handle.d.ts +2 -2
  46. package/types/models.d.cts +467 -210
  47. package/types/value/clone.d.cts +1 -1
  48. package/types/value/clone.d.ts +1 -1
  49. package/types/value/get.d.cts +470 -211
  50. package/types/value/get.d.ts +3 -3
  51. package/types/value/index.d.cts +515 -224
  52. package/types/value/set.d.cts +357 -170
  53. package/types/value/set.d.ts +3 -3
  54. package/types/value/smush.d.cts +463 -209
@@ -31,7 +31,32 @@ isObject('hello');
31
31
  @category Object
32
32
  */
33
33
  export type UnknownRecord = Record<PropertyKey, unknown>;
34
- export type PlainObject = UnknownRecord;
35
- export declare function handleValue(data: PlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;
34
+ /**
35
+ Represents an array with `unknown` value.
36
+
37
+ Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
38
+
39
+ @example
40
+ ```
41
+ import type {UnknownArray} from 'type-fest';
42
+
43
+ type IsArray<T> = T extends UnknownArray ? true : false;
44
+
45
+ type A = IsArray<['foo']>;
46
+ //=> true
47
+
48
+ type B = IsArray<readonly number[]>;
49
+ //=> true
50
+
51
+ type C = IsArray<string>;
52
+ //=> false
53
+ ```
54
+
55
+ @category Type
56
+ @category Array
57
+ */
58
+ export type UnknownArray = readonly unknown[];
59
+ export type ArrayOrPlainObject = UnknownArray | UnknownRecord;
60
+ export declare function handleValue(data: ArrayOrPlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;
36
61
 
37
62
  export {};
@@ -1,2 +1,2 @@
1
- import type { PlainObject } from '~/models';
2
- export declare function handleValue(data: PlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;
1
+ import type { ArrayOrPlainObject } from '~/models';
2
+ export declare function handleValue(data: ArrayOrPlainObject, path: string, value: unknown, get: boolean, ignoreCase: boolean): unknown;