Skip to content

Commit

Permalink
chore(moduleExec): clean up _opts use, remove import
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Feb 10, 2021
1 parent 5726e6b commit 76f0b0b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/moduleExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
};

/*
Expand Down

0 comments on commit 76f0b0b

Please sign in to comment.