@eddeee888/gcg-typescript-resolver-files
Version:
This [GraphQL Code Generator](https://www.the-guild.dev/graphql/codegen) plugin creates resolvers given GraphQL schema.
23 lines • 907 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeAddConfigPath = void 0;
const tslib_1 = require("tslib");
const path = tslib_1.__importStar(require("path"));
/**
* normalizeAddConfigPath
*
* Function to turn the add config keys into normalized path a.k.a. path from baseOutputDir
* This helps us detects targeted file being given in different formats e.g. './types.generated.ts' vs 'types.generated.ts'
*/
const normalizeAddConfigPath = ({ add, baseOutputDir, }) => {
if (!add) {
return undefined;
}
const normalizedPathAdd = Object.entries(add).reduce((res, [originalFilePath, config]) => {
res[path.posix.join(baseOutputDir, originalFilePath)] = config;
return res;
}, {});
return normalizedPathAdd;
};
exports.normalizeAddConfigPath = normalizeAddConfigPath;
//# sourceMappingURL=normalizeAddConfigPath.js.map
;