From f6a2fc7eabaa7eb6765d531c60bb61905387a4bf Mon Sep 17 00:00:00 2001 From: Ryan Dsouza Date: Mon, 6 Mar 2023 15:31:47 +0100 Subject: [PATCH] replace any with better inference --- package.json | 6 ++++-- .../19-generic-interfaces-with-functions.solution.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cd95a35..ab6e544 100644 --- a/package.json +++ b/package.json @@ -95,11 +95,13 @@ "e-33": "npm run exercise -- 33", "s-33": "npm run solution -- 33", "e-34": "npm run exercise -- 34", - "s-34": "npm run solution -- 34" + "s-34": "npm run solution -- 34", + "e-29.2": "npm run exercise -- 29.2", + "s-29.2": "npm run solution -- 29.2" }, "dependencies": { "cross-env": "^7.0.3", "fast-glob": "^3.2.12", "ts-toolbelt": "^9.6.0" } -} +} \ No newline at end of file diff --git a/src/04-generics-advanced/19-generic-interfaces-with-functions.solution.ts b/src/04-generics-advanced/19-generic-interfaces-with-functions.solution.ts index 8c4e126..b968c22 100644 --- a/src/04-generics-advanced/19-generic-interfaces-with-functions.solution.ts +++ b/src/04-generics-advanced/19-generic-interfaces-with-functions.solution.ts @@ -17,7 +17,7 @@ const createCache = (initialCache?: Record): Cache => { cache[key] = value; }, clone: (transform) => { - const newCache: Record = {}; + const newCache: Record> = {}; for (const key in cache) { newCache[key] = transform(cache[key]);