Skip to content
On this page

withDefaultObject

Assignment with default object value.

Usage

ts
import { withDefaultObject } from '@use-kit/functions'

const ret = withDefaultObject({ x: 1 }, { x: 0, y: 0 })
// ret: { x: 1, y: 0 }
import { withDefaultObject } from '@use-kit/functions'

const ret = withDefaultObject({ x: 1 }, { x: 0, y: 0 })
// ret: { x: 1, y: 0 }

Released under the MIT License.