Created
February 3, 2021 08:54
-
-
Save lordlycastle/5d90a1dbfccee8e0d3db43d4d3f48cfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function propertyOverwriteToOverwriteFunction1<T>( | |
overwrite: DeepPartial<T> | |
): (defaultData: T) => T { | |
return defaultData => lodash.merge({}, defaultData, overwrite); | |
} | |
function propertyOverwriteToOverwriteFunction2<T>( | |
overwrite: T | |
): <A extends T>(defaultData: A) => A { | |
return defaultData => lodash.merge({}, defaultData, overwrite); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment