diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 00000000..44cebfe2 --- /dev/null +++ b/global.d.ts @@ -0,0 +1,7 @@ +// This file is required for the use of process.browser, which is +// not defined in @types/node but a property added by browserify. +declare namespace NodeJS { + interface Process { + browser: boolean; + } +} diff --git a/package.json b/package.json index 31fc0e0c..c7776b27 100644 --- a/package.json +++ b/package.json @@ -35,16 +35,20 @@ "xtend": "~4.0.0" }, "devDependencies": { + "@types/node": "^9.3.0", "rimraf": "^2.6.1", "sinon": "^4.0.0", "standard": "^10.0.3", - "tape": "^4.7.0" + "tape": "^4.7.0", + "ts-node": "^4.1.0", + "typescript": "^2.6.2" }, "browser": { "rimraf": false }, "scripts": { - "test": "standard && node test.js" + "test": "standard && node test.js && npm run test-ts", + "test-ts": "ts-node --type-check --no-cache test.js" }, "license": "MIT", "engines": { diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..4af83144 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "target": "es2015", + "moduleResolution": "node", + "checkJs": true, + "allowJs": true + } +}