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

Function mapKeys

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

Source from the content-addressed store, hash-verified

22};
23
24export const mapKeys = <T>(
25 obj: Record<string, T>,
26 map: (key: string, value: T) => string,
27): Record<string, T> => {
28 const result = Object.fromEntries(
29 Object.entries(obj).map(([key, val]) => {
30 const newKey = map(key, val);
31 return [newKey, val];
32 }),
33 );
34 return result;
35};
36
37export const mapEntries = <T>(
38 obj: Record<string, T>,

Callers 5

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

Calls

no outgoing calls

Tested by

no test coverage detected