We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b84417 commit 026d913Copy full SHA for 026d913
1 file changed
src/util/index.js
@@ -38,10 +38,10 @@ export function getPointDistance (pointOne, pointTwo) {
38
return Math.sqrt(minusX * minusX + minusY * minusY)
39
}
40
41
-export function uuid () {
42
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+export function uuid (hasHyphen) {
+ return (hasHyphen ? 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' : 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx').replace(/[xy]/g, function (c) {
43
const r = Math.random() * 16 | 0
44
const v = c == 'x' ? r : (r & 0x3 | 0x8)
45
return v.toString(16)
46
- })
+ })
47
0 commit comments