Skip to content

Commit

Permalink
[clean] Throw error if second arg of mapState is a function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Masa-Shin committed May 23, 2022
1 parent 3c79c80 commit a7d11e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/converters/options/computedConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export const computedConverter = (

const namespaceText = namespace.text;

if (ts.isFunctionExpression(mapObject)) {
throw new Error(
"Function as the argument of mapState or mapGetters is not currently supported"
);
}

if (ts.isArrayLiteralExpression(mapObject)) {
return mapArrayConverter(mapName, namespaceText, mapObject);
}
Expand Down

0 comments on commit a7d11e5

Please sign in to comment.