From adee0d1876b696cb57b58e32290e098452320413 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 3 Dec 2024 22:37:49 +0800 Subject: [PATCH] chore(npm/oxc-parser): update README --- npm/oxc-parser/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/npm/oxc-parser/README.md b/npm/oxc-parser/README.md index d186f98d1ca82..02d7a9a172566 100644 --- a/npm/oxc-parser/README.md +++ b/npm/oxc-parser/README.md @@ -7,12 +7,11 @@ import assert from 'assert'; import oxc from 'oxc-parser'; const sourceText = "let foo: Foo = 'foo';"; -// Filename extension is used to determine which -// dialect to parse source as -const options = { sourceFilename: 'text.tsx' }; +// Filename extension is used to determine which dialect to parse source as. +const filename = "test.tsx"; -test(oxc.parseSync(sourceText, options)); -test(await oxc.parseAsync(sourceText, options)); +test(oxc.parseSync(filename, sourceText, options)); +test(await oxc.parseAsync(filename, sourceText, options)); function test(ret) { assert(ret.program.body.length == 1);