Skip to content

Commit db56cde

Browse files
committed
fix(package): fix potential security vulnerabilities
1 parent 20de5cf commit db56cde

File tree

4 files changed

+2424
-1431
lines changed

4 files changed

+2424
-1431
lines changed

babel.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const env = modules => [
1111
},
1212
];
1313

14-
module.exports = {
14+
const config /* : any */ = {
1515
plugins: ['@babel/plugin-proposal-class-properties'],
1616
presets: ['@babel/flow', env()],
1717
env: {
@@ -20,3 +20,5 @@ module.exports = {
2020
},
2121
},
2222
};
23+
24+
module.exports = config;

package.json

+24-24
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,39 @@
2626
}
2727
},
2828
"devDependencies": {
29-
"@babel/core": "^7.9.0",
30-
"@babel/plugin-proposal-class-properties": "^7.8.3",
31-
"@babel/preset-env": "^7.9.5",
32-
"@babel/preset-flow": "^7.9.0",
33-
"@rollup/plugin-commonjs": "^11.1.0",
29+
"@babel/core": "^7.12.9",
30+
"@babel/plugin-proposal-class-properties": "^7.12.1",
31+
"@babel/preset-env": "^7.12.7",
32+
"@babel/preset-flow": "^7.12.1",
33+
"@rollup/plugin-commonjs": "^17.0.0",
3434
"@semantic-release/changelog": "^5.0.1",
3535
"@semantic-release/commit-analyzer": "^8.0.1",
3636
"@semantic-release/git": "^9.0.0",
37-
"@semantic-release/github": "^7.0.5",
38-
"@semantic-release/npm": "^7.0.5",
37+
"@semantic-release/github": "^7.2.0",
38+
"@semantic-release/npm": "^7.0.8",
3939
"@semantic-release/release-notes-generator": "^9.0.1",
4040
"babel-core": "^7.0.0-bridge.0",
4141
"babel-eslint": "^10.1.0",
42-
"babel-jest": "^25.3.0",
43-
"eslint": "^6.8.0",
44-
"eslint-config-airbnb-base": "^14.1.0",
45-
"eslint-config-prettier": "^6.10.1",
46-
"eslint-plugin-flowtype": "^4.7.0",
47-
"eslint-plugin-import": "^2.20.2",
48-
"eslint-plugin-prettier": "^3.1.3",
49-
"flow-bin": "^0.123.0",
50-
"flow-typed": "^3.1.0",
51-
"husky": "^4.2.5",
52-
"jest": "^25.3.0",
53-
"markdownlint": "^0.20.1",
54-
"prettier": "^2.0.4",
55-
"rollup": "^2.6.1",
42+
"babel-jest": "^26.6.3",
43+
"eslint": "^7.14.0",
44+
"eslint-config-airbnb-base": "^14.2.1",
45+
"eslint-config-prettier": "^6.15.0",
46+
"eslint-plugin-flowtype": "^5.2.0",
47+
"eslint-plugin-import": "^2.22.1",
48+
"eslint-plugin-prettier": "^3.1.4",
49+
"flow-bin": "^0.138.0",
50+
"flow-typed": "^3.2.1",
51+
"husky": "^4.3.0",
52+
"jest": "^26.6.3",
53+
"markdownlint": "^0.22.0",
54+
"prettier": "^2.2.1",
55+
"rollup": "^2.34.0",
5656
"rollup-plugin-babel": "^4.4.0",
5757
"rollup-plugin-clear": "^2.0.7",
5858
"rollup-plugin-flow-entry": "^0.3.4",
59-
"semantic-release": "^17.0.6",
60-
"shx": "^0.3.2",
61-
"typescript": "^3.8.3"
59+
"semantic-release": "^17.3.0",
60+
"shx": "^0.3.3",
61+
"typescript": "^4.1.2"
6262
},
6363
"repository": "bigslycat/typed-contracts",
6464
"keywords": [

src/Contract.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ function curry2(fn) {
4747
args.length > 1 ? fn(args[0], args[1]) : value => fn(args[0], value);
4848
}
4949

50-
declare export function of/* :: <T> */ (
50+
export function of /* :: <T> */(
5151
validate: (valueName: string, value: mixed) => ValidationError | T,
52-
): Contract<T>;
53-
54-
// eslint-disable-next-line no-redeclare
55-
export function of(validate) {
52+
): Contract<T> {
5653
const maybe = curry2((valueName, value) =>
5754
value == null ? value : validate(valueName, value),
5855
);
@@ -62,9 +59,9 @@ export function of(validate) {
6259
);
6360

6461
const contract = (...args) => {
65-
if (args.length > 1) return validate(args[0], args[1]);
62+
if (args.length > 1) return validate((args[0]: any), args[1]);
6663

67-
const result = value => validate(args[0], value);
64+
const result = value => validate((args[0]: any), value);
6865

6966
result.maybe = maybe(args[0]);
7067
result.optional = optional(args[0]);
@@ -88,5 +85,5 @@ export function of(validate) {
8885
contract.mapResult = mapResult;
8986
contract.match = match;
9087

91-
return contract;
88+
return (contract: any);
9289
}

0 commit comments

Comments
 (0)