@react-fabric/utilities 1.0.0-beta.60 → 1.0.0-beta.62

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.
package/src/_format.ts CHANGED
@@ -34,7 +34,7 @@ import { isEmpty, isNil } from "./_isType";
34
34
  * Format utility functions for various data types.
35
35
  * This namespace provides methods to format phone numbers, numbers, bytes, percentages, dates, and durations.
36
36
  */
37
-
37
+
38
38
  export namespace Format {
39
39
  const getPhone = (value: string, country: string) => {
40
40
  const phone =
@@ -90,7 +90,7 @@ export namespace Format {
90
90
  /* istanbul ignore next */
91
91
  return `${
92
92
  useCss
93
- ? `<span class="flag ${phone.country}"></span>`
93
+ ? `<span class="icon-[circle-flags--${phone.country}"></span>`
94
94
  : Countries.emoji(phone.country ?? "")
95
95
  } ${phone.formatInternational()}`;
96
96
  };
package/src/_isEqual.ts CHANGED
@@ -22,6 +22,7 @@
22
22
  */
23
23
 
24
24
  import { ascii } from "./_ascii";
25
+ import { getByPath } from "./_getByPath";
25
26
  import { isBoolean, isNil, isNumber, isObject, isString } from "./_isType";
26
27
 
27
28
  /**
@@ -115,8 +116,8 @@ export const matchString = (
115
116
  export const compareValues =
116
117
  (order: "asc" | "desc" = "asc", key?: string) =>
117
118
  (a: unknown, b: unknown) => {
118
- const aValue: string = key && isObject(a) ? a[key] : a;
119
- const bValue: string = key && isObject(b) ? b[key] : b;
119
+ const aValue: any = key && isObject(a) ? getByPath(a, key, "") : a;
120
+ const bValue: any = key && isObject(b) ? getByPath(b, key, "") : b;
120
121
 
121
122
  const bigger = order === "asc" ? 1 : -1;
122
123
  const smaller = order === "desc" ? 1 : -1;