/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/plugins/console/list/index.ts
31 строка
732 B
D-Sketon
refactor: refactor types & support warehouse6 (#5483)
22 янв 2025, 10:05
Не верифицирован
22 янв 2025, 10:05
70efca7
Код
Авторство
О чём код?
import abbrev from 'abbrev'; import page from './page'; import post from './post'; import route from './route'; import tag from './tag'; import category from './category'; import type Hexo from '../../../hexo'; import type Promise from 'bluebird'; interface ListArgs { _: string[] } const store = { page, post, route, tag, category }; const alias = abbrev(Object.keys(store)); function listConsole(this: Hexo, args: ListArgs): Promise<void> { const type = args._.shift(); // Display help message if user didn't input any arguments if (!type || !alias[type]) { return this.call('help', {_: ['list']}); } return this.load().then(() => Reflect.apply(store[alias[type]], this, [args])); } export = listConsole;