fix: Cannot read property 'startsWith' of undefined by sy-records · Pull Request #1358 · docsifyjs/docsify
Summary
I fixed #1356 and found another error.
const path = paths[0]; if (Array.isArray(config.pathNamespaces)) { namespaceSuffix = config.pathNamespaces.find(prefix => path.startsWith(prefix)) || namespaceSuffix; }
path is undefined when only a readme file is present.
What kind of change does this PR introduce? (check at least one)
- Bugfix
- Feature
- Code style update
- Refactor
- Docs
- Build-related changes
- Repo settings
- Other, please describe:
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
- Yes
- No
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
- When resolving a specific issue, it's referenced in the PR's title (e.g.
fix #xxx[,#xxx], where "xxx" is the issue number)
You have tested in the following browsers: (Providing a detailed version will be better.)
- Chrome
- Firefox
- Safari
- Edge
- IE
If adding a new feature, the PR's description includes:
- A convincing reason for adding this feature
- Related documents have been updated
- Related tests have been updated
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
