-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add string.nonBlank
#227
Add string.nonBlank
#227
Conversation
source/predicates/string.ts
Outdated
@@ -127,6 +127,16 @@ export class StringPredicate extends Predicate<string> { | |||
}); | |||
} | |||
|
|||
/** | |||
Test a string to be not empty nor only whitespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be written more clearly.
I tried to run the tests, but...
|
Alright, if the last open point (making the wording clearer) is solved for you, I have no remaining points other than not being able to run the tests. |
Found a list of metachars in js, turns out there are only 6 so I figured I'd add them to stop at a logical point. \f and \v aren't so common but I can imagine \0 popping up in places. Had to write \0 as \x00 because my IDE thinks it's an error otherwise, even though it works fine in a js console. |
CI is failing |
Try it now? |
@leaumar We unfortunately cannot release this until TS supports ESM, but in the meantime, you can install this with |
Sounds like something that could take months still, if ever? |
It will be in TS 4.6 (was supposed to be in this release, but pulled last minute). So probably a month or two. TS 4.5 is scheduled to be out today. |
Ah, cool. Thanks for the pointer |
This is finally out: https://github.com/sindresorhus/ow/releases/tag/v1.0.0 |
fixes #226
Useful for all kinds of user/file/env sourced inputs that may contain strings of whitespace where a meaningful value is expected.