Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function jsonapi(
Base: IModelConstructor|ICollectionConstructor|IViewConstructor,
) {
if (isModel(Base)) {
// @ts-ignore
return decorateModel(Base);
} else if (isCollection(Base)) {
// @ts-ignore
return decorateCollection(Base);
} else if (isView(Base)) {
// @ts-ignore
return decorateView(Base);
}
throw new Error('The instance needs to be a model, collection or a view');
}