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 = {
target: "es5",
target: "es6",
jsx: "react",
reactNamespace: "React",
experimentalDecorators: true,

View File

@ -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

View File

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