Skip to content

Commit

Permalink
Revert "Fixed 34 solution"
Browse files Browse the repository at this point in the history
This reverts commit 7ac23db.
  • Loading branch information
mattpocock committed Aug 7, 2023
1 parent 7ac23db commit e2ab313
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"cross-fetch": "^3.1.5",
"jsdom": "^21.1.1",
"prettier": "^2.8.7",
"typescript": "^5.1.6",
"typescript": "^5.0.3",
"vite-tsconfig-paths": "^4.0.7",
"vitest": "^0.31.1"
},
Expand Down Expand Up @@ -107,4 +107,4 @@
"dependencies": {
"ts-toolbelt": "^9.6.0"
}
}
}
8 changes: 4 additions & 4 deletions src/06-challenges/34-internationalization.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ type GetParamKeysAsUnion<TTranslation extends string> =
const translate = <
TTranslations extends Record<string, string>,
TKey extends keyof TTranslations,
TDynamicKeys = GetParamKeysAsUnion<TTranslations[TKey]>,
TDynamicKeys = GetParamKeysAsUnion<TTranslations[TKey]>
>(
translations: TTranslations,
key: TKey,
...args: [TDynamicKeys] extends [never]
? []
: [dynamicArgs: Record<TDynamicKeys & string, string>]
...args: TDynamicKeys extends string
? [dynamicArgs: Record<TDynamicKeys, string>]
: []
) => {
const translation = translations[key];
const params: any = args[0] || {};
Expand Down

0 comments on commit e2ab313

Please sign in to comment.