MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / assetFolderSubpath

Function assetFolderSubpath

packages/app-core/src/lib/vault-layout.ts:1250–1259  ·  view source on GitHub ↗
(
  asset: Pick<AssetMeta, 'path'>,
  settings: VaultSettings | null | undefined
)

Source from the content-addressed store, hash-verified

1248}
1249
1250export function assetFolderSubpath(
1251 asset: Pick<AssetMeta, 'path'>,
1252 settings: VaultSettings | null | undefined
1253): string {
1254 const folder = folderForVaultRelativePath(asset.path, settings)
1255 if (!folder) return ''
1256 const within = assetPathWithinFolder(asset.path, folder, settings)
1257 const parts = within.split('/').filter(Boolean)
1258 return parts.length > 1 ? parts.slice(0, -1).join('/') : ''
1259}
1260
1261export function assetBelongsToFolderView(
1262 asset: Pick<AssetMeta, 'path'>,

Callers 4

buildTreeFunction · 0.90
assetBelongsToFolderViewFunction · 0.85

Calls 2

assetPathWithinFolderFunction · 0.85

Tested by

no test coverage detected