Skip to content

Commit 349c8cb

Browse files
committed
Only append tags when isLiquidDirective is true
1 parent b29a712 commit 349c8cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/core/src/mapping-kit/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { arrify } from '../arrify'
99
import { flattenObject } from './flatten'
1010
import { evaluateLiquid } from './liquid-directive'
1111
import { StatsContext } from '../destination-kit'
12+
import { isLiquidDirective } from './value-keys'
1213

1314
export type InputData = { [key: string]: unknown }
1415
export type Features = { [key: string]: boolean }
@@ -392,7 +393,12 @@ function resolve(mapping: JSONLike, payload: JSONObject, statsContext?: StatsCon
392393
}
393394

394395
if (isDirective(mapping)) {
395-
return runDirective(mapping, payload, statsContext)
396+
if (isLiquidDirective(mapping)) {
397+
// Only include stats, and therefore extra fieldKey tags, if the mapping is a liquid directive to save on costs
398+
return runDirective(mapping, payload, statsContext)
399+
}
400+
401+
return runDirective(mapping, payload)
396402
}
397403

398404
if (Array.isArray(mapping)) {

0 commit comments

Comments
 (0)