Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fastify/deepmerge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.2
Choose a base ref
...
head repository: fastify/deepmerge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 5 commits
  • 4 files changed
  • 3 contributors

Commits on Feb 3, 2025

  1. chore: rename master to main (#66)

    Fdawgs authored Feb 3, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    6edd80a View commit details

Commits on Feb 6, 2025

  1. Typing: add cloneProtoObject option to Options interface (#69)

    * chore: bump version to 2.0.3 and add cloneProtoObject option to Options interface
    
    * Removed Extra Space
    
    * Only typings documentation change shouldn't have a version bump.
    
    ---------
    
    Co-authored-by: bnns <benjamin@greetingsisland.com>
    benjamin-stern and bnns authored Feb 6, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    327bec0 View commit details

Commits on Mar 7, 2025

  1. ci(ci): set job permissions (#71)

    Fdawgs authored Mar 7, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d4b6ba3 View commit details

Commits on Mar 9, 2025

  1. ci(ci): drop node 16 and 18 (#70)

    Fdawgs authored Mar 9, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    858fd71 View commit details
  2. 3.0.0

    Fdawgs committed Mar 9, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    61a299f View commit details
Showing with 13 additions and 4 deletions.
  1. +3 −2 .github/workflows/ci.yml
  2. +1 −1 README.md
  3. +1 −1 package.json
  4. +8 −0 types/index.d.ts
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master
- next
- 'v*'
paths-ignore:
@@ -17,8 +16,10 @@ on:

jobs:
test:
permissions:
contents: write
pull-requests: write
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
with:
license-check: true
lint: true
node-versions: '["16", "18", "20", "22"]'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @fastify/deepmerge

[![CI](https://github.com/fastify/deepmerge/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/deepmerge/actions/workflows/ci.yml)
[![CI](https://github.com/fastify/deepmerge/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/deepmerge/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/@fastify/deepmerge.svg?style=flat)](https://www.npmjs.com/package/@fastify/deepmerge)
[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fastify/deepmerge",
"version": "2.0.2",
"version": "3.0.0",
"description": "Merges the enumerable properties of two or more objects deeply.",
"main": "index.js",
"type": "commonjs",
8 changes: 8 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -61,9 +61,17 @@ type MergeArrayFnOptions = {
getKeys: (value: object) => string[];
}

/**
* A function responsible handling the cloning logic of the provided prototype object.
*
* @param value - The proto object to clone.
* @returns the resulting clone (can also return the object itself if you do not want clone but replace).
*/
type CloneProtoObjectFn = (value: any) => any
type MergeArrayFn = (options: MergeArrayFnOptions) => (target: any[], source: any[]) => any[]

interface Options {
cloneProtoObject?: CloneProtoObjectFn;
mergeArray?: MergeArrayFn;
symbols?: boolean;
all?: boolean;