Skip to content

renameAll deleting keys #38

@jesspoemape

Description

@jesspoemape

Take the following:

const originalObject = {
  title: 'My Title',
  flavor: 'bbq',
  latestTitle: 'hahahahahaha (business)',
}

renameAll({
  latestTitle: 'title',
  title: 'updatedTitle',
})(originalObject)

Expected Result:

{
  flavor: "bbq", 
  title: "hahahahahaha (business)",
  updatedTitle: "My Title",
}

Actual Result:

{
  flavor: "bbq",
  updatedTitle: "hahahahahaha (business)",
}

I believe this is happening because of this line that deletes the item from the original object.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions