Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-fuzzy

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-fuzzy - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

13

fuzzy.js

@@ -15,4 +15,5 @@ const nonWordRegex = /[`~!@#$%^&*()\-=_+{}[\]\|\\;':",./<>?]+/g;

function normalize(string, options) {
string = string.normalize();
if (options.ignoreCase) {
string = string.toLowerCase();
string = string.toLocaleLowerCase();
}

@@ -73,2 +74,10 @@ if (options.ignoreSymbols) {

//wrapper for exporting sellers while allowing options to be passed in
function fuzzy(term, candidate, options) {
options = Object.assign({}, defaultOptions, options);
term = normalize(term, options);
candidate = normalize(candidate, options);
return sellers(term, candidate);
}
//simple one-off search. Useful if you don't expect to use the same candidate list again

@@ -98,5 +107,5 @@ function search(term, candidates, options) {

module.exports = {
fuzzy: sellers,
fuzzy,
search,
Searcher,
};

2

package.json
{
"name": "fast-fuzzy",
"version": "1.2.0",
"version": "1.2.1",
"description": "Fast and tiny fuzzy-search utility",

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

@@ -27,1 +27,3 @@ # fast-fuzzy [![Build Status](https://travis-ci.org/EthanRutherford/fast-fuzzy.svg?branch=master)](https://travis-ci.org/EthanRutherford/fast-fuzzy)

* objects are returned in the form `{item, key, score}`
`fuzzy` accepts a subset of these options (ignoreCase, ignoreSymbols, normalizeWhitespace) with the same defaults.

@@ -42,2 +42,9 @@ /* global describe, it */

});
it("should accept options", () => {
assert.notEqual(
fuzzy("hello", "HELLO"),
fuzzy("hello", "HELLO", {ignoreCase: false})
);
});
});

@@ -44,0 +51,0 @@

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