Skip to content

add filter/replacer fn option to stringify #203

@ashtonian

Description

@ashtonian

It would be nice to enable a generic fn that can be used to hack add customize use cases

function filterFunc(key, value) {
   if (key == 'b') {
       // Return an `undefined` value to omit a property.
       return;
   }
   if (key == 'e[f]') {
       return value.getTime();
   }
   if (key == 'e[g][0]') {
       return value * 2;
   }
   return value;
}

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