Function setObjValueByPath
- setObjValueByPath<T, P, S, NO_START, Path>(obj: T, path: TransferPathOf<T, P, S, DotTrim<RemoveStrStart<P, S>>, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, PathOf<T, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, "">>, value: TypeOfPath<T, Path>, onExist?: SetObjValueByPathOnExist, objName??: S): T
-
Type Parameters
-
T extends object
-
P extends string
-
S extends string = ""
-
NO_START extends string = DotTrim<RemoveStrStart<P, S>>
-
Path extends string = TransferPath<NO_START, DotTrim<NO_START>>
Parameters
-
obj: T
-
path: TransferPathOf<T, P, S, DotTrim<RemoveStrStart<P, S>>, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, PathOf<T, TransferPath<DotTrim<RemoveStrStart<P, S>>, DotTrim<DotTrim<RemoveStrStart<P, S>>>>, "">>
-
value: TypeOfPath<T, Path>
-
onExist: SetObjValueByPathOnExist = ...
-
Optional
objName: S = ...
Returns T
通过object路径设置值 如果路径中不存在则会自动创建对应的对象
Example