From 353eeca339e060eb4a03e0b67343086854a5e5d7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 15 Oct 2017 18:55:34 +0200 Subject: add missing typeof, makes unit tests pass --- src/checkable.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/checkable.ts b/src/checkable.ts index 0e437839e..8e942d7cc 100644 --- a/src/checkable.ts +++ b/src/checkable.ts @@ -216,7 +216,8 @@ export namespace Checkable { type: target, }, ["(root)"]); if (opts.validate) { - if (target.validate !== "function") { + if (typeof target.validate !== "function") { + console.error("target", target); throw Error("invalid Checkable annotion: validate method required"); } // May throw exception -- cgit v1.2.3