MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / replaceObjectIds

Function replaceObjectIds

backend/src/utils/misc.ts:220–225  ·  view source on GitHub ↗
(
  data: T[],
)

Source from the content-addressed store, hash-verified

218 * @returns api objects with `id: string`
219 */
220export function replaceObjectIds<T extends { _id: ObjectId }>(
221 data: T[],
222): (T & { _id: string })[] {
223 if (data === undefined) return data;
224 return data.map((it) => replaceObjectId(it));
225}
226export type WithObjectId<T extends { _id: string }> = Omit<T, "_id"> & {
227 _id: ObjectId;
228};

Callers 5

getResultsFunction · 0.90
getTagsFunction · 0.90
getCustomThemesFunction · 0.90
psa.tsFile · 0.90
getQuotesFunction · 0.90

Calls 1

replaceObjectIdFunction · 0.85

Tested by

no test coverage detected