Skip to content

delete(key, path) sets value to 'undefined' instead of removing property #149

Description

@BENx2115

When using enmap.delete(key, path), the property at the given path is not actually deleted.
Instead, its value is replaced with undefined.

This causes the key to still exist in the object, which is unexpected behavior for a delete operation.

Example

enmap.set("user", {
  name: "Ben",
  age: 25
});

enmap.delete("user", "age");

console.log(enmap.get("user"));

Current Result

{
  name: "Ben",
  age: undefined
}

Expected Result

{
  name: "Ben"
}
  • Enmap version: 6.1.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions