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

vuepress / vuepress-next / 7184128480

12 Dec 2023 04:07PM CUT coverage: 69.405% (+0.2%) from 69.176%
7184128480

Pull #1314

github

web-flow
Merge e9e22663d into f7d6dde7d
Pull Request #1314: fix(client): avoid updating existing head tags, close #1268

332 of 464 branches covered (0.0%)

Branch coverage included in aggregate %.

13 of 14 new or added lines in 2 files covered. (92.86%)

648 of 948 relevant lines covered (68.35%)

48.83 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