function mutateValueFromKey(properties = {}, key, value) {
	if (!key || !key.length) {
		return value;
	}

	const nextKey = key[0];
	const restKeys = key.slice(1);
	const nextValue = mutateValueFromKey(properties[nextKey], restKeys, value);

	let nextProperties;
	if (properties instanceof Array) {
		nextProperties = properties.slice(0);
	} else {
		nextProperties = { ...properties };
	}

	if (nextValue === undefined) {
		delete nextProperties[nextKey];
		return nextProperties;
	}
	nextProperties[nextKey] = nextValue;
	return nextProperties;
}
/**
 * Mutate the properties, setting the value in the path identified by key
 * @param {object | array} properties The original properties store
 * @param {array} key The key chain (array of strings) to identify the path
 * @param {any} value The value to set
 * @returns {object} The new mutated properties.
 */
Mutate the properties, setting the value in the path identified by key
@param {object | array} properties The original properties store
@param {array} key The key chain (array of strings) to identify the path
@param {any} value The value to set
@returns {object} The new mutated properties.
Mutate the properties setting the value in the path identified by key @param { object | array } properties The original properties store @param { array } key The key chain ( array of strings ) to identify the path @param { any } value The value to set @returns { object } The new mutated properties .
function mutateValueFromKey(properties = {}, key, value) {
	if (!key || !key.length) {
		return value;
	}
	const nextKey = key[0];
	const restKeys = key.slice(1);
	const nextValue = mutateValueFromKey(properties[nextKey], restKeys, value);
	let nextProperties;
	if (properties instanceof Array) {
		nextProperties = properties.slice(0);
	} else {
		nextProperties = { ...properties };
	}
	if (nextValue === undefined) {
		delete nextProperties[nextKey];
		return nextProperties;
	}
	nextProperties[nextKey] = nextValue;
	return nextProperties;
}
function mutateValueFromKey ( properties = { } , key , value ) { if ( ! key || ! key . length ) { return value ; } const nextKey = key [ 0 ] ; const restKeys = key . slice ( 1 ) ; const nextValue = mutateValueFromKey ( properties [ nextKey ] , restKeys , value ) ; let nextProperties ; if ( properties instanceof Array ) { nextProperties = properties . slice ( 0 ) ; } else { nextProperties = { ... properties } ; } if ( nextValue === undefined ) { delete nextProperties [ nextKey ] ; return nextProperties ; } nextProperties [ nextKey ] = nextValue ; return nextProperties ; }
Mutate the properties, setting the value in the path identified by key
 @param {object | array} properties The original properties store
 @param {array} key The key chain (array of strings) to identify the path
 @param {any} value The value to set
 @returns {object} The new mutated properties.
Mutate the properties setting the value in the path identified by key @param { object | array } properties The original properties store @param { array } key The key chain ( array of strings ) to identify the path @param { any } value The value to set @returns { object } The new mutated properties .