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

minisearch

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minisearch - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Changelog

# v4.0.2
- [fix] Fix match data on mixed prefix and fuzzy search
# v4.0.1

@@ -7,0 +11,0 @@

2

package.json
{
"name": "minisearch",
"version": "4.0.1",
"version": "4.0.2",
"description": "Tiny but powerful full-text search engine for browser and Node",

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

@@ -82,3 +82,3 @@ # MiniSearch

```html
<script src="https://cdn.jsdelivr.net/npm/minisearch@4.0.1/dist/umd/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/minisearch@4.0.2/dist/umd/index.min.js"></script>
```

@@ -85,0 +85,0 @@

@@ -751,2 +751,16 @@ /* eslint-env jest */

it('reports correct info for many fuzzy and prefix queries', () => {
const results = ms.search('vi nuova m de', { fuzzy: 0.2, prefix: true })
expect(results.map(({ match }) => match)).toEqual([
{ del: ['text'], della: ['text'], memoria: ['text'], mia: ['text'], vita: ['title', 'text'], nova: ['title'] },
{ del: ['text'], mezzo: ['text'], vita: ['text'] },
{ del: ['text'] }
])
expect(results.map(({ terms }) => terms)).toEqual([
['vita', 'nova', 'memoria', 'mia', 'della', 'del'],
['vita', 'mezzo', 'del'],
['del']
])
})
it('passes only the query to tokenize', () => {

@@ -753,0 +767,0 @@ const tokenize = jest.fn(string => string.split(/\W+/))

@@ -1133,6 +1133,13 @@ import SearchableMap from './SearchableMap/SearchableMap'

const result = results.get(documentId)
if (result) {
result.score += score
const match = getOwnProperty(result.match, term)
if (match) match.push(field)
result.score += score
if (match) {
match.push(field)
} else {
result.match[term] = [field]
result.terms.push(term)
}
} else {

@@ -1139,0 +1146,0 @@ results.set(documentId, {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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