lodash.merge
can Bypass Type Check in Typescript
#48950
Labels
External
Relates to another program, environment, or user action which we cannot control.
Bug Report
π Search Terms
lodash+merge
π Version & Regression Information
4.x ( haven't tried any older versions )
node_modules
folderβ― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Surprisingly, this code can compile without errors. This means we can use
lodash.merge
to assign some optional fields with the wrong type, thus bypassing the type check in typescriptπ Expected behavior
I expect the code will compile error, indicating that the
opt
field cannot assign with a number typeThe text was updated successfully, but these errors were encountered: