Files
ember-cli-dunlop/addon/utils/merge-objects.coffee
T
2017-12-21 11:42:41 +01:00

13 lines
519 B
CoffeeScript

# This is an objects merge helper but in stead of
# mergin into the first object, it merges into the last object.
# This is a lot safer and better in coffeescript environments, since the
# last argument is the indented subject(focus) of configuration.
# Since the attributes of these have prevalence, this merger comes last
# in the used Ember.assign
mergeObjects = (objects..., target) ->
result = {}
Ember.assign result, objects..., target
result
window.merge_objects = mergeObjects
export default mergeObjects