Skip to content

Commit

Permalink
Merge pull request #1213 from Patternslib/improvements
Browse files Browse the repository at this point in the history
maint(core uuid): Extend with documentation and test from thet-own-ne…
  • Loading branch information
thet authored Jan 7, 2025
2 parents c60fe06 + 69ea565 commit 7ace4ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ const escape_css_id = (id) => {
};

/**
* Get a universally unique id (uuid) for a DOM element.
* Set and get a universally unique id (uuid) for a DOM element.
*
* This method returns a uuid for the given element. On the first call it will
* generate a uuid and store it on the element.
Expand Down
4 changes: 4 additions & 0 deletions src/core/uuid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ describe("uuid", function () {

window.crypto.randomUUID = orig_randomUUID;
});

it("the uuid is unique", function () {
expect(create_uuid()).not.toBe(create_uuid());
});
});

0 comments on commit 7ace4ce

Please sign in to comment.