From 76f0b0b35f2bd07b8b036b7e3c50f7c1ef3a4b13 Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Wed, 10 Feb 2021 10:48:24 +0200 Subject: [PATCH] chore(moduleExec): clean up _opts use, remove import --- src/lib/moduleExec.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/moduleExec.ts b/src/lib/moduleExec.ts index a0c57ef9..67fefa25 100644 --- a/src/lib/moduleExec.ts +++ b/src/lib/moduleExec.ts @@ -17,7 +17,6 @@ import validateAndCoerceTypes from './validateAndCoerceTypes'; import csv2json from './csv2json'; -import _opts from './options'; interface TransformFunc { // The consuming module itself will have a stricter return type. @@ -107,7 +106,7 @@ export default async function moduleExec(this: ThisWithFetch, opts: ModuleExecOp type: 'options', object: queryOpts.overrides ?? {}, schemaKey: queryOpts.schemaKey, - options: this._opts ? this._opts.validation : _opts.validation + options: this._opts.validation, }); let queryOptions = { @@ -142,9 +141,9 @@ export default async function moduleExec(this: ThisWithFetch, opts: ModuleExecOp || moduleOpts.validateResult === true; const validationOpts = { - ...(this._opts ? this._opts.validation : _opts.validation), + ...this._opts.validation, // Set logErrors=false if validateResult=false - logErrors: validateResult ? this._opts?.validation?.logErrors : false, + logErrors: validateResult ? this._opts.validation.logErrors : false, }; /*