Comparing version 1.4.0-next.3 to 1.4.0-next.4
@@ -81,10 +81,6 @@ import { __awaiter } from "tslib"; | ||
]; | ||
let formatTypegen = null; | ||
if (typeof this.config.formatTypegen === 'function') { | ||
formatTypegen = this.config.formatTypegen; | ||
} | ||
else if (this.config.prettierConfig) { | ||
formatTypegen = typegenFormatPrettier(this.config.prettierConfig); | ||
} | ||
const content = typeof formatTypegen === 'function' ? yield formatTypegen(output, type) : output; | ||
const formattedOutput = typeof this.config.formatTypegen === 'function' ? yield this.config.formatTypegen(output, type) : output; | ||
const content = this.config.prettierConfig | ||
? yield typegenFormatPrettier(this.config.prettierConfig)(formattedOutput, type) | ||
: formattedOutput; | ||
const [toSave, existing] = yield Promise.all([content, readFile(filePath, 'utf8').catch(() => '')]); | ||
@@ -91,0 +87,0 @@ if (toSave !== existing) { |
@@ -84,10 +84,6 @@ "use strict"; | ||
]; | ||
let formatTypegen = null; | ||
if (typeof this.config.formatTypegen === 'function') { | ||
formatTypegen = this.config.formatTypegen; | ||
} | ||
else if (this.config.prettierConfig) { | ||
formatTypegen = (0, typegenFormatPrettier_1.typegenFormatPrettier)(this.config.prettierConfig); | ||
} | ||
const content = typeof formatTypegen === 'function' ? yield formatTypegen(output, type) : output; | ||
const formattedOutput = typeof this.config.formatTypegen === 'function' ? yield this.config.formatTypegen(output, type) : output; | ||
const content = this.config.prettierConfig | ||
? yield (0, typegenFormatPrettier_1.typegenFormatPrettier)(this.config.prettierConfig)(formattedOutput, type) | ||
: formattedOutput; | ||
const [toSave, existing] = yield Promise.all([content, readFile(filePath, 'utf8').catch(() => '')]); | ||
@@ -94,0 +90,0 @@ if (toSave !== existing) { |
{ | ||
"name": "nexus", | ||
"version": "1.4.0-next.3", | ||
"version": "1.4.0-next.4", | ||
"description": "Scalable, strongly typed GraphQL schema development", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,3 +8,3 @@ import { GraphQLSchema, lexicographicSortSchema, printSchema } from 'graphql' | ||
import { typegenAutoConfig } from './typegenAutoConfig' | ||
import { TypegenFormatFn, typegenFormatPrettier } from './typegenFormatPrettier' | ||
import { typegenFormatPrettier } from './typegenFormatPrettier' | ||
import { TypegenPrinter } from './typegenPrinter' | ||
@@ -91,9 +91,8 @@ | ||
] | ||
let formatTypegen: TypegenFormatFn | null = null | ||
if (typeof this.config.formatTypegen === 'function') { | ||
formatTypegen = this.config.formatTypegen | ||
} else if (this.config.prettierConfig) { | ||
formatTypegen = typegenFormatPrettier(this.config.prettierConfig) | ||
} | ||
const content = typeof formatTypegen === 'function' ? await formatTypegen(output, type) : output | ||
const formattedOutput = | ||
typeof this.config.formatTypegen === 'function' ? await this.config.formatTypegen(output, type) : output | ||
const content = this.config.prettierConfig | ||
? await typegenFormatPrettier(this.config.prettierConfig)(formattedOutput, type) | ||
: formattedOutput | ||
const [toSave, existing] = await Promise.all([content, readFile(filePath, 'utf8').catch(() => '')]) | ||
@@ -100,0 +99,0 @@ if (toSave !== existing) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2171826
34218