mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
jquery: Make expectOne helper function generic.
This commit is contained in:
committed by
Tim Abbott
parent
df18d2768c
commit
8d7a9162e2
@@ -26,10 +26,10 @@ $(() => {
|
||||
return this[0].getBoundingClientRect();
|
||||
};
|
||||
|
||||
$.fn.expectOne = function () {
|
||||
$.fn.expectOne = function <T>() {
|
||||
if (blueslip && this.length !== 1) {
|
||||
blueslip.error("Expected one element in jQuery set", {length: this.length});
|
||||
}
|
||||
return this;
|
||||
return this as JQuery<T>;
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user