Skip to content

Commit 110f924

Browse files
moltarflexdinesh
authored andcommitted
feat: adds TypeScript declarations
1 parent 6d688d3 commit 110f924

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.3.0",
44
"description": "Check where the code is running in the browser or node.js",
55
"main": "./lib/index.js",
6+
"types": "./lib/index.d.ts",
67
"scripts": {
78
"clean": "rimraf lib",
89
"test": "npm run cover",
@@ -11,7 +12,7 @@
1112
"test:examples": "node examples/",
1213
"cover": "cross-env BABEL_ENV=commonjs istanbul cover node_modules/mocha/bin/_mocha -- --require babel-core/register --recursive",
1314
"lint": "eslint src",
14-
"build": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
15+
"build": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --copy-files",
1516
"prepublish": "npm run clean && npm run lint && npm run test && npm run build"
1617
},
1718
"files": [

src/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export declare const isBrowser: boolean;
2+
export declare const isWebWorker: boolean;
3+
export declare const isNode: boolean;

0 commit comments

Comments
 (0)