amaro 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +12 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/package.json +5 -8
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -11,7 +11,18 @@ The main goal of this package is to provide a stable API for TypeScript parser,
|
|
|
11
11
|
To install Amaro, run:
|
|
12
12
|
|
|
13
13
|
```shell
|
|
14
|
-
npm install
|
|
14
|
+
npm install amaro
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## How to Use
|
|
18
|
+
|
|
19
|
+
By default Amaro exports a `transformSync` function that performs type stripping.
|
|
20
|
+
Stack traces are preserved, by replacing removed types with white spaces.
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
const amaro = require('amaro');
|
|
24
|
+
const { code } = amaro.transformSync("const foo: string = 'bar';");
|
|
25
|
+
console.log(code); // "const foo = 'bar';"
|
|
15
26
|
```
|
|
16
27
|
|
|
17
28
|
## License (MIT)
|
package/dist/index.js
CHANGED
|
@@ -553,20 +553,19 @@ module.exports.__wasm = wasm;
|
|
|
553
553
|
|
|
554
554
|
}),
|
|
555
555
|
"163": (function (module, __unused_webpack_exports, __webpack_require__) {
|
|
556
|
-
const
|
|
556
|
+
const swc = __webpack_require__(858);
|
|
557
557
|
const DEFAULT_OPTIONS = {
|
|
558
558
|
mode: "strip-only"
|
|
559
559
|
};
|
|
560
560
|
// biome-ignore lint/suspicious/noExplicitAny: Swc types are not available
|
|
561
|
-
function
|
|
562
|
-
|
|
561
|
+
function transformSync(source, options) {
|
|
562
|
+
return swc.transformSync(source, {
|
|
563
563
|
...DEFAULT_OPTIONS,
|
|
564
564
|
...options
|
|
565
565
|
});
|
|
566
|
-
return code;
|
|
567
566
|
}
|
|
568
567
|
module.exports = {
|
|
569
|
-
|
|
568
|
+
transformSync
|
|
570
569
|
};
|
|
571
570
|
|
|
572
571
|
|