Skip to content

v6.0.0

Compare
Choose a tag to compare
@pi0 pi0 released this 21 Mar 13:53
· 81 commits to main since this release

⚠ BREAKING CHANGES

  • When merging arrays, defaults are last in order:
defu(['a', 'b'], ['c', 'd'])

// With v6+
['a', 'b', 'c', 'd']

// Before
['c', 'd', 'a', 'b']
  • Using named exports instead of the default export

Before:

// With v6+
import { defu } from 'defu'
const { defu } = require('defu')

// Before
import defu from 'defu'
const defu = require('defu')

Other utilities are also exported as named exports to be tree-shakable:

// instead of defu.fn
import { defuFn } from 'defu'

// Instead of defu.arrayFn
import { defuArrayFn } from 'defu'

// Instead of defu.extend
import { createDefu } from 'defu'

Features

  • concat array defaults to the last (f6df314)
  • use named exports (4a8fc52)