API Reference
@univerjs
@univerjs/core
functions
Set

@univerjs/core v0.4.2Docs


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

submodules/univer/node_modules/.pnpm/@types+lodash@4.17.7/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

submodules/univer/node_modules/.pnpm/@types+lodash@4.17.7/node_modules/@types/lodash/common/object.d.ts:2267


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.