Skip to content

deleteEmptyFolderHierarchy

Removes empty folder hierarchy starting from the given folder.

Import:

import { deleteEmptyFolderHierarchy } from 'obsidian-dev-utils/obsidian/vault';

Signature:

function deleteEmptyFolderHierarchy(app: App, pathOrFolder: PathOrFolder | null): Promise<void>

Parameters:

ParameterTypeDescription
appAppThe application instance.
pathOrFolderPathOrFolder | nullThe folder to start removing empty hierarchy from.

Returns: Promise<void> — A Promise that resolves when the empty hierarchy is deleted.