Skip to content

Commit

Permalink
Add flow typings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikfox committed Aug 9, 2017
1 parent c805fe1 commit abde3e0
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"presets": [
"flow",
"env"
]
}
9 changes: 9 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ignore]

[include]

[libs]

[lints]

[options]
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ function wilsonInterval(proportion, sample, zScore) {
center: center,
low: low
};
}
}
33 changes: 32 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
"main": "./lib/index.js",
"scripts": {
"dev": "npm run build -- --watch & npm test -- --watchAll & wait",
"build": "babel ./src/index.js --out-file ./lib/index.js",
"build": "babel src -d lib --ignore test.js",
"flow": "flow",
"test": "jest --coverage",
"test-ci": "jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"lint": "eslint src",
"precommit": "npm run lint && npm run test && npm run build && git add lib"
"precommit": "npm run lint && npm run test && npm run build && git add lib",
"prepublish": "npm run build"
},
"dependencies": {
"mathjs": "^3.15.0",
Expand All @@ -43,10 +45,12 @@
"babel-eslint": "^7.2.3",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.6.0",
"babel-preset-flow": "^6.23.0",
"coveralls": "^2.13.1",
"eslint": "^4.3.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-jest": "^20.0.3",
"flow-bin": "^0.52.0",
"husky": "^0.14.3",
"jest": "^20.0.4"
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math from 'mathjs';
import pnormaldist from 'pnormaldist';

export default function wilson(observed, sample, population = false, options = {}) {
export default function wilson(observed: number, sample: number, population = false, options = {}) {
const {
confidence = 0.95,
precision = 20,
Expand Down

0 comments on commit abde3e0

Please sign in to comment.