Skip to content

Commit

Permalink
Delete unused mapObjectFromArray
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Dec 5, 2024
1 parent 8c8e72b commit ea33399
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions packages/perseus/src/interactive2/objective_.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,3 @@ export const mapObject = function <K extends string, V, U>(
});
return result;
};

/**
* Maps an array to an object
*
* > mapObjectFromArray(['a', 'b'], function(elem) {
* return elem + elem;
* });
* {a: 'aa', b: 'bb'}
*/
export const mapObjectFromArray = function <K extends string, V>(
arr: ReadonlyArray<K>,
lambda: (arg1: K) => V,
): Record<K, V> {
const result: Record<string, any> = {};
arr.forEach((elem) => {
result[elem] = lambda(elem);
});
return result;
};

0 comments on commit ea33399

Please sign in to comment.