question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Whitespace ... leniency

See original GitHub issue

hi 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
iamjochemcommented, Dec 7, 2016

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 😃

0reactions
harrisiirakcommented, Dec 7, 2016

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found