MCPcopy
hub / github.com/dream-num/univer / getObjectValue

Function getObjectValue

packages/engine-formula/src/functions/util.ts:32–48  ·  view source on GitHub ↗
(result: FunctionVariantType, isUseStrip: boolean = false)

Source from the content-addressed store, hash-verified

30}
31
32export function getObjectValue(result: FunctionVariantType, isUseStrip: boolean = false) {
33 if (result.isReferenceObject()) {
34 const arrayValue = (result as BaseReferenceObject).toArrayValueObject().toValue();
35
36 return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
37 } else if (result.isArray()) {
38 const arrayValue = (result as ArrayValueObject).toValue();
39
40 return isUseStrip ? stripArrayValue(arrayValue) : arrayValue;
41 } else if ((result as BaseValueObject).isNumber()) {
42 const value = (result as BaseValueObject).getValue() as number;
43
44 return isUseStrip ? stripErrorMargin(value) : value;
45 }
46
47 return (result as BaseValueObject).getValue();
48}

Calls 8

stripErrorMarginFunction · 0.90
toValueMethod · 0.80
stripArrayValueFunction · 0.70
getValueMethod · 0.65
isReferenceObjectMethod · 0.45
toArrayValueObjectMethod · 0.45
isArrayMethod · 0.45
isNumberMethod · 0.45

Tested by 1

calculateFunction · 0.72