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
applyDefaults = (source, defaults) -> | |
### | |
# Recursively applies defaults to the source object | |
### | |
#The Mandatory safety checks | |
return source if not source? | |
return defaults if not defaults? | |
#First fill the results with defaults of each proprerty, recursively | |
result = {} | |
for prop of defaults |
NewerOlder