Closed vernig closed 3 years ago
Hi! I'd be happy to help in that matter. Here's what I know from a JS perspective. When wrapping your tool within the library we pushed, I had to tweak some things to make it expose the right information. As these changes were squashed into my first commit, I just pushed a branch to better show what did change on our side.
https://github.com/Melusyn/text-message-utils/commit/e0a49654737fdeb8d2fdb2d33ee4f1ba904b9719
As you can see, these changes allows me to:
SegmentedMessage
from the outside, which helps in getting the underlying attributesgetIncompatibleEncodingCharacters
— We actually show this information in our webapp, to help our customers manage their SMS credits.From my perspective these are the main changes that needed to be done, as well as adding a TypeScript layer and some test coverage.
Hope that helps, Hugo
Thanks @HugoCrd for sharing the details, this sounds great! I was also thinking to tweak the library slightly because I feel it's performing some unnecessary steps. I'll start working on it next week, and keep you posted.
The proposal is to create a JS library for the segment calculator functionality. This library can then be reused in scripts / serverless / webapp to provide information about encoding of a message. The idea is then to distribute the script through npm / CDN.
In addition to that, it would be nice to have the lib in different languages as well.
@HugoCrd has already a very good implementation of that at https://www.npmjs.com/package/@setkeeper/text-message-utils