/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/theme/processors/config.ts
25 строк
534 B
D-Sketon
refactor: refact types (#5271)
31 окт 2023, 15:52
Не верифицирован
31 окт 2023, 15:52
b898f29
Код
Авторство
О чём код?
import { Pattern } from 'hexo-util'; import type { _File } from '../../box'; import Theme from '..'; function process(file: _File) { if (file.type === 'delete') { (file.box as Theme).config = {}; return; } return file.render().then(result => { (file.box as Theme).config = result; this.log.debug('Theme config loaded.'); }).catch(err => { this.log.error('Theme config load failed.'); throw err; }); } const pattern = new Pattern(/^_config\.\w+$/); export const config = { pattern, process };