add missing typeof, makes unit tests pass

This commit is contained in:
Florian Dold 2017-10-15 18:55:34 +02:00
parent 03782f8aea
commit 353eeca339
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
3 changed files with 4 additions and 3 deletions

View File

@ -101,7 +101,7 @@ const paths = {
const tsBaseArgs = { const tsBaseArgs = {
target: "es5", target: "es6",
jsx: "react", jsx: "react",
reactNamespace: "React", reactNamespace: "React",
experimentalDecorators: true, experimentalDecorators: true,

View File

@ -216,7 +216,8 @@ export namespace Checkable {
type: target, type: target,
}, ["(root)"]); }, ["(root)"]);
if (opts.validate) { if (opts.validate) {
if (target.validate !== "function") { if (typeof target.validate !== "function") {
console.error("target", target);
throw Error("invalid Checkable annotion: validate method required"); throw Error("invalid Checkable annotion: validate method required");
} }
// May throw exception // May throw exception

View File

@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es6",
"jsx": "react", "jsx": "react",
"reactNamespace": "React", "reactNamespace": "React",
"experimentalDecorators": true, "experimentalDecorators": true,