Skip to content

Commit a32fbb6

Browse files
committed
chore: upgrade to typescript 3.5.3
1 parent 161b657 commit a32fbb6

File tree

14 files changed

+24
-87
lines changed

14 files changed

+24
-87
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"sinon": "^7.2.4",
5656
"stylelint-config-palantir": "^3.1.1",
5757
"stylelint-scss": "^3.8.0",
58-
"typescript": "~3.2.4",
58+
"typescript": "~3.5.3",
5959
"yarn-deduplicate": "^1.1.1"
6060
},
6161
"resolutions": {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"react-dom": "^16.2.0",
6868
"react-test-renderer": "^16.2.0",
6969
"sass-inline-svg": "^1.2.0",
70-
"typescript": "~3.2.4",
70+
"typescript": "~3.5.3",
7171
"webpack-cli": "^3.1.2"
7272
},
7373
"repository": {

packages/core/src/common/utils/compareUtils.ts

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,6 @@ export function deepCompareKeys(objA: any, objB: any, keys?: Array<string | numb
9595
}
9696
}
9797

98-
/**
99-
* Returns a descriptive object for each key whose values are shallowly unequal
100-
* between two provided objects. Useful for debugging shouldComponentUpdate.
101-
*/
102-
export function getShallowUnequalKeyValues<T extends object>(
103-
objA: T,
104-
objB: T,
105-
keys?: IKeyBlacklist<T> | IKeyWhitelist<T>,
106-
) {
107-
// default param values let null values pass through, so we have to take
108-
// this more thorough approach
109-
const definedObjA = objA == null ? {} : objA;
110-
const definedObjB = objB == null ? {} : objB;
111-
112-
const filteredKeys = _filterKeys(definedObjA, definedObjB, keys == null ? { exclude: [] } : keys);
113-
return _getUnequalKeyValues(definedObjA, definedObjB, filteredKeys, (a, b, key) => {
114-
return shallowCompareKeys(a, b, { include: [key] });
115-
});
116-
}
117-
11898
/**
11999
* Returns a descriptive object for each key whose values are deeply unequal
120100
* between two provided objects. Useful for debugging shouldComponentUpdate.
@@ -158,7 +138,7 @@ function _isSimplePrimitiveType(value: any) {
158138
function _filterKeys<T>(objA: T, objB: T, keys: IKeyBlacklist<T> | IKeyWhitelist<T>) {
159139
if (_isWhitelist(keys)) {
160140
return keys.include;
161-
} else {
141+
} else if (_isBlacklist(keys)) {
162142
const keysA = Object.keys(objA);
163143
const keysB = Object.keys(objB);
164144

@@ -171,12 +151,18 @@ function _filterKeys<T>(objA: T, objB: T, keys: IKeyBlacklist<T> | IKeyWhitelist
171151
// return the remaining keys as an array
172152
return Object.keys(keySet) as Array<keyof T>;
173153
}
154+
155+
return [];
174156
}
175157

176158
function _isWhitelist<T>(keys: any): keys is IKeyWhitelist<T> {
177159
return keys != null && (keys as IKeyWhitelist<T>).include != null;
178160
}
179161

162+
function _isBlacklist<T>(keys: any): keys is IKeyBlacklist<T> {
163+
return keys != null && (keys as IKeyBlacklist<T>).exclude != null;
164+
}
165+
180166
function _arrayToObject(arr: any[]) {
181167
return arr.reduce((obj: any, element: any) => {
182168
obj[element] = true;

packages/core/test/common/utils/compareUtilsTests.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -269,60 +269,6 @@ describe("CompareUtils", () => {
269269
});
270270
});
271271

272-
describe("getShallowUnequalKeyValues", () => {
273-
describe("with `keys` defined as whitelist", () => {
274-
describe("returns empty array if the specified values are shallowly equal", () => {
275-
runTest([], { a: 1, b: [1, 2, 3], c: "3" }, { b: [1, 2, 3], a: 1, c: "3" }, wl(["a", "c"]));
276-
});
277-
278-
describe("returns unequal key/values if any specified values are not shallowly equal", () => {
279-
// identical objects, but different instances
280-
runTest(
281-
[{ key: "a", valueA: [1, "2", true], valueB: [1, "2", true] }],
282-
{ a: [1, "2", true] },
283-
{ a: [1, "2", true] },
284-
wl(["a"]),
285-
);
286-
// different primitive-type values
287-
runTest([{ key: "a", valueA: 1, valueB: 2 }], { a: 1 }, { a: 2 }, wl(["a"]));
288-
});
289-
});
290-
291-
describe("with `keys` defined as blacklist", () => {
292-
describe("returns empty array if the specified values are shallowly equal", () => {
293-
runTest([], { a: 1, b: [1, 2, 3], c: "3" }, { b: [1, 2, 3], a: 1, c: "3" }, bl(["b"]));
294-
});
295-
296-
describe("returns unequal keys/values if any specified values are not shallowly equal", () => {
297-
runTest(
298-
[{ key: "a", valueA: [1, "2", true], valueB: [1, "2", true] }],
299-
{ a: [1, "2", true] },
300-
{ a: [1, "2", true] },
301-
bl(["b", "c"]),
302-
);
303-
runTest([{ key: "a", valueA: 1, valueB: 2 }], { a: 1 }, { a: 2 }, bl(["b"]));
304-
});
305-
});
306-
307-
describe("with `keys` not defined", () => {
308-
describe("returns empty array if values are shallowly equal", () => {
309-
runTest([], { a: 1, b: "2", c: true }, { a: 1, b: "2", c: true });
310-
runTest([], undefined, undefined);
311-
runTest([], null, undefined);
312-
});
313-
314-
describe("returns unequal key/values if any specified values are not shallowly equal", () => {
315-
runTest([{ key: "a", valueA: 1, valueB: 2 }], { a: 1 }, { a: 2 });
316-
});
317-
});
318-
319-
function runTest(expectedResult: any[], a: any, b: any, keys?: IKeyBlacklist<IKeys> | IKeyWhitelist<IKeys>) {
320-
it(getCompareTestDescription(a, b, keys), () => {
321-
expect(CompareUtils.getShallowUnequalKeyValues(a, b, keys)).to.deep.equal(expectedResult);
322-
});
323-
}
324-
});
325-
326272
describe("getDeepUnequalKeyValues", () => {
327273
describe("with `keys` defined", () => {
328274
describe("returns empty array if only the specified values are deeply equal", () => {

packages/datetime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"react": "^16.2.0",
5252
"react-dom": "^16.2.0",
5353
"react-test-renderer": "^16.2.0",
54-
"typescript": "~3.2.4",
54+
"typescript": "~3.5.3",
5555
"webpack-cli": "^3.1.2"
5656
},
5757
"repository": {

packages/docs-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"npm-run-all": "^4.1.5",
4444
"react": "^16.2.0",
4545
"react-dom": "^16.2.0",
46-
"typescript": "~3.2.4",
46+
"typescript": "~3.5.3",
4747
"webpack-cli": "^3.3.0"
4848
},
4949
"repository": {

packages/icons/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"react": "^16.2.0",
4848
"react-dom": "^16.2.0",
4949
"react-test-renderer": "^16.2.0",
50-
"typescript": "~3.2.4",
50+
"typescript": "~3.5.3",
5151
"webpack-cli": "^3.1.2"
5252
},
5353
"repository": {

packages/labs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"react": "^16.2.0",
5050
"react-dom": "^16.2.0",
5151
"react-test-renderer": "^16.2.0",
52-
"typescript": "~3.2.4",
52+
"typescript": "~3.5.3",
5353
"webpack-cli": "^3.1.2"
5454
},
5555
"repository": {

packages/node-build-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"stylelint-junit-formatter": "^0.2.1",
2727
"svgo": "^1.2.2",
2828
"tslint": "^5.12.1",
29-
"typescript": "~3.2.4"
29+
"typescript": "~3.5.3"
3030
},
3131
"repository": {
3232
"type": "git",

packages/select/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"react": "^16.2.0",
5050
"react-dom": "^16.2.0",
5151
"react-test-renderer": "^16.2.0",
52-
"typescript": "~3.2.4",
52+
"typescript": "~3.5.3",
5353
"webpack-cli": "^3.1.2"
5454
},
5555
"repository": {

0 commit comments

Comments
 (0)