Skip to content

Commit

Permalink
Merge pull request #315 from GauBen/explicit-runtime-error
Browse files Browse the repository at this point in the history
fix(#314): added explicit runtime error
  • Loading branch information
aexol authored Sep 1, 2022
2 parents f3fa270 + 56a82da commit 5831d6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/TreeToTS/functions/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ export const ResolveFromPath = (props: AllTypesPropsType, returns: ReturnTypesTy
const oKey = ops[mappedParts[0].v];
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
if (typeof returnP1 === 'object') {
if (!mappedParts[1]) throw new Error(\`\${mappedParts[0].v} does not take arguments\`);
const returnP2 = returnP1[mappedParts[1].v];
if (returnP2) {
return rpp(
Expand Down
1 change: 1 addition & 0 deletions src/TreeToTS/functions/new/resolvePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const ResolveFromPath = (props: AllTypesPropsType, returns: ReturnTypesTy
const oKey = ops[mappedParts[0].v];
const returnP1 = oKey ? returns[oKey] : returns[mappedParts[0].v];
if (typeof returnP1 === 'object') {
if (!mappedParts[1]) throw new Error(`${mappedParts[0].v} does not take arguments`);
const returnP2 = returnP1[mappedParts[1].v];
if (returnP2) {
return rpp(
Expand Down

0 comments on commit 5831d6d

Please sign in to comment.