-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Describe the bug
I finally came back to this. I'm still having an issue where not all the function calls will reduce / resolve no matter how much I try to pepper with macros.
Code to reproduce
import { build as $build } from 'xregexp';
// ... tokens and stuff
function $buildFragments(rawFragments: string[][]) {
const fragments: Record<string, RegExp> = {};
for (const fragment of rawFragments) {
fragments[fragment[0]!] = $build!(fragment[1]!, fragments);
};
return fragments;
};
export const cssFragments = $buildFragments!(rawCssFragments);Results in:
export const cssFragments = (() => {
const fragments = {};
for (const fragment of rawCssFragments) {
fragments[fragment[0]] = $build(fragment[1], fragments);
}
;
return fragments;
})();Expected behavior
I expected for everything to "resolve" to a single object in the compiled JS.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels