diff options
Diffstat (limited to 'src/shared/settings/Search.ts')
-rw-r--r-- | src/shared/settings/Search.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shared/settings/Search.ts b/src/shared/settings/Search.ts index 7de03de..b25aa78 100644 --- a/src/shared/settings/Search.ts +++ b/src/shared/settings/Search.ts @@ -6,16 +6,12 @@ export type SearchJSON = { }; export default class Search { - constructor( - public defaultEngine: string, - public engines: Entries, - ) { - } + constructor(public defaultEngine: string, public engines: Entries) {} static fromJSON(json: SearchJSON): Search { for (const [name, url] of Object.entries(json.engines)) { - if (!(/^[a-zA-Z0-9]+$/).test(name)) { - throw new TypeError('Search engine\'s name must be [a-zA-Z0-9]+'); + if (!/^[a-zA-Z0-9]+$/.test(name)) { + throw new TypeError("Search engine's name must be [a-zA-Z0-9]+"); } const matches = url.match(/{}/g); if (matches === null) { |