Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed Aug 10, 2024
1 parent c31ed1d commit 9e27c77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions apps/builder/app/builder/shared/binding-popover.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
8 changes: 4 additions & 4 deletions packages/sdk/src/to-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export const createJsonStringifyProxy = <T extends object>(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)
);
};

0 comments on commit 9e27c77

Please sign in to comment.