open-agreements
Version:
Open-source legal template filling CLI and library
13 lines • 403 B
JavaScript
/**
* Convert an array of items into a Record keyed by a specified ID field.
* Used to transform test fixtures from array format to Record format
* for the array-to-record schema migration.
*/
export function arrayToRecord(items, idField) {
const result = {};
for (const item of items) {
result[item[idField]] = item;
}
return result;
}
//# sourceMappingURL=test-utils.js.map