mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-15 11:11:51 +00:00
16 lines
354 B
JavaScript
16 lines
354 B
JavaScript
/**
|
|
*
|
|
* @param {string} source
|
|
* @param {*} map
|
|
* @returns
|
|
*/
|
|
module.exports = function (source, map) {
|
|
const regex = /export (?:let|class) (?<name>\w+)/g;
|
|
// @ts-ignore
|
|
[...source.matchAll(regex)]
|
|
.map(n => n.groups.name)
|
|
.forEach(name => (source += `export const $S_${name}=(v)=>${name}=v;\n`));
|
|
|
|
return source;
|
|
};
|