Where would/should the mapping happen? Probably not the Set constructor. JSON.parseSet()
?
JSON.parseSet = json => new Set(JSON.parse(json));
JSON.parseSet('["A", "B", "C", "A", "B"]'); // Set(3) [ "A", "B", "C" ]
/edit: JSON.parseMap()
JSON.parseMap = json => new Map(Object.entries(JSON.parse(json)));
JSON.parseMap('{"a":1,"b": 2}'); // Map { a → 1, b → 2 }
I don't see how buying the GitHub repo as well makes it not a supply chain attack but enshitification.
They bought into the supply chain. It's a supply chain attack.