refactor(scripting-revamp): migrate js-sandbox to web worker/Node vm based implementation (#3619)
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { runPreRequestScript } from "@hoppscotch/js-sandbox"
|
||||
import * as E from "fp-ts/Either"
|
||||
import { runPreRequestScript } from "@hoppscotch/js-sandbox/web"
|
||||
import { Environment } from "@hoppscotch/data"
|
||||
import { cloneDeep } from "lodash-es"
|
||||
|
||||
import {
|
||||
getCurrentEnvironment,
|
||||
getGlobalVariables,
|
||||
} from "~/newstore/environments"
|
||||
import { TestResult } from "@hoppscotch/js-sandbox"
|
||||
|
||||
export const getCombinedEnvVariables = () => ({
|
||||
global: cloneDeep(getGlobalVariables()),
|
||||
@@ -17,4 +20,5 @@ export const getFinalEnvsFromPreRequest = (
|
||||
global: Environment["variables"]
|
||||
selected: Environment["variables"]
|
||||
}
|
||||
) => runPreRequestScript(script, envs)
|
||||
): Promise<E.Either<string, TestResult["envs"]>> =>
|
||||
runPreRequestScript(script, envs)
|
||||
|
||||
Reference in New Issue
Block a user