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.

GPL-2.0
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis