isAtProperAttachmentPath
Checks whether an attachment already sits at its proper attachment path.
Returns true when the attachment’s current path is, within its proper attachment folder, either the proper base name or the proper base name plus an Obsidian deduplication suffix (a space followed by digits, e.g. img 1) with the same extension. The proper path is computed via getAttachmentFilePath with GetAttachmentFilePathParams.shouldSkipDuplicateCheck set to true (the target before any deduplication suffix), and the comparison respects the file system case-sensitivity flag (getDataAdapterEx(app).insensitive) that getSafeRenamePath uses.
This lets a caller recognize a deduplication-parked attachment as already-collected, so a “needs move?” decision made against the deduplication-free proper path converges instead of re-scheduling the file forever.
Import:
import { isAtProperAttachmentPath } from 'obsidian-dev-utils/obsidian/attachment-path';Signature:
function isAtProperAttachmentPath(params: IsAtProperAttachmentPathParams): Promise<boolean>Parameters:
| Parameter | Type | Description |
|---|---|---|
params | IsAtProperAttachmentPathParams | Parameters for the is at proper attachment path function. |
Returns: Promise<boolean> — A Promise that resolves to true when the attachment is already at its proper path.
Links to this page: