mirror of
https://github.com/outline/outline.git
synced 2026-11-22 22:02:35 +03:00
* chore: Reduce no-explicit-any warnings in server directory Tightens types across test response bodies, decorator signatures, the TestServer wrapper, base class generics, and presenter Record types. Where any is genuinely load-bearing (Sequelize model generics, PropertyDescriptor decorator returns, plugin-registered template classes, Fix mixin), keeps any with a targeted eslint-disable plus reason rather than masking the constraint. Cuts server-only no-explicit-any warnings from 162 to 70. * fix: groups test asserts on first response instead of second Caught by Copilot review on the no-explicit-any cleanup. Also fixes the pre-existing getChangsetSkipped → getChangesetSkipped typo surfaced while reviewing nearby decorator code.
24 lines
646 B
TypeScript
24 lines
646 B
TypeScript
import "reflect-metadata";
|
|
|
|
const key = Symbol("skipChangeset");
|
|
|
|
/**
|
|
* This decorator is used to annotate a property as being skipped from being included in a changeset.
|
|
*/
|
|
export function SkipChangeset(target: object, propertyKey: string) {
|
|
const properties: string[] = Reflect.getMetadata(key, target);
|
|
|
|
if (!properties) {
|
|
return Reflect.defineMetadata(key, [propertyKey], target);
|
|
}
|
|
|
|
properties.push(propertyKey);
|
|
}
|
|
|
|
/**
|
|
* This function is used to get the properties that should be skipped from a changeset.
|
|
*/
|
|
export function getChangesetSkipped(target: object): string[] {
|
|
return Reflect.getMetadata(key, target) || [];
|
|
}
|