hermes-transform 0.32.1 → 0.33.0

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.
@@ -133,6 +133,8 @@ var _exportNames = {
133
133
  MatchExpression: true,
134
134
  MatchExpressionCase: true,
135
135
  MatchIdentifierPattern: true,
136
+ MatchInstanceObjectPattern: true,
137
+ MatchInstancePattern: true,
136
138
  MatchLiteralPattern: true,
137
139
  MatchMemberPattern: true,
138
140
  MatchObjectPattern: true,
@@ -146,6 +148,7 @@ var _exportNames = {
146
148
  MetaProperty: true,
147
149
  MethodDefinition: true,
148
150
  MixedTypeAnnotation: true,
151
+ NeverTypeAnnotation: true,
149
152
  NewExpression: true,
150
153
  NullableTypeAnnotation: true,
151
154
  NullLiteralTypeAnnotation: true,
@@ -166,6 +169,13 @@ var _exportNames = {
166
169
  PropertyDefinition: true,
167
170
  QualifiedTypeIdentifier: true,
168
171
  QualifiedTypeofIdentifier: true,
172
+ RecordDeclaration: true,
173
+ RecordDeclarationBody: true,
174
+ RecordDeclarationImplements: true,
175
+ RecordDeclarationProperty: true,
176
+ RecordDeclarationStaticProperty: true,
177
+ RecordExpression: true,
178
+ RecordExpressionProperties: true,
169
179
  RestElement: true,
170
180
  ReturnStatement: true,
171
181
  SequenceExpression: true,
@@ -196,7 +206,9 @@ var _exportNames = {
196
206
  TypeParameterInstantiation: true,
197
207
  TypePredicate: true,
198
208
  UnaryExpression: true,
209
+ UndefinedTypeAnnotation: true,
199
210
  UnionTypeAnnotation: true,
211
+ UnknownTypeAnnotation: true,
200
212
  UpdateExpression: true,
201
213
  VariableDeclaration: true,
202
214
  VariableDeclarator: true,
@@ -314,6 +326,8 @@ exports.MatchBindingPattern = MatchBindingPattern;
314
326
  exports.MatchExpression = MatchExpression;
315
327
  exports.MatchExpressionCase = MatchExpressionCase;
316
328
  exports.MatchIdentifierPattern = MatchIdentifierPattern;
329
+ exports.MatchInstanceObjectPattern = MatchInstanceObjectPattern;
330
+ exports.MatchInstancePattern = MatchInstancePattern;
317
331
  exports.MatchLiteralPattern = MatchLiteralPattern;
318
332
  exports.MatchMemberPattern = MatchMemberPattern;
319
333
  exports.MatchObjectPattern = MatchObjectPattern;
@@ -327,6 +341,7 @@ exports.MatchWildcardPattern = MatchWildcardPattern;
327
341
  exports.MetaProperty = MetaProperty;
328
342
  exports.MethodDefinition = MethodDefinition;
329
343
  exports.MixedTypeAnnotation = MixedTypeAnnotation;
344
+ exports.NeverTypeAnnotation = NeverTypeAnnotation;
330
345
  exports.NewExpression = NewExpression;
331
346
  exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
332
347
  exports.NullableTypeAnnotation = NullableTypeAnnotation;
@@ -347,6 +362,13 @@ exports.Property = Property;
347
362
  exports.PropertyDefinition = PropertyDefinition;
348
363
  exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
349
364
  exports.QualifiedTypeofIdentifier = QualifiedTypeofIdentifier;
365
+ exports.RecordDeclaration = RecordDeclaration;
366
+ exports.RecordDeclarationBody = RecordDeclarationBody;
367
+ exports.RecordDeclarationImplements = RecordDeclarationImplements;
368
+ exports.RecordDeclarationProperty = RecordDeclarationProperty;
369
+ exports.RecordDeclarationStaticProperty = RecordDeclarationStaticProperty;
370
+ exports.RecordExpression = RecordExpression;
371
+ exports.RecordExpressionProperties = RecordExpressionProperties;
350
372
  exports.RestElement = RestElement;
351
373
  exports.ReturnStatement = ReturnStatement;
352
374
  exports.SequenceExpression = SequenceExpression;
@@ -377,7 +399,9 @@ exports.TypeParameterInstantiation = TypeParameterInstantiation;
377
399
  exports.TypePredicate = TypePredicate;
378
400
  exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
379
401
  exports.UnaryExpression = UnaryExpression;
402
+ exports.UndefinedTypeAnnotation = UndefinedTypeAnnotation;
380
403
  exports.UnionTypeAnnotation = UnionTypeAnnotation;
404
+ exports.UnknownTypeAnnotation = UnknownTypeAnnotation;
381
405
  exports.UpdateExpression = UpdateExpression;
382
406
  exports.VariableDeclaration = VariableDeclaration;
383
407
  exports.VariableDeclarator = VariableDeclarator;
@@ -581,7 +605,7 @@ function ClassExpression(props) {
581
605
  id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
582
606
  typeParameters: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeParameters),
583
607
  superClass: (0, _detachedNode.asDetachedNodeForCodeGen)(props.superClass),
584
- superTypeParameters: (0, _detachedNode.asDetachedNodeForCodeGen)(props.superTypeParameters),
608
+ superTypeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.superTypeArguments),
585
609
  implements: props.implements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
586
610
  decorators: props.decorators.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
587
611
  body: (0, _detachedNode.asDetachedNodeForCodeGen)(props.body)
@@ -1498,6 +1522,26 @@ function MatchIdentifierPattern(props) {
1498
1522
  return node;
1499
1523
  }
1500
1524
 
1525
+ function MatchInstanceObjectPattern(props) {
1526
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1527
+ type: 'MatchInstanceObjectPattern',
1528
+ properties: props.properties.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
1529
+ rest: (0, _detachedNode.asDetachedNodeForCodeGen)(props.rest)
1530
+ });
1531
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1532
+ return node;
1533
+ }
1534
+
1535
+ function MatchInstancePattern(props) {
1536
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1537
+ type: 'MatchInstancePattern',
1538
+ targetConstructor: (0, _detachedNode.asDetachedNodeForCodeGen)(props.targetConstructor),
1539
+ properties: (0, _detachedNode.asDetachedNodeForCodeGen)(props.properties)
1540
+ });
1541
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1542
+ return node;
1543
+ }
1544
+
1501
1545
  function MatchLiteralPattern(props) {
1502
1546
  const node = (0, _detachedNode.detachedProps)(props.parent, {
1503
1547
  type: 'MatchLiteralPattern',
@@ -1624,6 +1668,13 @@ function MixedTypeAnnotation(props = { ...null
1624
1668
  });
1625
1669
  }
1626
1670
 
1671
+ function NeverTypeAnnotation(props = { ...null
1672
+ }) {
1673
+ return (0, _detachedNode.detachedProps)(props.parent, {
1674
+ type: 'NeverTypeAnnotation'
1675
+ });
1676
+ }
1677
+
1627
1678
  function NewExpression(props) {
1628
1679
  const node = (0, _detachedNode.detachedProps)(props.parent, {
1629
1680
  type: 'NewExpression',
@@ -1843,6 +1894,79 @@ function QualifiedTypeofIdentifier(props) {
1843
1894
  return node;
1844
1895
  }
1845
1896
 
1897
+ function RecordDeclaration(props) {
1898
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1899
+ type: 'RecordDeclaration',
1900
+ id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
1901
+ typeParameters: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeParameters),
1902
+ implements: props.implements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
1903
+ body: (0, _detachedNode.asDetachedNodeForCodeGen)(props.body)
1904
+ });
1905
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1906
+ return node;
1907
+ }
1908
+
1909
+ function RecordDeclarationBody(props) {
1910
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1911
+ type: 'RecordDeclarationBody',
1912
+ elements: props.elements.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n))
1913
+ });
1914
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1915
+ return node;
1916
+ }
1917
+
1918
+ function RecordDeclarationImplements(props) {
1919
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1920
+ type: 'RecordDeclarationImplements',
1921
+ id: (0, _detachedNode.asDetachedNodeForCodeGen)(props.id),
1922
+ typeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeArguments)
1923
+ });
1924
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1925
+ return node;
1926
+ }
1927
+
1928
+ function RecordDeclarationProperty(props) {
1929
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1930
+ type: 'RecordDeclarationProperty',
1931
+ key: (0, _detachedNode.asDetachedNodeForCodeGen)(props.key),
1932
+ typeAnnotation: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeAnnotation),
1933
+ defaultValue: (0, _detachedNode.asDetachedNodeForCodeGen)(props.defaultValue)
1934
+ });
1935
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1936
+ return node;
1937
+ }
1938
+
1939
+ function RecordDeclarationStaticProperty(props) {
1940
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1941
+ type: 'RecordDeclarationStaticProperty',
1942
+ key: (0, _detachedNode.asDetachedNodeForCodeGen)(props.key),
1943
+ typeAnnotation: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeAnnotation),
1944
+ value: (0, _detachedNode.asDetachedNodeForCodeGen)(props.value)
1945
+ });
1946
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1947
+ return node;
1948
+ }
1949
+
1950
+ function RecordExpression(props) {
1951
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1952
+ type: 'RecordExpression',
1953
+ recordConstructor: (0, _detachedNode.asDetachedNodeForCodeGen)(props.recordConstructor),
1954
+ typeArguments: (0, _detachedNode.asDetachedNodeForCodeGen)(props.typeArguments),
1955
+ properties: (0, _detachedNode.asDetachedNodeForCodeGen)(props.properties)
1956
+ });
1957
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1958
+ return node;
1959
+ }
1960
+
1961
+ function RecordExpressionProperties(props) {
1962
+ const node = (0, _detachedNode.detachedProps)(props.parent, {
1963
+ type: 'RecordExpressionProperties',
1964
+ properties: props.properties.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n))
1965
+ });
1966
+ (0, _detachedNode.setParentPointersInDirectChildren)(node);
1967
+ return node;
1968
+ }
1969
+
1846
1970
  function RestElement(props) {
1847
1971
  const node = (0, _detachedNode.detachedProps)(props.parent, {
1848
1972
  type: 'RestElement',
@@ -1996,7 +2120,7 @@ function TryStatement(props) {
1996
2120
  function TupleTypeAnnotation(props) {
1997
2121
  const node = (0, _detachedNode.detachedProps)(props.parent, {
1998
2122
  type: 'TupleTypeAnnotation',
1999
- types: props.types.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
2123
+ elementTypes: props.elementTypes.map(n => (0, _detachedNode.asDetachedNodeForCodeGen)(n)),
2000
2124
  inexact: props.inexact
2001
2125
  });
2002
2126
  (0, _detachedNode.setParentPointersInDirectChildren)(node);
@@ -2129,6 +2253,13 @@ function UnaryExpression(props) {
2129
2253
  return node;
2130
2254
  }
2131
2255
 
2256
+ function UndefinedTypeAnnotation(props = { ...null
2257
+ }) {
2258
+ return (0, _detachedNode.detachedProps)(props.parent, {
2259
+ type: 'UndefinedTypeAnnotation'
2260
+ });
2261
+ }
2262
+
2132
2263
  function UnionTypeAnnotation(props) {
2133
2264
  const node = (0, _detachedNode.detachedProps)(props.parent, {
2134
2265
  type: 'UnionTypeAnnotation',
@@ -2138,6 +2269,13 @@ function UnionTypeAnnotation(props) {
2138
2269
  return node;
2139
2270
  }
2140
2271
 
2272
+ function UnknownTypeAnnotation(props = { ...null
2273
+ }) {
2274
+ return (0, _detachedNode.detachedProps)(props.parent, {
2275
+ type: 'UnknownTypeAnnotation'
2276
+ });
2277
+ }
2278
+
2141
2279
  function UpdateExpression(props) {
2142
2280
  const node = (0, _detachedNode.detachedProps)(props.parent, {
2143
2281
  type: 'UpdateExpression',
@@ -55,7 +55,7 @@ function ClassDeclaration(props) {
55
55
  // $FlowFixMe[incompatible-type]
56
56
  superClass: (0, _detachedNode.asDetachedNode)(props.superClass),
57
57
  // $FlowFixMe[incompatible-type]
58
- superTypeParameters: (0, _detachedNode.asDetachedNode)(props.superTypeParameters),
58
+ superTypeArguments: (0, _detachedNode.asDetachedNode)(props.superTypeArguments),
59
59
  decorators: ((_props$decorators = props.decorators) != null ? _props$decorators : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
60
60
  implements: ((_props$implements = props.implements) != null ? _props$implements : []).map(n => (0, _detachedNode.asDetachedNode)(n)),
61
61
  body: (0, _detachedNode.asDetachedNode)(props.body)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-transform",
3
- "version": "0.32.1",
3
+ "version": "0.33.0",
4
4
  "description": "Tools built on top of Hermes-ESTree to enable codebase transformation",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -12,9 +12,9 @@
12
12
  "@babel/code-frame": "^7.16.0",
13
13
  "esquery": "^1.4.0",
14
14
  "flow-enums-runtime": "^0.0.6",
15
- "hermes-eslint": "0.32.1",
16
- "hermes-estree": "0.32.1",
17
- "hermes-parser": "0.32.1",
15
+ "hermes-eslint": "0.33.0",
16
+ "hermes-estree": "0.33.0",
17
+ "hermes-parser": "0.33.0",
18
18
  "string-width": "4.2.3"
19
19
  },
20
20
  "peerDependencies": {