Skip to content

Commit

Permalink
Loosen TypeScript types for set method
Browse files Browse the repository at this point in the history
It fails to accept a whole regular TOptions for some reason
  • Loading branch information
fregante committed Jul 25, 2019
1 parent f66da00 commit 23fd947
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {RequireAtLeastOne} from 'type-fest';
import {isBackgroundPage} from 'webext-detect-page';

interface Settings<TOptions extends Options> {
Expand Down Expand Up @@ -162,7 +161,7 @@ class OptionsSync<TOptions extends Options> {
@param newOptions - A map of default options as strings or booleans. The keys will have to match the form fields' `name` attributes.
*/
async set(newOptions: RequireAtLeastOne<TOptions>): Promise<void> {
async set(newOptions: Partial<TOptions>): Promise<void> {
return this.setAll({...await this.getAll(), ...newOptions});
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
}
},
"dependencies": {
"type-fest": "^0.5.2",
"webext-detect-page": "^0.9.1"
},
"devDependencies": {
Expand Down

0 comments on commit 23fd947

Please sign in to comment.