aboutsummaryrefslogtreecommitdiff
path: root/src/shared/settings/Search.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2020-04-13 20:37:36 +0900
commite1dac618a8b8929f601c7ec8aca3842c5ebf9d03 (patch)
tree6a914a8243c8c02e7752a83667a54d3fa832955c /src/shared/settings/Search.ts
parent685f2b7b69218b06b5bb676069e35f79c5048c9b (diff)
Use plugin:prettier/recommended
Diffstat (limited to 'src/shared/settings/Search.ts')
-rw-r--r--src/shared/settings/Search.ts10
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) {