Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better id auto-incrementor algorithm

  • Loading branch information...
commit d36a9d233d8b3e06f8fb925d253bad91bda068c6 1 parent f0e695f
@substack authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.js
View
4 index.js
@@ -254,8 +254,8 @@ Propagit.prototype.createService = function (remote, conn) {
}
while (ids.indexOf(obj.id) >= 0) {
- obj.id.replace(/-(\d+)/, function (_, x) {
- return x + 1
+ obj.id.replace(/(?:-(\d+))?$/, function (_, x) {
+ return '-' + (parseInt(x || '0', 10) + 1);
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.