diff options
Diffstat (limited to 'src/modules/helpers/eval.ts')
| -rw-r--r-- | src/modules/helpers/eval.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/helpers/eval.ts b/src/modules/helpers/eval.ts index 033c5d35..4a861ec0 100644 --- a/src/modules/helpers/eval.ts +++ b/src/modules/helpers/eval.ts @@ -119,12 +119,15 @@ function evalProcessFunction( switch (nextChar) { case '.': case '(': - case undefined: + case undefined: { break; // valid - default: + } + + default: { throw new FakerError( `Expected dot ('.'), open parenthesis ('('), or nothing after function call but got '${nextChar}'` ); + } } return [ @@ -223,7 +226,8 @@ function resolveProperty(entrypoint: unknown, key: string): unknown { return entrypoint?.[key as keyof typeof entrypoint]; } - default: + default: { return undefined; + } } } |
