chore(workflows-sdk, utils): Prevent unnecessary serialization (#13413)

* chore(workflows-sdk, utils): Prevent unnecessary serialization

* Create poor-mugs-cheat.md
This commit is contained in:
Adrien de Peretti
2025-09-04 16:19:35 +02:00
committed by GitHub
parent bd571aca82
commit 55a35e4721
5 changed files with 31 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
import {
deepCopy,
isDefined,
OrchestrationUtils,
parseStringifyIfNecessary,
promiseAll,
} from "@medusajs/utils"
@@ -83,8 +83,5 @@ export async function resolveValue(input, transactionContext) {
? await resolveProperty(copiedInput, transactionContext)
: await unwrapInput(copiedInput, {})
const strResult = JSON.stringify(result) // Symbols return undefined
if (isDefined(strResult)) {
return JSON.parse(strResult)
}
return parseStringifyIfNecessary(result)
}