Perf/Refactor: faster ip version

This commit is contained in:
SukkaW
2025-01-22 20:04:41 +08:00
parent 07419a7942
commit e19d7989c3
6 changed files with 37 additions and 24 deletions

View File

@@ -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}`);