Skip to content

Commit

Permalink
cache regex
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed May 8, 2024
1 parent 1eaf3ad commit 6617a8d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function massageSort(sort) {
});
}

const ddocIdPrefix = /^_design\//;
function massageUseIndex(useIndex) {
let cleanedUseIndex = [];
if (typeof useIndex === 'string') {
Expand All @@ -27,7 +28,7 @@ function massageUseIndex(useIndex) {
}

return cleanedUseIndex.map(function (name) {
return name.replace(/^_design\//, '');
return name.replace(ddocIdPrefix, '');
});
}

Expand Down

0 comments on commit 6617a8d

Please sign in to comment.