Created
December 19, 2018 07:59
-
-
Save voznik/5220b7d6c6b052c5610b1818d38af4d8 to your computer and use it in GitHub Desktop.
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
export class ExtendedMap<S extends string, T> extends Map<S, T> { | |
map(mapper: (value: T) => any) { | |
return Array.from(this.values(), mapper); | |
} | |
filter(filterer: (value: T) => T[]) { | |
return [...this.values()].filter(filterer); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment