mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-11 07:12:29 +02:00
refactor: remove a lot of implicit anys (#7468)
This commit is contained in:
parent
0c8e57de67
commit
3666a2ede5
23 changed files with 148 additions and 163 deletions
|
@ -9,7 +9,10 @@ import {validateThemeConfig, DEFAULT_CONFIG} from '../validateThemeConfig';
|
|||
import type {Joi} from '@docusaurus/utils-validation';
|
||||
|
||||
function testValidateThemeConfig(themeConfig: {[key: string]: unknown}) {
|
||||
function validate(schema: Joi.Schema, cfg: {[key: string]: unknown}) {
|
||||
function validate(
|
||||
schema: Joi.ObjectSchema<{[key: string]: unknown}>,
|
||||
cfg: {[key: string]: unknown},
|
||||
) {
|
||||
const {value, error} = schema.validate(cfg, {
|
||||
convert: false,
|
||||
});
|
||||
|
|
|
@ -237,10 +237,14 @@ function SearchPageContent(): JSX.Element {
|
|||
url,
|
||||
_highlightResult: {hierarchy},
|
||||
_snippetResult: snippet = {},
|
||||
}: {
|
||||
url: string;
|
||||
_highlightResult: {hierarchy: {[key: string]: {value: string}}};
|
||||
_snippetResult: {content?: {value: string}};
|
||||
}) => {
|
||||
const parsedURL = new URL(url);
|
||||
const titles = Object.keys(hierarchy).map((key) =>
|
||||
sanitizeValue(hierarchy[key].value),
|
||||
sanitizeValue(hierarchy[key]!.value),
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue