Skip to content

Commit

Permalink
fix: propertyName with multi hyphen not working (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheilaXu committed Jan 23, 2023
1 parent 371a2dd commit 7c7dc2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/scene-composer/src/utils/dataBindingUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const dataBindingValuesProvider = (
* Currently, the jexl in TwinMaker can't handle "-", while the TwinMaker property can accept "-". This function will escape the special character
*/
const escapeRestrictedKeys = (value: Record<string, unknown>): [Record<string, string>, Record<string, unknown>] => {
const restrictedCharRegex = /-/;
const restrictedCharRegex = /-/g;
const escapedKeyMap: Record<string, string> = {};
const escapedValues: Record<string, unknown> = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe('ruleEvaluator', () => {
});

it('should property names with special characters should work correctly', async () => {
const key1 = 'my-temperature';
const key1 = 'my-temperature-prop';
const key2 = 'myRPM';
const value = {
[key1]: 22,
Expand Down

0 comments on commit 7c7dc2c

Please sign in to comment.