diff --git a/packages/core/repl.mjs b/packages/core/repl.mjs index 016eca3ee..ecf40d111 100644 --- a/packages/core/repl.mjs +++ b/packages/core/repl.mjs @@ -151,12 +151,16 @@ export function repl({ await beforeEval?.({ code }); shouldHush && hush(); let { pattern, meta } = await _evaluate(code, transpiler, transpilerOptions); + + if (allTransform) { + for (const [key, value] of Object.entries(pPatterns)) { + pPatterns[key] = allTransform(value); + } + } + if (Object.keys(pPatterns).length) { pattern = stack(...Object.values(pPatterns)); } - if (allTransform) { - pattern = allTransform(pattern); - } if (!isPattern(pattern)) { const message = `got "${typeof evaluated}" instead of pattern`; throw new Error(message + (typeof evaluated === 'function' ? ', did you forget to call a function?' : '.'));