From 3937e38893533c48b1957b08c844c6abb90df891 Mon Sep 17 00:00:00 2001 From: Luuk van Houdt Date: Fri, 28 Feb 2020 17:10:56 +0100 Subject: [PATCH] Fixed type definitions of sanitizers and formatting --- index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index f1c3310..9f73b4a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2,6 +2,7 @@ export default class Schema { constructor(instructions?: SchemaInstructions); sanitize(input: object): object; + path(propName: string): Property; } @@ -13,6 +14,7 @@ export class Property { constructor(name: string, definition?: SanitizerDefinition); sanitize(input: any): any; + sanitizeObject(input: object): object; } @@ -22,11 +24,11 @@ interface SanitizerDefinition { convert: ConvertSanitizer } -type RemoveSanitizer = RegExp; +type RemoveSanitizer = string | RegExp; interface FormatSanitizer { - from: RegExp, - to: string | number, + from: string | RegExp, + to: string | number | Function, } interface ConvertSanitizer {