diff --git a/.changeset/short-ducks-pretend.md b/.changeset/short-ducks-pretend.md new file mode 100644 index 00000000..95eda21c --- /dev/null +++ b/.changeset/short-ducks-pretend.md @@ -0,0 +1,5 @@ +--- +"moderndash": minor +--- + +`flatKeys` | Move from hotscript to type-fest utility types diff --git a/package/src/object/flatKeys.ts b/package/src/object/flatKeys.ts index 1c41de6e..b52e2055 100644 --- a/package/src/object/flatKeys.ts +++ b/package/src/object/flatKeys.ts @@ -1,10 +1,10 @@ import type { GenericObject } from "@type/GenericObject"; -import type { Call, Objects } from "hotscript"; +import type { Paths } from "type-fest"; import { isPlainObject } from "@validate/isPlainObject.js"; type StringIfNever = [Type] extends [never] ? string : Type; -type Paths = StringIfNever>; +type PathOrString = StringIfNever>; /** * Flattens an object into a single level object. @@ -19,7 +19,7 @@ type Paths = StringIfNever>; * @returns A new object with flattened keys. */ -export function flatKeys(obj: TObj): Record, unknown> { +export function flatKeys(obj: TObj): Record, unknown> { const flatObject: Record = {}; for (const [key, value] of Object.entries(obj)) {