Skip to content

Commit

Permalink
feat(Events): Use uuid-random for random UUIDs (close #215)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbo2002 committed Mar 5, 2021
1 parent c90e3d8 commit a4c19cc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"files": [
"/dist"
],
"dependencies": {
"uuid-random": "^1.3.2"
},
"devDependencies": {
"@qiwi/semantic-release-gh-pages-plugin": "^5.0.4",
"@semantic-release/changelog": "^5.0.1",
Expand Down
3 changes: 2 additions & 1 deletion src/event.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

import moment from 'moment-timezone';
import uuid from 'uuid-random';
import {
addOrGetCustomAttributes,
checkDate,
Expand Down Expand Up @@ -128,7 +129,7 @@ export default class ICalEvent {

constructor(data: ICalEventData, calendar: ICalCalendar) {
this.data = {
id: ('0000000000' + Math.floor(Math.random() * Math.pow(36, 10) << 0).toString(36)).substr(-10),
id: uuid(),
sequence: 0,
start: null,
end: null,
Expand Down

0 comments on commit a4c19cc

Please sign in to comment.