wankdanker / node-object-mapper

Copy properties from one object to another.
MIT License
276 stars 73 forks source link

Mark parameters toObject and propertyMap as optional #61

Closed hassanhe closed 4 years ago

hassanhe commented 4 years ago

When using objectMapper without propertyMap parameter in project with typescript or checkJs enabled as so

new objectMapper(fromObject,  toObject)

Compiler complaint about last parameter not provided:

{C4957CDB-3CCA-4CC5-B197-DA6A2DCE9940} png

Also from looking at the implementation toObject parameter is also optional so marking both as optional removes the type error

Maybe Also marking the function with @constructor is unnecessary as there is no using of this in the implementation and the function can be used without the word new

wankdanker commented 4 years ago

Thank you @hassangit. Your branch diverged, so I just make the changes manually. Thank you for the pull request. jsdoc updated in object-mapper@6.1.1.