mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-18 06:17:23 +08:00
3bc1cc248d
* chore: bump to msw v3 * refactor: anti-slop * test: use vi.stubEnv for REDIS_URL in redis error test * refactor: move remote debugging registration into a conditional block * chore: add code coverage upload for github
12 lines
373 B
TypeScript
12 lines
373 B
TypeScript
import { parseSync, rawTransferSupported } from 'oxc-parser';
|
|
|
|
export const parseScriptSource = (source: string) => {
|
|
const { program, errors } = parseSync('script.js', source, {
|
|
lang: 'js',
|
|
sourceType: 'script',
|
|
preserveParens: false,
|
|
experimentalRawTransfer: rawTransferSupported(),
|
|
} as never);
|
|
return { program, errors };
|
|
};
|