1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-26 18:24:36 +02:00
This commit is contained in:
syuilo
2026-02-15 19:42:31 +09:00
parent 0996c2d9b2
commit d8d4b230b0
6 changed files with 47 additions and 23 deletions

View File

@@ -8,3 +8,11 @@ import { blind } from './objects/blind.js';
export const OBJECT_DEFS = [
blind,
];
export function getObjectDef(type: string): typeof OBJECT_DEFS[number] {
const def = OBJECT_DEFS.find(x => x.id === type);
if (def == null) {
throw new Error(`Unrecognized object type: ${type}`);
}
return def;
}