Skip to content

Commit

Permalink
Apply all function to individual patterns rather than final stack (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu authored Nov 30, 2024
1 parent 726abf7 commit ef53367
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/core/repl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ export function repl({
shouldHush && hush();
let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions);
if (Object.keys(pPatterns).length) {
pattern = stack(...Object.values(pPatterns));
}
if (allTransform) {
let patterns = Object.values(pPatterns);
if (allTransform) {
patterns = patterns.map(allTransform);
}
pattern = stack(...patterns);
} else if (allTransform) {
pattern = allTransform(pattern);
}
if (!isPattern(pattern)) {
Expand Down

0 comments on commit ef53367

Please sign in to comment.