Skip to content

Commit

Permalink
fix: passing in string instead of object by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
BelfordZ committed Jan 16, 2020
1 parent 9f81534 commit 797a759
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const languageFilenameMap: any = {

export default async (generatorOptions: IGeneratorOptions) => {
const { openrpcDocument, outDir } = generatorOptions;
let dereffedDocument;
let dereffedDocument: OpenRPC;

try {
dereffedDocument = await parseOpenRPCDocument(openrpcDocument);
Expand All @@ -112,11 +112,14 @@ export default async (generatorOptions: IGeneratorOptions) => {
const methodTypings = new MethodTypings(dereffedDocument);

return Promise.all(["typescript", "rust"].map(async (language) => {
const compiledResult = compileTemplate(openrpcDocument, language, methodTypings);
const compiledResult = compileTemplate(dereffedDocument, language, methodTypings);

const destinationDirectoryName = `${outDir}/${language}`;
await copyStatic(destinationDirectoryName, language);
await postProcessStatic(destinationDirectoryName, generatorOptions, language);
await postProcessStatic(destinationDirectoryName, {
...generatorOptions,
openrpcDocument: dereffedDocument,
}, language);
await writeFile(`${destinationDirectoryName}/src/${languageFilenameMap[language]}`, compiledResult, "utf8");
}));
};

0 comments on commit 797a759

Please sign in to comment.