src/tinier.js
function treeSetMutable (address, tree, value) {
  if (address.length === 0) {
    return value
  } else {
    const [ rest, last ] = tail(address)
    const parent = treeGet(rest, tree)
    if (checkType(NODE, parent)) {
      parent.children[last] = value
    } else {
      parent[last] = value
    }
    return tree
  }
}
function treeSetMutable (address, tree, value) {
  if (address.length === 0) {
    return value
  } else {
    const [ rest, last ] = tail(address)
    const parent = treeGet(rest, tree)
    if (checkType(NODE, parent)) {
      parent.children[last] = value
    } else {
      parent[last] = value
    }
    return tree
  }
}
function treeSetMutable ( address , tree , value ) { if ( address . length === 0 ) { return value } else { const [ rest , last ] = tail ( address ) const parent = treeGet ( rest , tree ) if ( checkType ( NODE , parent ) ) { parent . children [ last ] = value } else { parent [ last ] = value } return tree } }
Set the value in a tree; mutable.
@param {Array} address -
@param {Object} tree -
@param {*} value - The new value to set at address.
@return (*) The tree.
Set the value in a tree ; mutable .