Socket
Socket
Sign inDemoInstall

bop

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.2.0

4

lib/bop.js

@@ -184,5 +184,3 @@ /*

}
// when no match was found mdist = -1
if ( distance ) return mdist ? [ cnt, mdist - m ] : [ cnt, -1 ];
return [ cnt ];
return distance ? [ cnt, ( cnt < 2 ) ? -1 : mdist - m ] : [ cnt ];
};

@@ -189,0 +187,0 @@

{
"name" : "bop"
, "version" : "3.1.0"
, "version" : "3.2.0"
, "description" : "Bop, an ultra fast Boyer-Moore parser/matcher, optimized for string and buffer patterns (<= 255 bytes)."

@@ -5,0 +5,0 @@ , "homepage" : "https://github.com/rootslab/bop"

@@ -88,4 +88,6 @@ ### Bop

* then, if distance switch is on, it returns also the maximum
* distance found between patterns.
* NOTE: if no occurrence was found, max distance will be -1
* distance found between 2 patterns.
* NOTE: if 0 or only 1 occurrence was found, the max distance will
* be -1 and then the resulting array will be respectvely [0, -1]
* and [1, -1].
*/

@@ -92,0 +94,0 @@ Bop#count( Buffer data [, Number start_from [, Boolean sparse [, Boolean distance ] ] ] ) : Array

@@ -47,9 +47,9 @@ var log = console.log

if ( i > 1 ) assert.ok( cnt[ 1 ] === ( indexes[ i - 2 ] - bpattern.length ) );
else assert.ok( cnt[ 1 ] === 0 );
else assert.ok( cnt[ 1 ] === -1 );
} else
// i = 0, should return -1
assert.ok( cnt[ 1 ] === -1 );
log( ' -> !OK (%d) slice(%d,%d) ->', i , 0, indexes[ i ], cnt );
log( ' -> !OK (%d) slice(%d,%d) ->', i , 0, indexes[ i ] || data.length , cnt );
} while ( i++ < indexes.length );
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc