kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

Fix section symbol in regex when compiled with Angular #352

Closed jaredtbates closed 2 years ago

jaredtbates commented 2 years ago

Motivation

For some reason, Angular translates the section symbol in the property name regex to \xa7, I assume to escape it, however this causes the regex to match against any a in the property name. In this commit I fixed it so that the regex already includes the escaping, so Angular doesn't try to escape it. We are using this in our system and it works great.

Checklist

How to test

We found this issue using the camelCasePropertyNameResolver in an Angular project. Any field that had the letter a in it had property name resolver issues.

Enngage commented 2 years ago

Thank you @computerwizjared !

Enngage commented 2 years ago

@computerwizjared I've released it under @kontent-ai/delivery-sdk@12.0.1. We have rebranded just Yesterday so check the updated package name;)

jaredtbates commented 2 years ago

Thanks @Enngage for the prompt response! I appreciate it a lot.