文件操作 - paths-kebab-case.ts
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/@redocly/openapi-core/src/rules/common/paths-kebab-case.ts
编辑文件内容
import type { Oas3Rule, Oas2Rule } from '../../visitors'; import type { UserContext } from '../../walk'; export const PathsKebabCase: Oas3Rule | Oas2Rule = () => { return { PathItem(_path: object, { report, key }: UserContext) { const segments = (key as string) .substr(1) .split('/') .filter((s) => s !== ''); // filter out empty segments if (!segments.every((segment) => /^{.+}$/.test(segment) || /^[a-z0-9-.]+$/.test(segment))) { report({ message: `\`${key}\` does not use kebab-case.`, location: { reportOnKey: true }, }); } }, }; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件