( data: T[], )
| 218 | * @returns api objects with `id: string` |
| 219 | */ |
| 220 | export 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 | } |
| 226 | export type WithObjectId<T extends { _id: string }> = Omit<T, "_id"> & { |
| 227 | _id: ObjectId; |
| 228 | }; |
no test coverage detected