Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});
};