-
-
Notifications
You must be signed in to change notification settings - Fork 16
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 support for ignoring times (12:34
) ignoreDigits
is on
#25
Add support for ignoring times (12:34
) ignoreDigits
is on
#25
Conversation
- It's set to by default - The JSDoc documentation for it has also been added
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## main #25 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 291 304 +13
=========================================
+ Hits 291 304 +13
Continue to review full report at Codecov.
|
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.
Thanks for working on this! ✨
What you implemented is a bit different from what the original issue was (“times in common formats (e.g. 2:41PM)”).
There is a difference between:
- finite words, which also include numbers, and can accidentally include numbers (
w0rd
, because theo
is next to0
), which have a great solution already: the personal dictionary. - numerical-like, such as times, which don’t have a good solution.
Are there other words you want to ignore? Did you consider the personal dictionary (or ignore
if you have to)?
I was thinking more of adding /^\d{1,2}:\d{2}(?:[ap]\.?m)?$/i
. Either under the existing ignoreDigits
option. Or, if you like it, perhaps a new ignoreTimes
option?
We could also add the resultions you show in a test case?
That's true, and a good point. There aren't really other words I want to ignore (times are my priority), they just seemed to fit in the same category as I was thinking about it (but I supposed this is exactly how scope creep happens haha).
I really like this solution. Keeps the API simple and it fit's well the specific problem of ignoring times. I'll update the PR to reflect these changes. Thanks for the feedback! :) |
- Removes the recently added prop and stuffs it's time ignoring functionality into the prop. - Updates tests to reflect the above changes - Updates README to reflect the above changes
I'm not confident about the documentation updates. Is this a satisfactory way to document the ignoring of times? If so, awesome. If not, would love your opinion. Lines 18 to 19 in d71c22b
Lines 112 to 113 in d71c22b
|
ignoreDigits
option is true
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.
Docs look good!
ignoreDigits
option is true12:34
) ignoreDigits
is on
This comment has been minimized.
This comment has been minimized.
Thanks, released in |
Awesome! Thanks so much :) |
Initial checklist
Description of changes
ignoreDigits
option which will ignore any word that is a time (e.g.2:41pm
)ignoreDigits
option.Closes #24 and a step toward resolving newrelic/one-core-toolbox#38