Greasy Fork

Shined up real nice.

StringSearcherMap

try to take over the world!

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/32209-stringsearchermap/code/StringSearcherMap.js?version=211248

Advertisement
Author
Cologler
Ratings
0 0 0
Version
0.1
Created
Updated
License
N/A
Applies to
All sites

Author's Description

This lib can work for highlight keywords or more.

let map = new StringSearcherMap();
map.add('50', 1);
json_equals(map.match('8504'), [
    { type: 0, text: '8' },
    { type: 1, text: '50', data: 1 },
    { type: 0, text: '4' }
]);