Skip to content

Commit

Permalink
Update dependencies (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Sep 14, 2023
1 parent e9ed7ec commit bad1c3a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions index.ts
Expand Up @@ -246,13 +246,13 @@ class OptionsSync<UserOptions extends Options> {
await saveFile(text, extension.name + ' options.json');
};

private _log(method: 'log' | 'info', ...args: any[]): void {
private _log(method: 'log' | 'info', ...args: unknown[]): void {
console[method](...args);
}

private async _getAll(): Promise<UserOptions> {
const result = await this.storage.get(this.storageName);
return this._decode(result[this.storageName]);
return this._decode(result[this.storageName] as UserOptions);
}

private async _setAll(newOptions: UserOptions): Promise<void> {
Expand Down Expand Up @@ -352,13 +352,13 @@ class OptionsSync<UserOptions extends Options> {
return serialize(form, {include});
}

private readonly _handleStorageChangeOnForm = (changes: Record<string, any>, areaName: string): void => {
private readonly _handleStorageChangeOnForm = (changes: Record<string, chrome.storage.StorageChange>, areaName: string): void => {
if (
areaName === this.storageType
&& changes[this.storageName]
&& this.storageName in changes
&& (!document.hasFocus() || !this._form!.contains(document.activeElement)) // Avoid applying changes while the user is editing a field
) {
this._updateForm(this._form!, this._decode(changes[this.storageName].newValue));
this._updateForm(this._form!, this._decode(changes[this.storageName]!.newValue as string));
}
};
}
Expand Down
24 changes: 12 additions & 12 deletions package.json
Expand Up @@ -49,24 +49,24 @@
},
"dependencies": {
"dom-form-serializer": "^2.0.0",
"lz-string": "^1.4.4",
"lz-string": "^1.5.0",
"throttle-debounce": "^5.0.0",
"webext-detect-page": "^4.0.1",
"webext-events": "^1.1.0",
"webext-polyfill-kinda": "^1.0.0"
"webext-detect-page": "^4.1.1",
"webext-events": "^2.0.0",
"webext-polyfill-kinda": "^1.0.2"
},
"devDependencies": {
"@sindresorhus/tsconfig": "^3.0.1",
"@types/chrome": "0.0.210",
"@sindresorhus/tsconfig": "^4.0.0",
"@types/chrome": "0.0.246",
"@types/lz-string": "^1.3.34",
"@types/throttle-debounce": "^5.0.0",
"@types/wicg-file-system-access": "^2020.9.5",
"ava": "^5.1.1",
"@types/wicg-file-system-access": "^2020.9.6",
"ava": "^5.3.1",
"npm-run-all": "^4.1.5",
"sinon": "^15.0.1",
"sinon": "^16.0.0",
"sinon-chrome": "^3.0.1",
"type-fest": "^3.5.3",
"typescript": "^4.9.4",
"xo": "^0.53.1"
"type-fest": "^4.3.1",
"typescript": "^5.2.2",
"xo": "^0.56.0"
}
}
2 changes: 1 addition & 1 deletion test/index.js
Expand Up @@ -168,7 +168,7 @@ test.serial('migrations alter the stored options', async t => {
savedOptions.size += 10;
},
savedOptions => {
if (typeof savedOptions.size !== 'undefined') {
if (savedOptions.size !== undefined) {
savedOptions.minSize = savedOptions.size;
delete savedOptions.size;
}
Expand Down

0 comments on commit bad1c3a

Please sign in to comment.