This repository has been archived by the owner on Apr 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Reynolds
authored and
Thomas Reynolds
committed
Sep 17, 2021
1 parent
adc837c
commit 9ec08cc
Showing
7 changed files
with
2,178 additions
and
2,975 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export default <K extends any, V extends any, T extends any, U extends any>( | ||
fn: (a: K | V) => T | U, | ||
) => (map: Map<K, V>) => | ||
new Map(Array.from(map).map(([k, v]) => [fn(k), fn(v)])) | ||
fn: (a: K | V) => T | U, | ||
) => | ||
(map: Map<K, V>) => | ||
new Map(Array.from(map).map(([k, v]) => [fn(k), fn(v)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
export default <T extends any, U extends any>(fn: (a: T) => U) => ( | ||
record: Record<string, T>, | ||
) => | ||
Object.keys(record).reduce((sum, key) => { | ||
sum[key] = fn(record[key]) | ||
return sum | ||
}, {} as Record<string, U>) | ||
export default <T extends any, U extends any>(fn: (a: T) => U) => | ||
(record: Record<string, T>) => | ||
Object.keys(record).reduce((sum, key) => { | ||
sum[key] = fn(record[key]) | ||
return sum | ||
}, {} as Record<string, U>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default <T extends any, U extends any>(fn: (a: T) => U) => ( | ||
set: Set<T>, | ||
) => new Set(Array.from(set).map(x => fn(x))) | ||
export default <T extends any, U extends any>(fn: (a: T) => U) => | ||
(set: Set<T>) => | ||
new Set(Array.from(set).map(x => fn(x))) |