MCPcopy Create free account
hub / github.com/experdot/pointer / checkPageNameConflict

Function checkPageNameConflict

src/renderer/src/services/pagesService.ts:179–190  ·  view source on GitHub ↗
(
  pageId: string,
  targetFolderId: string | undefined
)

Source from the content-addressed store, hash-verified

177
178// 检查页面在目标文件夹是否重名
179export function checkPageNameConflict(
180 pageId: string,
181 targetFolderId: string | undefined
182): string | null {
183 const { page } = stores
184 const movingPage = page.getById(pageId)
185 if (!movingPage) return null
186
187 const siblingPages = page.findByFolderId(targetFolderId)
188 const conflict = siblingPages.find((p) => p.id !== pageId && p.name === movingPage.name)
189 return conflict ? movingPage.name : null
190}
191
192// 检查文件夹在目标文件夹是否重名
193export function checkFolderNameConflict(

Callers

nothing calls this directly

Calls 2

findByFolderIdMethod · 0.80
getByIdMethod · 0.65

Tested by

no test coverage detected