Skip to content

Commit

Permalink
fix(validation): load process only when defined during validation log…
Browse files Browse the repository at this point in the history
…ging (#50)
  • Loading branch information
advaiyalad committed Feb 21, 2021
1 parent 16eea3e commit 2f97923
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/validateAndCoerceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ ajv.addKeyword({
ajv.addSchema(schema);

/* istanbul ignore next */
const logObj = process?.stdout?.isTTY
? (obj: any) => console.dir(obj, { depth: 4, colors: true })
: (obj: any) => console.log(JSON.stringify(obj, null, 2));
const logObj =
typeof process !== "undefined" && process?.stdout?.isTTY
? (obj: any) => console.dir(obj, { depth: 4, colors: true })
: (obj: any) => console.log(JSON.stringify(obj, null, 2));

export function resolvePath(obj: any, dataPath: string) {
const path = dataPath.split("/");
Expand Down

0 comments on commit 2f97923

Please sign in to comment.