Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
chore: update TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Reynolds authored and Thomas Reynolds committed Sep 17, 2021
1 parent adc837c commit 9ec08cc
Show file tree
Hide file tree
Showing 7 changed files with 2,178 additions and 2,975 deletions.
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion src/__tests__/try.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ describe("PIITry", () => {
throw new Error("Error message")
})
} catch (e) {
expect(unwrap(e).message).toBe("Error message")
if (e instanceof Error) {
expect(unwrap(e).message).toBe("Error message")
}
}
})
})
7 changes: 4 additions & 3 deletions src/mapMap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default <K extends any, V extends any, T extends any, U extends any>(
fn: (a: K | V) => T | U,
) => (map: Map<K, V>) =>
new Map(Array.from(map).map(([k, v]) => [fn(k), fn(v)]))
fn: (a: K | V) => T | U,
) =>
(map: Map<K, V>) =>
new Map(Array.from(map).map(([k, v]) => [fn(k), fn(v)]))
13 changes: 6 additions & 7 deletions src/mapRecord.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export default <T extends any, U extends any>(fn: (a: T) => U) => (
record: Record<string, T>,
) =>
Object.keys(record).reduce((sum, key) => {
sum[key] = fn(record[key])
return sum
}, {} as Record<string, U>)
export default <T extends any, U extends any>(fn: (a: T) => U) =>
(record: Record<string, T>) =>
Object.keys(record).reduce((sum, key) => {
sum[key] = fn(record[key])
return sum
}, {} as Record<string, U>)
6 changes: 3 additions & 3 deletions src/mapSet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default <T extends any, U extends any>(fn: (a: T) => U) => (
set: Set<T>,
) => new Set(Array.from(set).map(x => fn(x)))
export default <T extends any, U extends any>(fn: (a: T) => U) =>
(set: Set<T>) =>
new Set(Array.from(set).map(x => fn(x)))
5,123 changes: 2,162 additions & 2,961 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 9ec08cc

Please sign in to comment.