/
githubmirror
/
hexo
Обзор
Документация
Войти
/
githubmirror
/
hexo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/models/asset.ts
19 строк
514 B
D-Sketon
refactor: refactor types & support warehouse6 (#5483)
22 янв 2025, 10:05
Не верифицирован
22 янв 2025, 10:05
70efca7
Код
Авторство
О чём код?
import warehouse from 'warehouse'; import { join } from 'path'; import type Hexo from '../hexo'; import type { AssetSchema } from '../types'; export = (ctx: Hexo) => { const Asset = new warehouse.Schema<AssetSchema>({ _id: {type: String, required: true}, path: {type: String, required: true}, modified: {type: Boolean, default: true}, renderable: {type: Boolean, default: true} }); Asset.virtual('source').get(function() { return join(ctx.base_dir, this._id); }); return Asset; };