cotomy 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -893,7 +893,7 @@ class CotomyElement {
893
893
  return new ctor(element);
894
894
  }
895
895
  static last(selector, type) {
896
- const elements = this.find(selector, type);
896
+ const elements = CotomyElement.find(selector, type);
897
897
  return elements.pop();
898
898
  }
899
899
  static find(selector, type) {
@@ -905,7 +905,9 @@ class CotomyElement {
905
905
  return document.querySelector(selector) !== null;
906
906
  }
907
907
  static byId(id, type) {
908
- return this.first(`#${id}`, type);
908
+ const element = document.getElementById(id);
909
+ const ctor = (type ?? CotomyElement);
910
+ return !element ? undefined : new ctor(element);
909
911
  }
910
912
  static containsById(id) {
911
913
  return document.getElementById(id) !== null;