diff --git a/gulpfile.js b/gulpfile.js index ae3cdee31..cb385f043 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -101,7 +101,7 @@ const paths = { const tsBaseArgs = { - target: "es5", + target: "es6", jsx: "react", reactNamespace: "React", experimentalDecorators: true, 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 diff --git a/tsconfig.json b/tsconfig.json index ee2f58640..042ba3365 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "es6", "jsx": "react", "reactNamespace": "React", "experimentalDecorators": true,