The translate function is typed to always return a string, which is incorrect. In the case of a partial path, it will return an object instead, as seen here.
Thus, code that uses and expects that functionality will not even compile in Typescript because of a type mismatch.
Example:
setTranslations({ foo: "bar", baz: { foo: "bar" } })
const baz = t("baz") // returns { foo: "bar" }
Object.assign(baz, fallback: "") // will bomb because of the incorrect type signature of translate
The translate function is typed to always return a string, which is incorrect. In the case of a partial path, it will return an object instead, as seen here.
Thus, code that uses and expects that functionality will not even compile in Typescript because of a type mismatch.
Example: