@live-change/uid 0.8.109 → 0.8.111

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 +3 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -60,7 +60,7 @@ function randomString(length = 8) {
60
60
 
61
61
  function hashCode(str) {
62
62
  let hash = 0
63
- if(str.length == 0) return hash
63
+ if(str.length === 0) return hash
64
64
  for(let i = 0; i < str.length; i++) {
65
65
  const char = str.charCodeAt(i)
66
66
  hash = ((hash << 5) - hash) + char
@@ -74,7 +74,7 @@ function uidGenerator(fingerprint = randomString(4), numberLength = 0, borders =
74
74
  function next() {
75
75
  const date = new Date()
76
76
  const now = date.getTime()
77
- if(now == lastMillisecond) {
77
+ if(now === lastMillisecond) {
78
78
  lastId ++
79
79
  } else {
80
80
  lastId = 0
@@ -98,7 +98,7 @@ function decodeUid(uid) {
98
98
 
99
99
  function verifyUidSource(uid, source) {
100
100
  const { at } = decodeUid(uid)
101
- return at.slice(0, source.length) == source
101
+ return at.slice(0, source.length) === source
102
102
  }
103
103
 
104
104
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/uid",
3
- "version": "0.8.109",
3
+ "version": "0.8.111",
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": "075bf3759fae6c40fb8e44d77d9f12c5c175e098"
24
+ "gitHead": "9b96afb2fc61ab3d2a5d143924e2c56d411280b4"
25
25
  }