Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
fix isContextExpression parameter type validation (#435)
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Bleil <[email protected]>

Signed-off-by: Arthur Bleil <[email protected]>
  • Loading branch information
arthurbleilzup authored Nov 24, 2022
1 parent ee0e51c commit 04b67a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export type ContextExpressionEvalResult = {
contextPath?: string,
}

export function isContextExpression(expression: string, view: BeagleView): ContextExpressionEvalResult {
if (expression) {
export function isContextExpression(expression: any, view: BeagleView): ContextExpressionEvalResult {
if (expression && typeof expression === 'string') {
const paths = expression.match(FULL_EXPRESSION_REGEX)?.at(1)?.split('.')
const treeContextHierarchy = getTreeContextHierarchy(view)
if (paths && paths.length && Context.find(treeContextHierarchy, paths[0])) {
Expand Down

0 comments on commit 04b67a6

Please sign in to comment.