Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 6b291b5

Browse files
committed
feat: allow to use custom data for template interpolation
1 parent 7017190 commit 6b291b5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/runActions.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ module.exports = async (config, context) => {
6868
transformer.render(
6969
contents,
7070
config.transformerOptions,
71-
Object.assign({}, context.answers, {
72-
context
73-
})
71+
Object.assign(
72+
{},
73+
context.answers,
74+
typeof config.templateData === 'function'
75+
? config.templateData.call(context, context)
76+
: config.templateData,
77+
{
78+
context
79+
}
80+
)
7481
).body
7582
)
7683
})

0 commit comments

Comments
 (0)