mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 17:17:28 +02:00
refactor: ensure all types are using index signature instead of Record (#6995)
* refactor: ensure all types are using index signature instead of Record * kick CI
This commit is contained in:
parent
e8800b9d49
commit
87592bca03
99 changed files with 339 additions and 307 deletions
|
@ -23,11 +23,11 @@ import type {
|
|||
// ie the docs of that plugin are currently browsed
|
||||
// it is useful to support multiple docs plugin instances
|
||||
export function getActivePlugin(
|
||||
allPluginDatas: Record<string, GlobalPluginData>,
|
||||
allPluginData: {[pluginId: string]: GlobalPluginData},
|
||||
pathname: string,
|
||||
options: GetActivePluginOptions = {},
|
||||
): ActivePlugin | undefined {
|
||||
const activeEntry = Object.entries(allPluginDatas)
|
||||
const activeEntry = Object.entries(allPluginData)
|
||||
// Route sorting: '/android/foo' should match '/android' instead of '/'
|
||||
.sort((a, b) => b[1].path.localeCompare(a[1].path))
|
||||
.find(
|
||||
|
@ -46,7 +46,7 @@ export function getActivePlugin(
|
|||
if (!activePlugin && options.failfast) {
|
||||
throw new Error(
|
||||
`Can't find active docs plugin for "${pathname}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(
|
||||
allPluginDatas,
|
||||
allPluginData,
|
||||
)
|
||||
.map((plugin) => plugin.path)
|
||||
.join(', ')}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue