docs(transformer): fix formatting of README (#6111)

This commit is contained in:
overlookmotel 2024-09-27 14:27:21 +01:00 committed by GitHub
parent 26a273a462
commit e2c5baf868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,8 +9,8 @@ import assert from 'assert';
import oxc from 'oxc-transform';
const { code, declaration, errors } = oxc.transform(
"test.ts",
"class A<T> {}",
'test.ts',
'class A<T> {}',
{
typescript: {
declaration: true, // With isolated declarations in a single step.
@ -18,8 +18,8 @@ const { code, declaration, errors } = oxc.transform(
},
);
assert.equal(code, "class A {}\n");
assert.equal(declaration, "declare class A<T> {}\n");
assert.equal(code, 'class A {}\n');
assert.equal(declaration, 'declare class A<T> {}\n');
assert(errors.length == 0);
```
@ -45,9 +45,9 @@ See `index.d.ts`.
```typescript
export declare function transform(
filename: string,
sourceText: string,
options?: TransformOptions
filename: string,
sourceText: string,
options?: TransformOptions,
): TransformResult;
export function isolatedDeclaration(