MCPcopy
hub / github.com/baidu/amis / regFunc

Function regFunc

packages/office-viewer/src/excel/formula/functions/functions.ts:10–15  ·  view source on GitHub ↗
(name: FunctionName, func: Func)

Source from the content-addressed store, hash-verified

8export const functions: Map<FunctionName, Func> = new Map();
9
10export function regFunc(name: FunctionName, func: Func) {
11 if (functions.has(name)) {
12 throw new Error(`function ${name} has been registered`);
13 }
14 functions.set(name, func);
15}
16
17// 这些函数每次计算结果都不一样,不能缓存
18const volatileFunctions = new Set(['RAND', 'RANDBETWEEN', 'NOW', 'TODAY']);

Callers 12

text.tsFile · 0.90
date.tsFile · 0.90
financial.tsFile · 0.90
distribution.tsFile · 0.90
engineering.tsFile · 0.90
information.tsFile · 0.90
math.tsFile · 0.90
statistical.tsFile · 0.90
reference.tsFile · 0.90
trigonometry.tsFile · 0.90
logical.tsFile · 0.90
database.tsFile · 0.90

Calls 2

hasMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected