Skip to content

Commit

Permalink
isValidRev: cache regex
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn authored and janl committed Apr 29, 2024
1 parent 84b7afb commit 905dfdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/node_modules/pouchdb-core/src/adapter.js
Expand Up @@ -194,8 +194,9 @@ function isNotSingleDoc(doc) {
return doc === null || typeof doc !== 'object' || Array.isArray(doc);
}

const validRevRegex = /^\d+-[^-]*$/;
function isValidRev(rev) {
return typeof rev === 'string' && /^\d+-[^-]*$/.test(rev);
return typeof rev === 'string' && validRevRegex.test(rev);
}

class AbstractPouchDB extends EventEmitter {
Expand Down

0 comments on commit 905dfdf

Please sign in to comment.