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.

Token Seperation Issue

See original GitHub issue

I have discovered an issue when tokenize and matchAllTokens is enabled. When you search for white (with a trailing whitespace), the tokens are ['white', '']. This causes fuse to return no results due to one empty token. Would removing empty tokens as below be a fix for this?

var tokens = pattern.split(options.tokenSeparator).filter(function(token){
    return token !== '';
})

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
dlosiecommented, Jul 17, 2019

I solved this by using String.prototype.trim() on my search query to remove unwanted leading /trailing whitespace.

fuse.search(query.trim());
3reactions
jwmanncommented, Apr 26, 2018

@jeffal I pulled in and re-built with the most recent master changes. Thank god Travis-CI didn’t fall off a cliff this time and built successfully.

Just needs a merge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A LOOK BACK;Token Separation Anxiety - The New York Times
This unwillingness to part with old tokens is nothing new. Of the bulls-eye's two immediate predecessors, there are about 16 million tokens that ......
Read more >
Separation of circulating tokens - ScienceDirect.com
vestigation is confined to the problem of self-stabilizing circulation of tokens with some desired separation between them. Related work.
Read more >
Separation of Circulating Tokens | SpringerLink
The problem studied in this paper is to ensure that a synchronous system with m circulating tokens has at least d distance between...
Read more >
[0908.1797] Separation of Circulating Tokens - arXiv
The problem studied in this paper is to ensure that a synchronous system with m circulating tokens has at least d distance between...
Read more >
Is the separation token absolutely necessary if I use ... - GitHub
h56cho opened this issue on Jun 1, 2020 · 1 comment ... do I absolutely need to insert a special separation token between...
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