@univerjscorefunctionsSet

@univerjs/core v0.5.0-beta.1Docs


Function: set()

set(object, path, value)

function set<T>(
   object, 
   path, 
   value): T

Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for missing index properties while objects are created for all other missing properties. Use _.setWith to customize path creation.

Type Parameters

Type Parameter
T extends object

Parameters

ParameterTypeDescription
objectTThe object to modify.
pathPropertyPathThe path of the property to set.
valueanyThe value to set.

Returns

T

Returns object.

Defined in

packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:2263

set(object, path, value)

function set<TResult>(
   object, 
   path, 
   value): TResult

Type Parameters

Type Parameter
TResult

Parameters

ParameterType
objectobject
pathPropertyPath
valueany

Returns

TResult

See

_.set

Defined in

packages/api/tmp/univer-pro/node_modules/.pnpm/@types+lodash@4.17.13/node_modules/@types/lodash/common/object.d.ts:2267