watr 4.5.1 → 4.5.3
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/dist/watr.js +134 -99
- package/dist/watr.min.js +6 -6
- package/package.json +1 -1
- package/src/compile.js +9 -2
- package/src/const.js +2 -2
- package/src/encode.js +33 -12
- package/src/optimize.js +119 -85
- package/types/src/const.d.ts +2 -0
- package/types/src/encode.d.ts.map +1 -1
- package/types/src/optimize.d.ts +13 -0
- package/types/src/optimize.d.ts.map +1 -1
package/types/src/optimize.d.ts
CHANGED
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
* optimize(ast, { fold: true }) // explicit
|
|
12
12
|
*/
|
|
13
13
|
export default function optimize(ast: any[] | string, opts?: boolean | string | any): any[];
|
|
14
|
+
/**
|
|
15
|
+
* Recursively count AST nodes — fast size heuristic without compiling.
|
|
16
|
+
* @param {any} node
|
|
17
|
+
* @returns {number}
|
|
18
|
+
*/
|
|
19
|
+
export function count(node: any): number;
|
|
20
|
+
/**
|
|
21
|
+
* Compile AST and measure binary size in bytes.
|
|
22
|
+
* @param {Array} ast
|
|
23
|
+
* @returns {number}
|
|
24
|
+
*/
|
|
25
|
+
export function binarySize(ast: any[]): number;
|
|
14
26
|
/**
|
|
15
27
|
* Remove unused functions, globals, types, tables.
|
|
16
28
|
* Keeps exports and their transitive dependencies.
|
|
@@ -174,4 +186,5 @@ export function packData(ast: any[]): any[];
|
|
|
174
186
|
* @returns {Array}
|
|
175
187
|
*/
|
|
176
188
|
export function minifyImports(ast: any[]): any[];
|
|
189
|
+
export { count as size };
|
|
177
190
|
//# sourceMappingURL=optimize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimize.d.ts","sourceRoot":"","sources":["../../src/optimize.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"optimize.d.ts","sourceRoot":"","sources":["../../src/optimize.js"],"names":[],"mappings":"AAuhEA;;;;;;;;;;;GAWG;AACH,sCATW,QAAM,MAAM,SACZ,OAAO,GAAC,MAAM,MAAO,SAkE/B;AArjED;;;;GAIG;AACH,4BAHW,GAAG,GACD,MAAM,CAOlB;AAED;;;;GAIG;AACH,wCAFa,MAAM,CAIlB;AAwGD;;;;;GAKG;AACH,6CAgJC;AA6ID;;;;GAIG;AACH,wCAwBC;AAoMD;;;;GAIG;AACH,4CAqBC;AA+CD;;;;;GAKG;AACH,8CAmDC;AA7QD;;;;GAIG;AACH,4CASC;AAID;;;;GAIG;AACH,4CA6DC;AAID;;;;GAIG;AACH,0CAuCC;AA6VD;;;;GAIG;AACH,yCAsBC;AAID;;;;GAIG;AACH,0CAiGC;AAvjCD;;;;GAIG;AACH,gCAHW,OAAO,GAAC,MAAM,MAAO,OAa/B;;;;;;;;;;;;;;;;;;;;;;;;;AA4iCD;;;;;GAKG;AACH,0CAgDC;AAyED;;;;GAIG;AACH,4CAQC;AAID;;;;GAIG;AACH,2CAyCC;AAID,2EAA2E;AAC3E,sCAgEC;AAID;;;;GAIG;AACH,4CAuCC;AAID;;;;;GAKG;AACH,4CAqBC;AAID;;;;;;GAMG;AACH,wCAmBC;AAID;;;;;GAKG;AACH,4CAiDC;AAoCD;;;;;GAKG;AACH,0CA8DC;AAiWD,uCAyBC;AAtXD;;;;;GAKG;AACH,8CAyEC;AAoID;;;;GAIG;AACH,4CAyDC;AAqBD;;;;;GAKG;AACH,iDAgBC"}
|