MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / parse_js_func

Function parse_js_func

webiojs/src/models/datatable.ts:152–168  ·  view source on GitHub ↗
(object: any, js_func_key: string)

Source from the content-addressed store, hash-verified

150}
151
152function parse_js_func(object: any, js_func_key: string) {
153 return JSON.parse(JSON.stringify(object), (key, value) => {
154 if (
155 typeof value === 'object' &&
156 value.__pywebio_js_function__ === js_func_key &&
157 'params' in value && 'body' in value
158 ) {
159 try {
160 return new Function(...value.params, value.body);
161 } catch (e) {
162 console.error("Parse js function error: %s", e);
163 return null;
164 }
165 }
166 return value;
167 })
168}
169
170function safe_run(func_name: string, func: any, ...args: any[]) {
171 try {

Callers 1

datatable.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…