mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-28 17:41:54 +08:00
Perf/Refactor: faster ip version
This commit is contained in:
@@ -147,7 +147,7 @@ async function transformRuleset(parentSpan: Span, sourcePath: string, relativePa
|
||||
if (res === $skip) return;
|
||||
|
||||
const id = basename;
|
||||
const type = relativePath.slice(0, -extname.length).split(path.sep)[0];
|
||||
const type = relativePath.split(path.sep)[0];
|
||||
|
||||
if (type !== 'ip' && type !== 'non_ip') {
|
||||
throw new TypeError(`Invalid type: ${type}`);
|
||||
|
||||
Reference in New Issue
Block a user