• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vuepress / vuepress-next / 7353675564

29 Dec 2023 04:14AM UTC coverage: 69.529%. Remained the same
7353675564

push

github

meteorlxy
feat: bump to vue 3.4

338 of 471 branches covered (0.0%)

Branch coverage included in aggregate %.

650 of 950 relevant lines covered (68.42%)

52.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

8.33
/packages/cli/src/commands/dev/handlePageUnlink.ts
1
import {
2
  preparePagesComponents,
3
  preparePagesData,
4
  preparePagesRoutes,
5
} from '@vuepress/core'
6
import type { App, Page } from '@vuepress/core'
7

8
/**
9
 * Event handler for page unlink event
10
 *
11
 * Returns the removed page
12
 */
13
export const handlePageUnlink = async (
3✔
14
  app: App,
15
  filePath: string,
16
): Promise<Page | null> => {
17
  // check if the unlinked page is existed
18
  const pageIndex = app.pages.findIndex((page) => page.filePath === filePath)
×
19
  if (pageIndex === -1) {
×
20
    return null
×
21
  }
22

23
  const page = app.pages[pageIndex]
×
24

25
  // remove the old page
26
  app.pages.splice(pageIndex, 1)
×
27

28
  // re-prepare page files
29
  await preparePagesComponents(app)
×
30
  await preparePagesData(app)
×
31
  await preparePagesRoutes(app)
×
32

33
  return page
×
34
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc