Skip to content

Commit

Permalink
fix: upgrading dependencies and fixing types for them
Browse files Browse the repository at this point in the history
  • Loading branch information
eturino committed Apr 29, 2021
1 parent 1242e4b commit 5ce2be0
Show file tree
Hide file tree
Showing 6 changed files with 571 additions and 544 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"trash-cli": "^4.0.0",
"ts-enum-util": "^4.0.2",
"ts-jest": "^26.1.0",
"ts-loader": "^8.0.6",
"ts-loader": "^9.1.1",
"ts-node": "^9.0.0",
"tslint": "^6.1.1",
"tslint-config-prettier": "^1.18.0",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/key-set/all-except-some.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class KeySetAllExceptSome<T extends Key> extends KeySetByKeys<T> {
return new KeySetAllExceptSome([...this.keys]);
}

if (other instanceof KeySetNone) return new KeySetNone();
if (other instanceof KeySetNone) return new KeySetNone<T>();

const otherKeys = other.keys as T[];

Expand Down
8 changes: 4 additions & 4 deletions src/lib/key-set/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export class KeySetAll<T extends Key = Key> extends KeySetGlobal<T> {
public remove(other: KeySet<T> | KeySetGlobal<Key>): KeySet<T> {
if (other instanceof KeySetSome) return new KeySetAllExceptSome(other.keys);
if (other instanceof KeySetAllExceptSome) return new KeySetSome(other.keys);
if (other instanceof KeySetAll) return new KeySetNone();
if (other instanceof KeySetAll) return new KeySetNone<T>();

return new KeySetAll();
return new KeySetAll<T>();
}

public intersect(other: KeySetAll<T> | KeySetAll<Key>): KeySetAll<T>;
Expand All @@ -63,8 +63,8 @@ export class KeySetAll<T extends Key = Key> extends KeySetGlobal<T> {
public intersect(other: KeySetAllExceptSome<T>): KeySetAllExceptSome<T>;
public intersect(other: KeySet<T> | KeySetGlobal<Key>): KeySet<T>;
public intersect(other: KeySet<T> | KeySetGlobal<Key>): KeySet<T> {
if (other instanceof KeySetAll) return new KeySetAll();
if (other instanceof KeySetNone) return new KeySetNone();
if (other instanceof KeySetAll) return new KeySetAll<T>();
if (other instanceof KeySetNone) return new KeySetNone<T>();
if (other instanceof KeySetSome) return new KeySetSome(other.keys);
if (other instanceof KeySetAllExceptSome) {
return new KeySetAllExceptSome(other.keys);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/key-set/none.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export class KeySetNone<T extends Key = Key> extends KeySetGlobal<T> {
public union(other: KeySetAllExceptSome<T>): KeySetAllExceptSome<T>;
public union(other: KeySet<T> | KeySetGlobal<Key>): KeySet<T>;
public union(other: KeySet<T> | KeySetGlobal<Key>): KeySet<T> {
if (other instanceof KeySetAll) return new KeySetAll();
if (other instanceof KeySetNone) return new KeySetNone();
if (other instanceof KeySetAll) return new KeySetAll<T>();
if (other instanceof KeySetNone) return new KeySetNone<T>();
if (other instanceof KeySetSome) return new KeySetSome([...other.elements]);
if (other instanceof KeySetAllExceptSome) return new KeySetAllExceptSome([...other.elements]);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/key-set/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export function parseKeySet<T extends Key>(x: KeySetSerialized<T> | KeySet<T>):
throw new InvalidKeySetError(`keySetSerialized expected, given ${JSON.stringify(x)}`);
}

if (x.type === KeySetTypes.all) return all();
if (x.type === KeySetTypes.none) return none();
if (x.type === KeySetTypes.all) return all<T>();
if (x.type === KeySetTypes.none) return none<T>();
if (x.type === KeySetTypes.some) {
return some((x as KeySetSomeSerialized<T>).elements);
}
Expand Down
Loading

0 comments on commit 5ce2be0

Please sign in to comment.