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

Proposal: string().truncate() #833

Closed
thelinuxlich opened this issue Feb 22, 2016 · 3 comments
Closed

Proposal: string().truncate() #833

thelinuxlich opened this issue Feb 22, 2016 · 3 comments
Labels
feature New functionality or improvement
Milestone

Comments

@thelinuxlich
Copy link

(I'm not using the issue template because I'm not reporting a bug)

Since we already have .trim(), .uppercase() and .lowercase() modifying the original strings, a .truncate(length) method would be very useful.

@hueniverse
Copy link
Contributor

Basically you are asking for a max() that enforces the rule?

@thelinuxlich
Copy link
Author

Exactly

@Marsup Marsup added the request label Feb 22, 2016
JamesAnthonyPino added a commit to JamesAnthonyPino/joi that referenced this issue May 11, 2016
This is a fix for proposing to add truncate() to string(). This works like max(), only it actually modifies the string to the specified limit. Unit tests are also added.
JamesAnthonyPino added a commit to JamesAnthonyPino/joi that referenced this issue May 11, 2016
All tests passed locally at 100% coverage, no warnings.
@Marsup Marsup mentioned this issue May 11, 2016
Marsup added a commit that referenced this issue May 28, 2016
@Marsup Marsup added this to the 8.2.0 milestone May 28, 2016
@Marsup Marsup self-assigned this May 28, 2016
@Marsup Marsup closed this as completed May 28, 2016
@hueniverse hueniverse added feature New functionality or improvement and removed request labels Sep 19, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants