function setValue (pointer, token, value) {
if (pointer.value && typeof pointer.value === 'object') {
  if (token === '-' && Array.isArray(pointer.value)) {
    pointer.value.push(value);
  }
  else {
    pointer.value[token] = value;
  }
}
else {
  throw ono.syntax('Error assigning $ref pointer "%s". \nCannot set "%s" of a non-object.', pointer.path, token);
}
return value;
}
Sets the specified token value of the {@link Pointer#value}.

The token is evaluated according to RFC 6901.
{@link https://tools.ietf.org/html/rfc6901#section-4}

@param {Pointer} pointer - The JSON Pointer whose value will be modified
@param {string} token - A JSON Pointer token that indicates how to modify `obj`
@param {*} value - The value to assign
@returns {*} - Returns the assigned value