Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of customElements.getName() #254

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cjs/interface/custom-element-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class CustomElementRegistry {
* @param {Function} Class **Class** of custom element
* @returns {string?} found tag name or null
*/
getName(Class){
getName(Class) {
if (Classes.has(Class)) {
const { localName } = Classes.get(Class);
return localName;
Expand Down
2 changes: 1 addition & 1 deletion esm/interface/custom-element-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class CustomElementRegistry {
* @param {Function} Class **Class** of custom element
* @returns {string?} found tag name or null
*/
getName(Class){
getName(Class) {
Copy link
Owner

@WebReflection WebReflection Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also good but I wasn't clear ... see indentation compared to get(...)

Screenshot from 2023-12-12 13-33-21

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O.k. -- I finally got it! :)

Indentation should be fixed now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also good but I wasn't clear ... see indentation compared to get(...)

Screenshot from 2023-12-12 13-33-21

if (Classes.has(Class)) {
const { localName } = Classes.get(Class);
return localName;
Expand Down