mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
5610df5a26
* 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.
17 lines
444 B
TypeScript
17 lines
444 B
TypeScript
import { addAttributeOptions } from "sequelize-typescript";
|
|
|
|
/**
|
|
* A decorator that validates that a string does not include something that
|
|
* looks like a URL.
|
|
*/
|
|
export default function NotContainsUrl(target: object, propertyName: string) {
|
|
return addAttributeOptions(target, propertyName, {
|
|
validate: {
|
|
not: {
|
|
args: /(www\.|file:|http:|https:)[^\s]+[\w]/,
|
|
msg: "Must not contain a URL",
|
|
},
|
|
},
|
|
});
|
|
}
|