Skip to content

Deep ignore #4

@miedzikd

Description

@miedzikd

Hi :)

at the beginning I wanted to write that I love your library and after searching dozens of others, I think yours is the best :)
I wanted to write down some ideas that I think can make your library even better :)

The first is: deep ignore ...
What do you think about adding a value with 'dot' to the 'ignore' option? e.g.:

  • ["address.street"]
  • ["friends.*.familyName"]
    ?

Extended example from your docs:

import { Audit } from "entity-diff";
 
  const before = {
    name: "Mason",
    age: 20,
    address: {
      city: "NY",
      street: "Fake Street 1"
    },
    friends: [
      {
        givenName: "Joe",
        familyName: "Doe"
      }
    ]
  };
 
  const after = {
    name: "Mason Floyd", // this change will be ignored
    age: 25,
    address: {
      city: "WA",
      street: "Fake Street 2" // this change will be ignored
    },
    friends: [
      {
        givenName: "Foo",
        familyName: "Bar" // this change will be ignored
      }
    ]
  };
 
  const ignore = ["name", "address.street", "friends.*.familyName"]; 

Greetings from Poland :)
Daniel

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