mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Fix logic to check if test passes in toContainChunk
This commit is contained in:
parent
fba7f33c14
commit
0938f79d1a
@ -31,11 +31,11 @@ const failMessage = (utils, data, chunk, headIndex) => () => {
|
||||
|
||||
export default {
|
||||
toContainChunk(data, chunk) {
|
||||
let pass = false;
|
||||
const headIndex = data.indexOf(chunk[0]);
|
||||
if (headIndex !== -1) {
|
||||
let pass = headIndex !== -1;
|
||||
if (pass) {
|
||||
for (let i = 1; i < chunk.length; ++i) {
|
||||
pass = this.equals(data[headIndex + i], chunk[i]);
|
||||
pass = pass && this.equals(data[headIndex + i], chunk[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user