flow-api-translator 0.37.0 → 0.328.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.
@@ -10,12 +10,12 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {ObjectWithLoc} from 'hermes-estree';
13
+ import type {ObjectWithLoc} from 'flow-estree';
14
14
  import type {TranslationOptions} from './utils/TranslationUtils';
15
15
 
16
- import * as FlowESTree from 'hermes-estree';
16
+ import * as FlowESTree from 'flow-estree';
17
17
  import * as TSESTree from './utils/ts-estree-ast-types';
18
- import {makeCommentOwnLine as makeCommentOwnLineOriginal} from 'hermes-transform';
18
+ import {makeCommentOwnLine as makeCommentOwnLineOriginal} from 'flow-transform';
19
19
  import {
20
20
  buildCodeFrame,
21
21
  translationError as translationErrorBase,
@@ -546,6 +546,7 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
546
546
  },
547
547
  optional: false,
548
548
  },
549
+ implicitDeclare: false,
549
550
  predicate: null,
550
551
  });
551
552
  }
@@ -873,6 +874,7 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
873
874
  },
874
875
  optional: false,
875
876
  },
877
+ implicitDeclare: false,
876
878
  predicate: null,
877
879
  });
878
880
  }
@@ -1325,8 +1327,11 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
1325
1327
  }
1326
1328
  return constructFlowNode<FlowESTree.DeclareNamespace>({
1327
1329
  type: 'DeclareNamespace',
1330
+ global: false,
1328
1331
  id: Transform.Identifier(node.id),
1329
1332
  body,
1333
+ implicitDeclare: false,
1334
+ keyword: 'namespace',
1330
1335
  });
1331
1336
  }
1332
1337
 
@@ -2048,8 +2053,15 @@ const getTransforms = (originalCode: string, opts: TranslationOptions) => {
2048
2053
  }
2049
2054
  return constructFlowNode<FlowESTree.DeclareVariable>({
2050
2055
  type: 'DeclareVariable',
2051
- id,
2056
+ declarations: [
2057
+ constructFlowNode<FlowESTree.VariableDeclarator>({
2058
+ type: 'VariableDeclarator',
2059
+ id,
2060
+ init: null,
2061
+ }),
2062
+ ],
2052
2063
  kind: node.kind,
2064
+ implicitDeclare: false,
2053
2065
  });
2054
2066
  });
2055
2067
  }