Skip to content

Commit 69ea565

Browse files
committed
maint(core uuid): Extend with documentation and test from thet-own-needs with similar changes.
1 parent c60fe06 commit 69ea565

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/core/dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ const escape_css_id = (id) => {
532532
};
533533

534534
/**
535-
* Get a universally unique id (uuid) for a DOM element.
535+
* Set and get a universally unique id (uuid) for a DOM element.
536536
*
537537
* This method returns a uuid for the given element. On the first call it will
538538
* generate a uuid and store it on the element.

src/core/uuid.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ describe("uuid", function () {
1919

2020
window.crypto.randomUUID = orig_randomUUID;
2121
});
22+
23+
it("the uuid is unique", function () {
24+
expect(create_uuid()).not.toBe(create_uuid());
25+
});
2226
});

0 commit comments

Comments
 (0)