index.js
function parseObject(object) {
  const children = Object.keys(object).map(key => ({
    keyTemplate: parseString(key),
    valueTemplate: parse(object[key])
  }));
  const templateParameters = children.reduce(
    (parameters, child) =>
      parameters.concat(child.valueTemplate.parameters, child.keyTemplate.parameters),
    []
  );
  const templateFn = context => {
    return children.reduce((newObject, child) => {
      newObject[child.keyTemplate(context)] = child.valueTemplate(context);
      return newObject;
    }, {});
  };

  return Template(templateFn, templateParameters);
}
function parseObject(object) {
  const children = Object.keys(object).map(key => ({
    keyTemplate: parseString(key),
    valueTemplate: parse(object[key])
  }));
  const templateParameters = children.reduce(
    (parameters, child) =>
      parameters.concat(child.valueTemplate.parameters, child.keyTemplate.parameters),
    []
  );
  const templateFn = context => {
    return children.reduce((newObject, child) => {
      newObject[child.keyTemplate(context)] = child.valueTemplate(context);
      return newObject;
    }, {});
  };

  return Template(templateFn, templateParameters);
}
function parseObject ( object ) { const children = Object . keys ( object ) . map ( key => ( { keyTemplate : parseString ( key ) , valueTemplate : parse ( object [ key ] ) } ) ) ; const templateParameters = children . reduce ( ( parameters , child ) => parameters . concat ( child . valueTemplate . parameters , child . keyTemplate . parameters ) , [ ] ) ; const templateFn = context => { return children . reduce ( ( newObject , child ) => { newObject [ child . keyTemplate ( context ) ] = child . valueTemplate ( context ) ; return newObject ; } , { } ) ; } ; return Template ( templateFn , templateParameters ) ; }
Parses non-leaf-nodes in the template object that are objects.
Parses non - leaf - nodes in the template object that are objects .