@live-change/uid 0.9.14 → 0.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +2 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -69,7 +69,7 @@ function hashCode(str) {
69
69
  return Math.abs(hash)
70
70
  }
71
71
 
72
- function uidGenerator(fingerprint = randomString(4), numberLength = 0, borders = '{}') {
72
+ function uidGenerator(fingerprint = randomString(4), numberLength = 0, borders = '{}', idSuffix = '') {
73
73
  let lastMillisecond = Date.now(), lastId = 0
74
74
  function next() {
75
75
  const date = new Date()
@@ -81,9 +81,8 @@ function uidGenerator(fingerprint = randomString(4), numberLength = 0, borders =
81
81
  lastMillisecond = now
82
82
  }
83
83
  const idPart = encodeNumber(lastId).padStart(numberLength, '0')
84
- return borders[0] + encodeDate(date) + '.' + idPart + '@' + fingerprint + borders[1]
84
+ return borders[0] + encodeDate(date) + '.' + idPart + idSuffix + '@' + fingerprint + borders[1]
85
85
  }
86
-
87
86
  return next
88
87
  }
89
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/uid",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "description": "Simple unique id generator with timestamp and source",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,5 +21,5 @@
21
21
  "url": "https://github.com/live-change/live-change-stack/issues"
22
22
  },
23
23
  "homepage": "https://github.com/live-change/live-change-stack",
24
- "gitHead": "5d0f137a1a16f892868719d919f4a76584fa879f"
24
+ "gitHead": "226df9fa7eb682f6d7da5e4541eb320e8309facf"
25
25
  }