amaro 0.0.2 → 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 +8 -34
- 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,45 +553,19 @@ module.exports.__wasm = wasm;
|
|
|
553
553
|
|
|
554
554
|
}),
|
|
555
555
|
"163": (function (module, __unused_webpack_exports, __webpack_require__) {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
Object.defineProperty(obj, key, {
|
|
559
|
-
value: value,
|
|
560
|
-
enumerable: true,
|
|
561
|
-
configurable: true,
|
|
562
|
-
writable: true
|
|
563
|
-
});
|
|
564
|
-
} else {
|
|
565
|
-
obj[key] = value;
|
|
566
|
-
}
|
|
567
|
-
return obj;
|
|
568
|
-
}
|
|
569
|
-
function _object_spread(target) {
|
|
570
|
-
for(var i = 1; i < arguments.length; i++){
|
|
571
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
572
|
-
var ownKeys = Object.keys(source);
|
|
573
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
574
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
575
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
576
|
-
}));
|
|
577
|
-
}
|
|
578
|
-
ownKeys.forEach(function(key) {
|
|
579
|
-
_define_property(target, key, source[key]);
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
|
-
return target;
|
|
583
|
-
}
|
|
584
|
-
var transformSync = (__webpack_require__(858)/* .transformSync */.transformSync);
|
|
585
|
-
var DEFAULT_OPTIONS = {
|
|
556
|
+
const swc = __webpack_require__(858);
|
|
557
|
+
const DEFAULT_OPTIONS = {
|
|
586
558
|
mode: "strip-only"
|
|
587
559
|
};
|
|
588
560
|
// biome-ignore lint/suspicious/noExplicitAny: Swc types are not available
|
|
589
|
-
function
|
|
590
|
-
|
|
591
|
-
|
|
561
|
+
function transformSync(source, options) {
|
|
562
|
+
return swc.transformSync(source, {
|
|
563
|
+
...DEFAULT_OPTIONS,
|
|
564
|
+
...options
|
|
565
|
+
});
|
|
592
566
|
}
|
|
593
567
|
module.exports = {
|
|
594
|
-
|
|
568
|
+
transformSync
|
|
595
569
|
};
|
|
596
570
|
|
|
597
571
|
|