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

Update dependencies #68

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 5 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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