Update file.ts

This commit is contained in:
aisouler
2024-02-23 21:44:36 +08:00
parent e6103bfcee
commit a3a9cfa458

View File

@@ -130,7 +130,7 @@ export async function* walk(dirPath: string) {
export const validSnapshotUrl = (s: string) => { export const validSnapshotUrl = (s: string) => {
const u = new URL(s); const u = new URL(s);
return u.pathname.startsWith('/import/') || u.pathname.startsWith('/i/'); return u.pathname.startsWith('/i/');
}; };
export const checkConfig = (newConfig: RawSubscription) => { export const checkConfig = (newConfig: RawSubscription) => {
@@ -284,7 +284,7 @@ export const checkConfig = (newConfig: RawSubscription) => {
groupKey: g.key, groupKey: g.key,
}); });
throw new Error( throw new Error(
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/i/12506571 or https://i.gkd.li/i/14362119`, `invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/i/12506571`,
); );
} }
}); });
@@ -299,7 +299,7 @@ export const checkConfig = (newConfig: RawSubscription) => {
ruleKey: r.key, ruleKey: r.key,
}); });
throw new Error( throw new Error(
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/i/12506571 or https://i.gkd.li/i/14362119`, `invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/i/12506571`,
); );
} }
}); });