Skip to content

Commit

Permalink
Fix some types
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmaa committed Dec 16, 2024
1 parent 5baff60 commit 19ae829
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/js/data/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export class Database {
try {
this._isOpening = true;
this._db = await this._open(databaseName, version, (db, transaction, oldVersion) => {
this._upgrade(db, transaction, oldVersion, structure);
if (structure !== null) {
this._upgrade(db, transaction, oldVersion, structure);
}
});
} finally {
this._isOpening = false;
Expand Down
3 changes: 3 additions & 0 deletions ext/js/dom/text-source-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export class TextSourceGenerator {
return document.caretRangeFromPoint(x, y);
}

// @ts-expect-error - caretPositionFromPoint is non-standard

Check failure on line 409 in ext/js/dom/text-source-generator.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Unused '@ts-expect-error' directive.
if (typeof document.caretPositionFromPoint === 'function') {
// Firefox
return this._caretPositionFromPoint(x, y);
Expand All @@ -421,6 +422,7 @@ export class TextSourceGenerator {
* @returns {?Range}
*/
_caretPositionFromPoint(x, y) {
// @ts-expect-error - caretPositionFromPoint is non-standard

Check failure on line 425 in ext/js/dom/text-source-generator.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Unused '@ts-expect-error' directive.
const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y);
if (position === null) {
return null;
Expand Down Expand Up @@ -473,6 +475,7 @@ export class TextSourceGenerator {
nextElement.style.setProperty('user-select', 'text', 'important');
}

// @ts-expect-error - caretPositionFromPoint is non-standard

Check failure on line 478 in ext/js/dom/text-source-generator.js

View workflow job for this annotation

GitHub Actions / Static Analysis

Unused '@ts-expect-error' directive.
const position = /** @type {(x: number, y: number) => ?{offsetNode: Node, offset: number}} */ (document.caretPositionFromPoint)(x, y);
if (position === null) {
return null;
Expand Down

0 comments on commit 19ae829

Please sign in to comment.