/
githubmirror
/
docusaurus
Обзор
Документация
Войти
/
githubmirror
/
docusaurus
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/docusaurus-plugin-content-pages/src/frontMatter.ts
37 строк
1 KB
Sébastien Lorber
chore(monorepo): upgrade monorepo to ESLint 9 (#12024)
15 май 2026, 21:08
Не верифицирован
15 май 2026, 21:08
7518645
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import { Joi, validateFrontMatter, FrontMatterTOCHeadingLevels, ContentVisibilitySchema, URISchema, FrontMatterLastUpdateSchema, } from '@docusaurus/utils-validation'; import type {PageFrontMatter} from '@docusaurus/plugin-content-pages'; /* eslint-disable camelcase */ const PageFrontMatterSchema = Joi.object<PageFrontMatter>({ // See https://github.com/facebook/docusaurus/issues/4591#issuecomment-822372398 title: Joi.string().allow(''), // See https://github.com/facebook/docusaurus/issues/4591#issuecomment-822372398 description: Joi.string().allow(''), keywords: Joi.array().items(Joi.string().required()), image: URISchema, slug: Joi.string(), wrapperClassName: Joi.string(), hide_table_of_contents: Joi.boolean(), ...FrontMatterTOCHeadingLevels, last_update: FrontMatterLastUpdateSchema, }).concat(ContentVisibilitySchema); export function validatePageFrontMatter(frontMatter: { [key: string]: unknown; }): PageFrontMatter { return validateFrontMatter(frontMatter, PageFrontMatterSchema); }