Skip to content

Instantly share code, notes, and snippets.

@voznik
Created December 19, 2018 07:59
Show Gist options
  • Save voznik/5220b7d6c6b052c5610b1818d38af4d8 to your computer and use it in GitHub Desktop.
Save voznik/5220b7d6c6b052c5610b1818d38af4d8 to your computer and use it in GitHub Desktop.
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