From ef53367ba9ccb46e1d5c7dd199fd831ea8828c7c Mon Sep 17 00:00:00 2001 From: Alex McLean Date: Sat, 30 Nov 2024 08:46:13 +0000 Subject: [PATCH] Apply `all` function to individual patterns rather than final stack (#1209) --- packages/core/repl.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/repl.mjs b/packages/core/repl.mjs index 016eca3ee..560c9d330 100644 --- a/packages/core/repl.mjs +++ b/packages/core/repl.mjs @@ -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)) {