Skip to content

getCheckIsAttachmentUnitFolderFunction

Reads the attachment-unit-folder designation an attachment-location plugin published on the vault.

The designation is one plugin’s setting but every relocating plugin’s business, so it rides the same seam that already carries that kind of answer: a member hung off the patched Vault.getAvailablePathForAttachments. Reading it here rather than consulting any one plugin’s settings is the point — a folder kept whole by one plugin and torn apart by another is exactly the failure findAttachmentUnitFolderPath exists to prevent.

undefined means nobody published a designation, the same “nobody owns this policy” answer the GetAvailablePathForAttachmentsFunctionExtended.extended member gives. It is distinct from a designation that answers false for every folder.

Import:

import { getCheckIsAttachmentUnitFolderFunction } from 'obsidian-dev-utils/obsidian/attachment-path';

Signature:

function getCheckIsAttachmentUnitFolderFunction(app: App): ((this: void, folderPath: string) => boolean) | undefined

Parameters:

ParameterTypeDescription
appAppAn Obsidian application instance.

Returns: ((this: void, folderPath: string) => boolean) | undefined — The designation predicate, or undefined when nobody published one.