Skip to content

Export private isMergeableObject #67

@benjamin-stern

Description

@benjamin-stern

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Export the private function isMergeableObject so that it can be easily extended when adding functionality?

There is also no documentation indicating the behavior that it's being overwritten and what the base configuration is meant to do.

so instead of defining:

const customDeepMergeOptions: Options = {
    isMergeableObject: function newIsMergeableObject(value): boolean {
        // Default Logic from the Base Options it's not inheritable.
        return typeof value === 'object' && value !== null && !(value instanceof RegExp) && !(value instanceof Date)
            // Custom Overrides
            && !(value instanceof FormData);
    }
}

it can be defined like so getting any future changes to the functionality:

import deepmerge, { Options,  isMergeableObject} from "deepmerge";
const customDeepMergeOptions: Options = {
    isMergeableObject: function newIsMergeableObject(value): boolean {
        // Default Logic .
        return isMergeableObject(value) 
            // Custom Overrides
            && !(value instanceof FormData);
    }
}

Motivation

No response

Example

No response

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