diff --git a/index.js b/index.ts similarity index 93% rename from index.js rename to index.ts index 7f7736d..5269bd0 100644 --- a/index.js +++ b/index.ts @@ -5,9 +5,7 @@ * Released under the MIT License. */ -'use strict'; - -module.exports = function(arr) { +export = function(arr: Array) { if (!Array.isArray(arr)) { throw new TypeError('expected an array'); } diff --git a/package.json b/package.json index 5c8b8d4..d2fbf41 100644 --- a/package.json +++ b/package.json @@ -19,15 +19,19 @@ "index.js" ], "main": "index.js", + "types": "index.d.ts", "engines": { "node": ">=0.10.0" }, "scripts": { + "build": "tsc --declaration index.ts", + "pretest": "tsc index.ts", "test": "mocha" }, "devDependencies": { "gulp-format-md": "^0.1.12", - "mocha": "^3.3.0" + "mocha": "^3.3.0", + "typescript": "^2.8.1" }, "keywords": [ "array",