Socket
Socket
Sign inDemoInstall

fuzzy-array-filter

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuzzy-array-filter - npm Package Compare versions

Comparing version 0.0.1-a to 0.0.1-b

README.md

15

index.js
var Fuse = require('fuse.js');
var fuzzySearch = function(value, options) {
var fuzzyFilter = function(value, options = {}) {
var defaultOptions = {
threshold: 0.6,
threshold: 0.4,
location: 0,

@@ -12,8 +12,8 @@ distance: 100,

let fuse = null;
let result = null;
var fuse = null;
var result = null;
return (val, key, array) => {
return function(val, key, array) {
if (!fuse || !result) {
fuse = new Fuse(array, options || defaultOptions)
fuse = new Fuse(array, Object.assign(defaultOptions, options))
result = fuse.search(value);

@@ -25,3 +25,2 @@ }

module.exports.fuzzySearch = fuzzySearch;
module.exports = fuzzyFilter;
{
"name": "fuzzy-array-filter",
"version": "0.0.1a",
"version": "0.0.1b",
"description": "A simple array fuzzy filtering",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc