MCPcopy
hub / github.com/drizzle-team/drizzle-orm / mapEntries

Function mapEntries

drizzle-kit/src/global.ts:37–48  ·  view source on GitHub ↗
(
	obj: Record<string, T>,
	map: (key: string, value: T) => [string, T],
)

Source from the content-addressed store, hash-verified

35};
36
37export const mapEntries = <T>(
38 obj: Record<string, T>,
39 map: (key: string, value: T) => [string, T],
40): Record<string, T> => {
41 const result = Object.fromEntries(
42 Object.entries(obj).map(([key, val]) => {
43 const [newKey, newVal] = map(key, val);
44 return [newKey, newVal];
45 }),
46 );
47 return result;
48};
49
50export const customMapEntries = <TReturn, T = any>(
51 obj: Record<string, T>,

Callers 6

applyPgSnapshotsDiffFunction · 0.90
applyMysqlSnapshotsDiffFunction · 0.90
applySqliteSnapshotsDiffFunction · 0.90
applyLibSQLSnapshotsDiffFunction · 0.90
updateUpToV6Function · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected