ts-const-value-transformer 0.4.0 → 0.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.4.1
4
+
5
+ Fix for not hositing some more unary expressions and parenthesized expression
6
+
3
7
  ## v0.4.0
4
8
 
5
9
  Add `unsafeHoistWritableValues` option to prevent from hoisting non-const values with literal type unexpectedly
@@ -33,9 +33,17 @@ function visitNodeAndReplaceIfNeeded(node, sourceFile, program, context, options
33
33
  }
34
34
  if (ts.isLiteralExpression(node) ||
35
35
  ts.isObjectLiteralExpression(node) ||
36
+ // UnaryExpression start
36
37
  ts.isPrefixUnaryExpression(node) ||
37
38
  ts.isPostfixUnaryExpression(node) ||
39
+ ts.isDeleteExpression(node) ||
40
+ ts.isTypeOfExpression(node) ||
41
+ ts.isVoidExpression(node) ||
42
+ ts.isAwaitExpression(node) ||
43
+ ts.isTypeAssertionExpression(node) ||
44
+ // UnaryExpression end
38
45
  ts.isBinaryExpression(node) ||
46
+ ts.isParenthesizedExpression(node) ||
39
47
  ts.isConditionalExpression(node) ||
40
48
  ts.isVoidExpression(node) ||
41
49
  ts.isSpreadElement(node) ||
@@ -1,2 +1,2 @@
1
- declare const _default: "0.4.0";
1
+ declare const _default: "0.4.1";
2
2
  export default _default;
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export default '0.4.0';
1
+ export default '0.4.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-const-value-transformer",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "engines": {
5
5
  "node": ">=20.19.3"
6
6
  },