Skip to content

deepAssign does not support updating arrays using objects with numeric keys #99

@justinbmeyer

Description

@justinbmeyer

@RyanMilligan commented on Fri Jan 19 2018

How often can you reproduce it?

  • [ x ] Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description: deepAssign() does not support updating specific items in arrays by passing objects with an index of, for example, 1. Instead, it ignores the keys in the source object and updates the first N items in the array.

  1. JSBin: https://jsbin.com/suyowov/edit?js,console,output
  2. Open the console and run the script
  3. The third object output should show that "second" has changed to 2, but instead the 1 from the previous output has changed to 2

Actual results: Only the first item in the array can be edited in this way

Environment:

Software Version
can-define version 1.5.4
Browser Chrome Update 63
Operating system Windows 10 # #

@RyanMilligan commented on Fri Jan 19 2018

A proposed solution can be found here but I logged it here at the request of @phillipskevin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions