Re:TC39: Add Object.groupBy and Map.groupBy
by diegof79 on Tuesday December 19, 2023 @08:03PM
(#38704256)
Well there is a standard way to support multiple versions of a JS library: imports.
I wonder is there is any proposal for a standard library with a well known URI.
A browser with ESM support should be able to provide its internal version or fallback with a polyfill using import maps. Something like:
import {groupBy} from “std:arrays”
That can be also useful to standardize libs between Node,Deno,Bun without polluting the global namespace… and it’s backwards compatible
I wonder is there is any proposal for a standard library with a well known URI.
A browser with ESM support should be able to provide its internal version or fallback with a polyfill using import maps. Something like: import {groupBy} from “std:arrays”
That can be also useful to standardize libs between Node,Deno,Bun without polluting the global namespace… and it’s backwards compatible