Skip to content

Commit

Permalink
amend: missed reverse pass-through
Browse files Browse the repository at this point in the history
  • Loading branch information
simlu committed Apr 25, 2021
1 parent 67e9c66 commit 4afef98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
'**'
],
useArraySelector: true,
reverse: true,
logs: [
{
cbName: 'breakFn',
Expand Down
9 changes: 6 additions & 3 deletions test/helper/call-signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module.exports = ({
objectScan,
haystack,
needles,
useArraySelector = true
useArraySelector = true,
reverse = true
}) => {
const logs = [];
const cb = (cbName) => ({
Expand Down Expand Up @@ -37,12 +38,13 @@ module.exports = ({
strict: false,
joined: true,
useArraySelector,
reverse,
filterFn: cb('filterFn'),
breakFn: cb('breakFn')
})(haystack);

const startCompile = process.hrtime();
const scanner = objectScan(needles, { strict: false, useArraySelector });
const scanner = objectScan(needles, { strict: false, useArraySelector, reverse });
const diffCompile = process.hrtime(startCompile);
const durationCompile = diffCompile[0] * 1e9 + diffCompile[1];
const startTraverse = process.hrtime();
Expand All @@ -52,14 +54,15 @@ module.exports = ({

let warning = null;
try {
objectScan(needles, { useArraySelector });
objectScan(needles, { useArraySelector, reverse });
} catch (e) {
warning = e.message;
}
return {
haystack,
needles,
useArraySelector,
reverse,
logs,
warning,
duration: {
Expand Down

0 comments on commit 4afef98

Please sign in to comment.