core/lib/engine_util.js
function templateObjectOrArray(o, context) {
  deepForEach(o, (value, key, subj, path) => {
    const newPath = template(path, context, true);

    let newValue;
    if (value && (value.constructor !== Object && value.constructor !== Array)) {
      newValue = template(value, context, true);
    } else {
      newValue = value;
    }

    debug(`path = ${path} ; value = ${JSON.stringify(value)} (${typeof value}) ; (subj type: ${subj.length ? 'list':'hash'}) ; newValue = ${JSON.stringify(newValue)} ; newPath = ${newPath}`);

    // If path has changed, we need to unset the original path and
    // explicitly walk down the new subtree from this path:
    if (path !== newPath) {
      L.unset(o, path);
      newValue = template(value, context, true);
    }

    L.set(o, newPath, newValue);
  });
}
function templateObjectOrArray(o, context) {
  deepForEach(o, (value, key, subj, path) => {
    const newPath = template(path, context, true);

    let newValue;
    if (value && (value.constructor !== Object && value.constructor !== Array)) {
      newValue = template(value, context, true);
    } else {
      newValue = value;
    }

    debug(`path = ${path} ; value = ${JSON.stringify(value)} (${typeof value}) ; (subj type: ${subj.length ? 'list':'hash'}) ; newValue = ${JSON.stringify(newValue)} ; newPath = ${newPath}`);

    // If path has changed, we need to unset the original path and
    // explicitly walk down the new subtree from this path:
    if (path !== newPath) {
      L.unset(o, path);
      newValue = template(value, context, true);
    }

    L.set(o, newPath, newValue);
  });
}
function templateObjectOrArray ( o , context ) { deepForEach ( o , ( value , key , subj , path ) => { const newPath = template ( path , context , true ) ; let newValue ; if ( value && ( value . constructor !== Object && value . constructor !== Array ) ) { newValue = template ( value , context , true ) ; } else { newValue = value ; } debug ( ` ${ path } ${ JSON . stringify ( value ) } ${ typeof value } ${ subj . length ? 'list' : 'hash' } ${ JSON . stringify ( newValue ) } ${ newPath } ` ) ; // If path has changed, we need to unset the original path and // explicitly walk down the new subtree from this path: if ( path !== newPath ) { L . unset ( o , path ) ; newValue = template ( value , context , true ) ; } L . set ( o , newPath , newValue ) ; } ) ; }
Mutates the object in place
Mutates the object in place