src/utils/filterMapToShape.js
function _filterToShape(mutable, obj, shape, path = [], fullObj = null)
{
	if (fullObj === null)
	{
		fullObj = obj;
	}

	// Filter object (Complex filter operation)
	if (isImmutableJsMap(shape) && shape.has(SHAPE_FILTER_KEY) && shape.get(SHAPE_FILTER_KEY) === true)
	{
		processFilterObject(mutable, shape, obj, path, fullObj);

		return;
	}

	shape.forEach((value, key) =>
	{
		// TRUE (Get full key subtree)
		if (value === true)
		{
			if (obj.has(key))
			{
				mutable.setIn(path.concat(key), obj.get(key));
			}
		}
		// STRING (Edit path)
		else if (typeof value === 'string')
		{
			if (obj.has(key))
			{
				let editedPath = processShapeEditPath(value, path.concat(key))

				if (editedPath.size <= 0)
				{
					return;
				}


				mutable.setIn(editedPath, obj.get(key));
			}
		}
		// LIST (Select keys)
		else if (Immutable.List.isList(value))
		{
			processList(mutable, key, value, obj, path, fullObj);
		}
		// MAP (Go deeper)
		else // filter key
		{
			// Consider maps only
			if (isImmutableJsMap(value))
			{
				if (obj.has(key))
				{
					// Nested filter
					_filterToShape(mutable, obj.get(key), shape.get(key), cloneDeep(path.concat(key)), fullObj);
				}
			}
		}
	})
}
function _filterToShape(mutable, obj, shape, path = [], fullObj = null)
{
	if (fullObj === null)
	{
		fullObj = obj;
	}

	// Filter object (Complex filter operation)
	if (isImmutableJsMap(shape) && shape.has(SHAPE_FILTER_KEY) && shape.get(SHAPE_FILTER_KEY) === true)
	{
		processFilterObject(mutable, shape, obj, path, fullObj);

		return;
	}

	shape.forEach((value, key) =>
	{
		// TRUE (Get full key subtree)
		if (value === true)
		{
			if (obj.has(key))
			{
				mutable.setIn(path.concat(key), obj.get(key));
			}
		}
		// STRING (Edit path)
		else if (typeof value === 'string')
		{
			if (obj.has(key))
			{
				let editedPath = processShapeEditPath(value, path.concat(key))

				if (editedPath.size <= 0)
				{
					return;
				}


				mutable.setIn(editedPath, obj.get(key));
			}
		}
		// LIST (Select keys)
		else if (Immutable.List.isList(value))
		{
			processList(mutable, key, value, obj, path, fullObj);
		}
		// MAP (Go deeper)
		else // filter key
		{
			// Consider maps only
			if (isImmutableJsMap(value))
			{
				if (obj.has(key))
				{
					// Nested filter
					_filterToShape(mutable, obj.get(key), shape.get(key), cloneDeep(path.concat(key)), fullObj);
				}
			}
		}
	})
}
TODO: Handle errors