Skip to content

Commit

Permalink
fix: disallow hat operator in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
collinlokken committed Nov 1, 2023
1 parent da201f9 commit 6050d82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/dm-core/src/components/ViewCreator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export const getTarget = (idReference: string, viewConfig: TViewConfig) => {
if (viewConfig.scope.slice(0, 5) == 'self.') {
return `${idReference}.${viewConfig.scope.slice(5, -1)}`
} else if (viewConfig.scope.slice(0, 1) == '^') {
return `${idReference}.${viewConfig.scope.slice(1, -1)}`
throw new Error(
`'^' operator is not allowed in 'scope' (location: ${idReference})`
)
} else if (viewConfig.scope.slice(0, 1) == '.') {
return `${idReference}${viewConfig.scope}`
} else {
Expand Down

0 comments on commit 6050d82

Please sign in to comment.