flow-api-translator 0.23.0 → 0.23.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.
@@ -975,7 +975,9 @@ const getTransforms = (originalCode, opts) => {
975
975
  objectType: base,
976
976
  indexType: constructFlowNode({
977
977
  type: 'StringLiteralTypeAnnotation',
978
+ // $FlowFixMe[incompatible-call]
978
979
  value: name,
980
+ // $FlowFixMe[incompatible-type]
979
981
  raw: `'${name}'`
980
982
  })
981
983
  });
@@ -1058,7 +1058,9 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
1058
1058
  objectType: base,
1059
1059
  indexType: constructFlowNode<FlowESTree.StringLiteralTypeAnnotation>({
1060
1060
  type: 'StringLiteralTypeAnnotation',
1061
+ // $FlowFixMe[incompatible-call]
1061
1062
  value: name,
1063
+ // $FlowFixMe[incompatible-type]
1062
1064
  raw: `'${name}'`,
1063
1065
  }),
1064
1066
  });
@@ -803,8 +803,9 @@ function convertSuperClass(superClass, superTypeParameters, context) {
803
803
  }
804
804
 
805
805
  case 'TypeCastExpression':
806
+ case 'AsExpression':
806
807
  {
807
- const typeAnnotation = superClass.typeAnnotation.typeAnnotation;
808
+ const typeAnnotation = superClass.type === 'TypeCastExpression' ? superClass.typeAnnotation.typeAnnotation : superClass.typeAnnotation;
808
809
 
809
810
  if (typeAnnotation.type === 'GenericTypeAnnotation') {
810
811
  return convertSuperClassHelper((0, _hermesTransform.asDetachedNode)(typeAnnotation.id), typeAnnotation, superTypeParameters, context);
@@ -1047,8 +1047,12 @@ function convertSuperClass(
1047
1047
  context,
1048
1048
  );
1049
1049
  }
1050
- case 'TypeCastExpression': {
1051
- const typeAnnotation = superClass.typeAnnotation.typeAnnotation;
1050
+ case 'TypeCastExpression':
1051
+ case 'AsExpression': {
1052
+ const typeAnnotation =
1053
+ superClass.type === 'TypeCastExpression'
1054
+ ? superClass.typeAnnotation.typeAnnotation
1055
+ : superClass.typeAnnotation;
1052
1056
 
1053
1057
  if (typeAnnotation.type === 'GenericTypeAnnotation') {
1054
1058
  return convertSuperClassHelper(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-api-translator",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "Toolkit for creating Flow and TypeScript compatible libraries from Flow source code.",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -13,10 +13,10 @@
13
13
  "@typescript-eslint/parser": "7.2.0",
14
14
  "@typescript-eslint/visitor-keys": "7.2.0",
15
15
  "flow-enums-runtime": "^0.0.6",
16
- "hermes-eslint": "0.23.0",
17
- "hermes-estree": "0.23.0",
18
- "hermes-parser": "0.23.0",
19
- "hermes-transform": "0.23.0",
16
+ "hermes-eslint": "0.23.1",
17
+ "hermes-estree": "0.23.1",
18
+ "hermes-parser": "0.23.1",
19
+ "hermes-transform": "0.23.1",
20
20
  "typescript": "5.3.2"
21
21
  },
22
22
  "peerDependencies": {