aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Scripting.ts
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-10-03 02:47:23 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-10-03 02:47:23 -0400
commitb21d8cc9d1b25ccd2e0103f47ad132dd6f04612d (patch)
treede6de9f556dd647f132a1f707a93c77a38946f1c /src/client/util/Scripting.ts
parentb013de245c77e40487e9842650239eff20c0e361 (diff)
parent7af6d22556467c115809222db77d4056b42f390f (diff)
Merge branch 'nathan-starter' of https://github.com/brown-dash/Dash-Web into nathan-starter
Diffstat (limited to 'src/client/util/Scripting.ts')
-rw-r--r--src/client/util/Scripting.ts5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts
index e00d71555..3ba3ff4b5 100644
--- a/src/client/util/Scripting.ts
+++ b/src/client/util/Scripting.ts
@@ -60,7 +60,6 @@ function Run(script: string | undefined, customParams: string[], diagnostics: ts
// let params: any[] = [Docs, ...fieldTypes];
const compiledFunction = (() => {
try {
- // eslint-disable-next-line no-new-func
return new Function(...paramNames, `return ${script}`);
} catch (e) {
console.log(e);
@@ -69,10 +68,8 @@ function Run(script: string | undefined, customParams: string[], diagnostics: ts
})();
if (!compiledFunction) return { compiled: false, errors };
const { capturedVariables = {} } = options;
- // eslint-disable-next-line default-param-last
const run = (args: { [name: string]: unknown } = {}, onError?: (e: string) => void, errorVal?: ts.Diagnostic): ScriptResult => {
const argsArray: unknown[] = [];
- // eslint-disable-next-line no-restricted-syntax
for (const name of customParams) {
if (name !== 'this') {
argsArray.push(name in args ? args[name] : capturedVariables[name]);
@@ -228,7 +225,6 @@ export function CompileScript(script: string, options: ScriptOptions = {}): Comp
if ('this' in params || 'this' in capturedVariables) {
paramNames.push('this');
}
- // eslint-disable-next-line no-restricted-syntax
for (const key in params) {
if (key !== 'this') {
paramNames.push(key);
@@ -238,7 +234,6 @@ export function CompileScript(script: string, options: ScriptOptions = {}): Comp
const val = params[key];
return `${key}: ${val}`;
});
- // eslint-disable-next-line no-restricted-syntax
for (const key in capturedVariables) {
if (key !== 'this') {
const val = capturedVariables[key];