Comparing version 2.1.1 to 2.1.2
24
bl.js
@@ -53,5 +53,5 @@ 'use strict' | ||
BufferList.prototype._reverseOffset = function (blOffset) { | ||
const bufferId = blOffset[0] | ||
let offset = blOffset[1] | ||
for (let i = 0; i < bufferId; i++) { | ||
var bufferId = blOffset[0] | ||
var offset = blOffset[1] | ||
for (var i = 0; i < bufferId; i++) { | ||
offset += this._bufs[i].length | ||
@@ -125,3 +125,3 @@ } | ||
} | ||
const offset = this._offset(index) | ||
var offset = this._offset(index) | ||
return this._bufs[offset[0]][offset[1]] | ||
@@ -302,13 +302,13 @@ } | ||
const blOffset = this._offset(offset) | ||
let blIndex = blOffset[0] // index of which internal buffer we're working on | ||
let buffOffset = blOffset[1] // offset of the internal buffer we're working on | ||
var blOffset = this._offset(offset) | ||
var blIndex = blOffset[0] // index of which internal buffer we're working on | ||
var buffOffset = blOffset[1] // offset of the internal buffer we're working on | ||
// scan over each buffer | ||
for (blIndex; blIndex < this._bufs.length; blIndex++) { | ||
const buff = this._bufs[blIndex] | ||
var buff = this._bufs[blIndex] | ||
while(buffOffset < buff.length) { | ||
const availableWindow = buff.length - buffOffset | ||
var availableWindow = buff.length - buffOffset | ||
if (availableWindow >= search.length) { | ||
const nativeSearchResult = buff.indexOf(search, buffOffset) | ||
var nativeSearchResult = buff.indexOf(search, buffOffset) | ||
if (nativeSearchResult !== -1) { | ||
@@ -319,3 +319,3 @@ return this._reverseOffset([blIndex, nativeSearchResult]) | ||
} else { | ||
const revOffset = this._reverseOffset([blIndex, buffOffset]) | ||
var revOffset = this._reverseOffset([blIndex, buffOffset]) | ||
if (this._match(revOffset, search)) { | ||
@@ -336,3 +336,3 @@ return revOffset | ||
} | ||
for (let searchOffset = 0; searchOffset < search.length ; searchOffset++) { | ||
for (var searchOffset = 0; searchOffset < search.length ; searchOffset++) { | ||
if(this.get(offset + searchOffset) !== search[searchOffset]){ | ||
@@ -339,0 +339,0 @@ return false |
{ | ||
"name": "bl", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", | ||
@@ -5,0 +5,0 @@ "main": "bl.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57549