scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
13 lines (9 loc) • 401 B
text/typescript
import { InternalError } from 'scrivito_sdk/common';
import { Obj, ObjClass, Schema, Widget, WidgetClass } from 'scrivito_sdk/realm';
export function isObjClass(klass: ObjClass | WidgetClass): boolean {
if (klass === Obj) return true;
if (klass === Widget) return false;
const schema = Schema.forClass(klass);
if (!schema) throw new InternalError();
return isObjClass(schema.parent());
}