Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separator should be configurable for stringValue properties and functions #15

Closed
pfei5 opened this issue Nov 16, 2022 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@pfei5
Copy link

pfei5 commented Nov 16, 2022

The separator for the stringValue property and methods is hard-coded to a space " ".
This increases the size of the resulting string unnecessarily by something like 30%.
We have storage constraints on iOS and especially on watchOS.
IMHO the separator should be an empty string, but at the very least configurable.

Thank you for an otherwise amazingly convenient and tidy library.

@pfei5 pfei5 added the enhancement New feature or request label Nov 16, 2022
@orchetect
Copy link
Owner

orchetect commented Nov 17, 2022

Yes there's a few missing customization points that would be worth adding including these.

I can push a release fairly soon since they would mostly be defaulted parameters so it shouldn't be code-breaking.

The stringValue property on Collection must remain with a hard-coded space since a collection may be of any integer size (8-bit, 16-bit, 32-bit, or 64-bit) and the separator is needed to differentiate values. This is a convenience property and that is the most common use case.

For customized output, the stringValue(...) methods with an added separator parameter would make it easy to override it with an empty separator. The separator parameter should remain defaulted to a space (" ") for consistency and for the same consideration of varying integer sizes.

@Proper-Job
Copy link

Wow, that's great, thank you so much!

@orchetect
Copy link
Owner

Release 1.3.0 includes the changes. Let me know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants