Sha256: 280322df7400aa99b6416a05140bed3cd643f802e4fff59658be663a4667fb13

Contents?: true

Size: 466 Bytes

Versions: 1

Compression:

Stored size: 466 Bytes

Contents

# Returns an object that contains only the attributes 
# that are different between obj_1 and obj_2.
# Only looks for changed attributes, not missing attributes.
modularity.object_diff = (obj_1, obj_2) ->
  result = {}
  for own key, value_2 of obj_2
    do (key, value_2) ->
      value_1 = obj_1[key]
      result[key] = value_2 if value_1 != value_2
  result


modularity.object_length = (obj) ->
  # NOTE(KG): This doesn't work in IE8.
  Object.keys(obj).length

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
modularity-rails-0.12.0 vendor/assets/javascripts/modularity/tools/object_tools.coffee