feat: entriesWithType
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
type Entries<T> = {
|
||||
[K in keyof T]: [K, T[K]];
|
||||
}[keyof T][];
|
||||
import type { Entries } from "../types.js";
|
||||
|
||||
export function entriesWithType<T extends object>(value: T): Entries<T>{
|
||||
return Object.entries(value) as unknown as Entries<T>;
|
||||
|
||||
@@ -2,4 +2,5 @@ export * from "./combineObject.js";
|
||||
export * from "./combineArray.js";
|
||||
export * from "./convertBytesLikeToUint8Array.js";
|
||||
export * from "./convertIDArray.js";
|
||||
export * from "./convertIterableToMap.js"
|
||||
export * from "./convertIterableToMap.js"
|
||||
export * from "./entriesWithType.js";
|
||||
@@ -3,12 +3,12 @@ export type Nullable<T> = T | null | undefined;
|
||||
export declare type ValuesOf<T> = T[keyof T];
|
||||
|
||||
export type IDItem<T> = {
|
||||
id: T;
|
||||
id: T;
|
||||
};
|
||||
|
||||
export type Entries<T> = {
|
||||
[K in keyof T]: [K, T[K]];
|
||||
}[keyof T][];
|
||||
[K in keyof T]: [K, T[K]];
|
||||
}[keyof T][];
|
||||
|
||||
|
||||
export type BufferSource = ArrayBufferView | ArrayBuffer | SharedArrayBuffer;
|
||||
|
||||
Reference in New Issue
Block a user