Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Add support for suffix #15

Open
darkurse opened this issue May 9, 2018 · 3 comments
Open

Add support for suffix #15

darkurse opened this issue May 9, 2018 · 3 comments

Comments

@darkurse
Copy link
Contributor

darkurse commented May 9, 2018

Very often I have seen physical barcode scanners using a carriage return to signal the end of a barcode.
could you do something to manage this ?

@serhalp
Copy link
Contributor

serhalp commented May 9, 2018

As noted in #14, we actually added the ability to specify a regular expression that a barcode value must match in the underlying barcode-scan-listener-module, so you could specify something like barcodeValueTest: /\r$/. But unfortunately as explained in the above issue, we haven't properly threaded support for that into this module yet. And the value that your handler would be called with would include the carriage return, so you'd have to handle truncating that yourself...

However we'd also accept a PR into barcode-scan-listener if you'd like to add support for an optional suffix that gets stripped like the prefix!

@darkurse
Copy link
Contributor Author

darkurse commented May 9, 2018

I actually saw what you're describing later in the day while investigating. I've done the mapping you're mentioning but I'm struggling a little with the tests .. that's my first time with both coffee script syntax and karma..

I'll do a PR within the hour I hope

@darkurse
Copy link
Contributor Author

Hi @serhalp , anything wrong with the PRs ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants