def unset(d: Dict, key: str): """ Unsets a key """ _unset(d, key) path = to_path(key) for i in reversed(range(1, len(path))): if len(get(d, path[:i])) == 0: unset(d, path[:i])
def unset(d, key): pydash.objects.unset(d, key) path = to_path(key) for i in reversed(range(1, len(path))): if len(get(d, path[:i])) == 0: unset(d, path[:i])