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.11.2 to 1.12.0

v2/fuzzy.ts

1

lib/fuzzy.d.ts

@@ -13,2 +13,3 @@ declare module 'fast-fuzzy' {

useSellers?: boolean,
useSeparatedUnicode?: boolean,
returnMatchData?: boolean,

@@ -15,0 +16,0 @@ sortBy?: sortKind,

@@ -9,2 +9,4 @@ 'use strict';

const splitUnicode = str => str.normalize("NFKD").split("");
const whitespaceRegex = /^\s+$/;

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

useSellers: true,
useSeparatedUnicode: false,
sortBy: sortKind.bestMatch

@@ -42,4 +45,5 @@ };

let length = 0;
const graphemeList = options.useSeparatedUnicode ? splitUnicode(lower) : split(lower);
for (const grapheme of split(lower)) {
for (const grapheme of graphemeList) {
whitespaceRegex.lastIndex = 0;

@@ -55,3 +59,8 @@ nonWordRegex.lastIndex = 0;

} else if (!(options.ignoreSymbols && nonWordRegex.test(grapheme))) {
normal.push(grapheme.normalize());
if (options.useSeparatedUnicode) {
normal.push(grapheme);
} else {
normal.push(grapheme.normalize());
}
map.push(length);

@@ -58,0 +67,0 @@ lastWasWhitespace = false;

2

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

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

@@ -67,2 +67,3 @@ # fast-fuzzy [![Build Status](https://travis-ci.com/EthanRutherford/fast-fuzzy.svg?branch=master)](https://travis-ci.com/EthanRutherford/fast-fuzzy) [![npm](https://img.shields.io/npm/v/fast-fuzzy.svg)](https://www.npmjs.com/package/fast-fuzzy)

| useSellers | `Bool` | use the Sellers method for substring matching | `true`
| useSeparatedUnicode | `Bool` | use separated unicode | `false`
| sortBy | `sortKind` | defines which order results are returned in<sup>6</sup> | `bestMatch`

@@ -69,0 +70,0 @@

Sorry, the diff of this file is not supported yet

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