From 9e27c77ee587d3acaf82fd1ce78796b91718544b Mon Sep 17 00:00:00 2001 From: istarkov Date: Fri, 9 Aug 2024 16:16:53 +0000 Subject: [PATCH] fix --- apps/builder/app/builder/shared/binding-popover.test.ts | 8 +++++--- packages/sdk/src/to-string.ts | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/builder/app/builder/shared/binding-popover.test.ts b/apps/builder/app/builder/shared/binding-popover.test.ts index 4ca6dd1f98f7..8b611ba6574a 100644 --- a/apps/builder/app/builder/shared/binding-popover.test.ts +++ b/apps/builder/app/builder/shared/binding-popover.test.ts @@ -6,8 +6,10 @@ test("evaluateExpressionWithinScope works", () => { const variableName = "jsonVariable"; const encVariableName = encodeDataSourceVariable(variableName); const variableValue = 1; - const variables = { [encVariableName]: variableValue }; - const expression = `${encVariableName} + ${encVariableName}`; - expect(evaluateExpressionWithinScope(expression, variables)).toEqual(2); + expect( + evaluateExpressionWithinScope(`${encVariableName} + ${encVariableName}`, { + [encVariableName]: variableValue, + }) + ).toEqual(2); }); diff --git a/packages/sdk/src/to-string.ts b/packages/sdk/src/to-string.ts index 74e86ca32ce8..ddcf8698309b 100644 --- a/packages/sdk/src/to-string.ts +++ b/packages/sdk/src/to-string.ts @@ -18,10 +18,10 @@ export const createJsonStringifyProxy = (target: T): T => { }); }; -export const isPlainObject = (obj: unknown): obj is object => { +export const isPlainObject = (value: unknown): value is object => { return ( - Object.prototype.toString.call(obj) === "[object Object]" && - (Object.getPrototypeOf(obj) === null || - Object.getPrototypeOf(obj) === Object.prototype) + Object.prototype.toString.call(value) === "[object Object]" && + (Object.getPrototypeOf(value) === null || + Object.getPrototypeOf(value) === Object.prototype) ); };