Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ObjectSetOptions

Hierarchy

Index

Properties

Methods

Properties

concat?: boolean

If true, then a new value will be concatenated with the old

example
const obj = {a: {b: 1}};
Object.set(obj, 'a.b', 2, {concat: true})
console.log(obj); // [1, 2]
separator?: string

Character to declare the path

example
Object.get({a: {b: 1}}, 'a:b', {separator: ':'})

Methods

  • setter(obj: unknown, key: unknown, value: unknown): any
  • setter(obj: unknown, key: unknown, value: unknown): any
  • Function to set a value

    Parameters

    • obj: unknown
    • key: unknown
    • value: unknown

    Returns any

  • Function to set a value

    Parameters

    • obj: unknown
    • key: unknown
    • value: unknown

    Returns any