1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Optimise cloneDeep usage in string templates

This commit is contained in:
Andrew Kingston 2024-03-13 12:11:09 +00:00
parent 886929b8bc
commit 64855bbdf0

View file

@ -54,8 +54,9 @@ module.exports.processJS = (handlebars, context) => {
// Our $ context function gets a value from context.
// We clone the context to avoid mutation in the binding affecting real
// app context.
const clonedContext = cloneDeep(context)
const sandboxContext = {
$: path => getContextValue(path, cloneDeep(context)),
$: path => getContextValue(path, clonedContext),
helpers: getJsHelperList(),
// Proxy to evaluate snippets when running in the browser