How to use the fuzzball.extractAsPromised function in fuzzball

To help you get started, we’ve selected a few fuzzball examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nol13 / fuzzball.js / demo-app / src / components / ProductTable.js View on Github external
extract = (props) => {
        if (this.cancelToken) this.cancelToken.canceled = true;
        this.cancelToken = {canceled: false};
        const { filter, scorer, fullProcess, wildcards, dataset } = props;
        const options = {
            scorer: fuzz[scorer],
            processor: (choice) => { return choice.name; },
            full_process: fullProcess,
            wildcards,
            cancelToken: this.cancelToken
        };
        const choices = dataset;
        fuzz.extractAsPromised(filter, choices, options).then(scoredProds => {
            this.setState({scoredProds});
        }).catch(() => {
            // canceled
        });
    };

fuzzball

Fuzzy string matching algorithms and utilities, port of the TheFuzz Python library.

MIT
Latest version published 1 month ago

Package Health Score

78 / 100
Full package analysis