From 6050d82a383fc7c45231a93134de138b39174bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Collin=20L=C3=B8kken?= Date: Wed, 1 Nov 2023 10:19:10 +0100 Subject: [PATCH] fix: disallow hat operator in scope --- packages/dm-core/src/components/ViewCreator/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/dm-core/src/components/ViewCreator/utils.ts b/packages/dm-core/src/components/ViewCreator/utils.ts index ca14d9090..ec3602820 100644 --- a/packages/dm-core/src/components/ViewCreator/utils.ts +++ b/packages/dm-core/src/components/ViewCreator/utils.ts @@ -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 {