Whitespace ... leniency
See original GitHub issuehi there,
crontab
definitions are lenient with regard to the white space seperating the components of a schedule definition so that the following two lines are equivalent:
* 0 7,15 * 1-6
* 0 7,15 * 1-6
It is quite common for tabs to be used crontab files, unfortunately you module only accepts a single space as a delimiter between the components (mutiple spaces and/or tabs lead to parsing errors)
It would be nice if the parser could automatically normalize the input so that whitespace in a “schedule string” is treated the same way as is done by the various well-known cron applications found on posix systems. the normalization would need to be/do something like the following:
function normalize(input)
{
return (input + '').replace(/\s+/g, ' ').trim();
}
var testval = '0 7,15 * 1-6'
console.log(testval, normalize(testval));
Or maybe this is something you are opposed to?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Introduce lenient parsing in DataSize regarding whitespace · Issue ...
I've just helped a user correct a configuration mistake where they'd tried to configure a DataSize with a string of 2KB . This...
Read more >T291169 Be more lenient with whitespace when parsing date/time ...
As a Wikidata editor speaking German, I want to be able to enter dates BCE in normal German. Problem: In German, the interface...
Read more >PhoneNumberUtil.Leniency (libphonenumber 7.1.1 API) - javadoc.io
Leniency when finding potential phone numbers in text segments. The levels here are ordered in ... (Extraneous whitespace characters are not permitted.).
Read more >PPM file format - Washington
A ppm file's magic number is the two characters "P3". - Whitespace (blanks, TABs, CRs, LFs). - A width, formatted as ASCII characters...
Read more >METAL Command Reference - Genome Analysis Wiki
Describing Input Files. SEPARATOR [WHITESPACE|COMMA|BOTH|TAB] (default = WHITESPACE) COLUMNCOUNTING [STRICT|LENIENT] (default = 'STRICT ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
btw - thanks for the quick response, it’s always nice when an author/maintainer replies especially when it’s within a matter of minutes.
I’ll get you a PR after dinner 😃
@iamjochem yep there are some non-ISO timestamps in the tests. Going to clean up this in
3.0
. Shouldn’t affect the normal usage of the library.