Lines 62-102javascript
62 if (cached) return cached;
64 const response = await DataFetcher.adapter.fetch({
68 body: 'POST' === method ? params : void 0
70 if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
71 let data = response.data;
72 if ('transform' in source && source.transform) data = DataFetcher.applyTransform(source.transform, data, formValues);
73 DataFetcher.setCache(cacheKey, data);
76 console.error('Data fetch error:', error);
80 static fetchComputed(source, formValues) {
81 const dependencyValues = source.dependency.map((dep)=>get(formValues, dep));
83 const computeFn = new Function(...source.dependency, `return ${source.compute}`);
84 return computeFn(...dependencyValues);
LowEval
Package source references a known benign dynamic code generation pattern.
dist/components/forms/data-fetcher.jsView on unpkg · L82 86 console.error('Computed value error:', error);
90 static resolveParams(params, formValues) {
92 for (const [key, value] of Object.entries(params))if ('string' == typeof value && value.startsWith('$')) {
93 const fieldPath = value.slice(1);
94 resolved[key] = get(formValues, fieldPath);
95 } else resolved[key] = value;
98 static applyTransform(transform, data, formValues) {
100 const transformFn = new Function('data', 'formValues', `return ${transform}`);
101 return transformFn(data, formValues);