@react-native/codegen 0.75.0-rc.6 → 0.75.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,33 +10,32 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- function _defineProperty(obj, key, value) {
14
- key = _toPropertyKey(key);
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
13
+ function _defineProperty(e, r, t) {
14
+ return (
15
+ (r = _toPropertyKey(r)) in e
16
+ ? Object.defineProperty(e, r, {
17
+ value: t,
18
+ enumerable: !0,
19
+ configurable: !0,
20
+ writable: !0,
21
+ })
22
+ : (e[r] = t),
23
+ e
24
+ );
26
25
  }
27
- function _toPropertyKey(arg) {
28
- var key = _toPrimitive(arg, 'string');
29
- return typeof key === 'symbol' ? key : String(key);
26
+ function _toPropertyKey(t) {
27
+ var i = _toPrimitive(t, 'string');
28
+ return 'symbol' == typeof i ? i : i + '';
30
29
  }
31
- function _toPrimitive(input, hint) {
32
- if (typeof input !== 'object' || input === null) return input;
33
- var prim = input[Symbol.toPrimitive];
34
- if (prim !== undefined) {
35
- var res = prim.call(input, hint || 'default');
36
- if (typeof res !== 'object') return res;
30
+ function _toPrimitive(t, r) {
31
+ if ('object' != typeof t || !t) return t;
32
+ var e = t[Symbol.toPrimitive];
33
+ if (void 0 !== e) {
34
+ var i = e.call(t, r || 'default');
35
+ if ('object' != typeof i) return i;
37
36
  throw new TypeError('@@toPrimitive must return a primitive value.');
38
37
  }
39
- return (hint === 'string' ? String : Number)(input);
38
+ return ('string' === r ? String : Number)(t);
40
39
  }
41
40
  import invariant from 'invariant';
42
41
  const _require = require('./errors'),
@@ -10,73 +10,65 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- function ownKeys(object, enumerableOnly) {
14
- var keys = Object.keys(object);
13
+ function ownKeys(e, r) {
14
+ var t = Object.keys(e);
15
15
  if (Object.getOwnPropertySymbols) {
16
- var symbols = Object.getOwnPropertySymbols(object);
17
- enumerableOnly &&
18
- (symbols = symbols.filter(function (sym) {
19
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
+ var o = Object.getOwnPropertySymbols(e);
17
+ r &&
18
+ (o = o.filter(function (r) {
19
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
20
20
  })),
21
- keys.push.apply(keys, symbols);
21
+ t.push.apply(t, o);
22
22
  }
23
- return keys;
23
+ return t;
24
24
  }
25
- function _objectSpread(target) {
26
- for (var i = 1; i < arguments.length; i++) {
27
- var source = null != arguments[i] ? arguments[i] : {};
28
- i % 2
29
- ? ownKeys(Object(source), !0).forEach(function (key) {
30
- _defineProperty(target, key, source[key]);
25
+ function _objectSpread(e) {
26
+ for (var r = 1; r < arguments.length; r++) {
27
+ var t = null != arguments[r] ? arguments[r] : {};
28
+ r % 2
29
+ ? ownKeys(Object(t), !0).forEach(function (r) {
30
+ _defineProperty(e, r, t[r]);
31
31
  })
32
32
  : Object.getOwnPropertyDescriptors
33
- ? Object.defineProperties(
34
- target,
35
- Object.getOwnPropertyDescriptors(source),
36
- )
37
- : ownKeys(Object(source)).forEach(function (key) {
38
- Object.defineProperty(
39
- target,
40
- key,
41
- Object.getOwnPropertyDescriptor(source, key),
42
- );
33
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t))
34
+ : ownKeys(Object(t)).forEach(function (r) {
35
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
43
36
  });
44
37
  }
45
- return target;
38
+ return e;
46
39
  }
47
- function _defineProperty(obj, key, value) {
48
- key = _toPropertyKey(key);
49
- if (key in obj) {
50
- Object.defineProperty(obj, key, {
51
- value: value,
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- });
56
- } else {
57
- obj[key] = value;
58
- }
59
- return obj;
40
+ function _defineProperty(e, r, t) {
41
+ return (
42
+ (r = _toPropertyKey(r)) in e
43
+ ? Object.defineProperty(e, r, {
44
+ value: t,
45
+ enumerable: !0,
46
+ configurable: !0,
47
+ writable: !0,
48
+ })
49
+ : (e[r] = t),
50
+ e
51
+ );
60
52
  }
61
- function _toPropertyKey(arg) {
62
- var key = _toPrimitive(arg, 'string');
63
- return typeof key === 'symbol' ? key : String(key);
53
+ function _toPropertyKey(t) {
54
+ var i = _toPrimitive(t, 'string');
55
+ return 'symbol' == typeof i ? i : i + '';
64
56
  }
65
- function _toPrimitive(input, hint) {
66
- if (typeof input !== 'object' || input === null) return input;
67
- var prim = input[Symbol.toPrimitive];
68
- if (prim !== undefined) {
69
- var res = prim.call(input, hint || 'default');
70
- if (typeof res !== 'object') return res;
57
+ function _toPrimitive(t, r) {
58
+ if ('object' != typeof t || !t) return t;
59
+ var e = t[Symbol.toPrimitive];
60
+ if (void 0 !== e) {
61
+ var i = e.call(t, r || 'default');
62
+ if ('object' != typeof i) return i;
71
63
  throw new TypeError('@@toPrimitive must return a primitive value.');
72
64
  }
73
- return (hint === 'string' ? String : Number)(input);
65
+ return ('string' === r ? String : Number)(t);
74
66
  }
75
- function _slicedToArray(arr, i) {
67
+ function _slicedToArray(r, e) {
76
68
  return (
77
- _arrayWithHoles(arr) ||
78
- _iterableToArrayLimit(arr, i) ||
79
- _unsupportedIterableToArray(arr, i) ||
69
+ _arrayWithHoles(r) ||
70
+ _iterableToArrayLimit(r, e) ||
71
+ _unsupportedIterableToArray(r, e) ||
80
72
  _nonIterableRest()
81
73
  );
82
74
  }
@@ -85,60 +77,64 @@ function _nonIterableRest() {
85
77
  'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
86
78
  );
87
79
  }
88
- function _unsupportedIterableToArray(o, minLen) {
89
- if (!o) return;
90
- if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
91
- var n = Object.prototype.toString.call(o).slice(8, -1);
92
- if (n === 'Object' && o.constructor) n = o.constructor.name;
93
- if (n === 'Map' || n === 'Set') return Array.from(o);
94
- if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
95
- return _arrayLikeToArray(o, minLen);
80
+ function _unsupportedIterableToArray(r, a) {
81
+ if (r) {
82
+ if ('string' == typeof r) return _arrayLikeToArray(r, a);
83
+ var t = {}.toString.call(r).slice(8, -1);
84
+ return (
85
+ 'Object' === t && r.constructor && (t = r.constructor.name),
86
+ 'Map' === t || 'Set' === t
87
+ ? Array.from(r)
88
+ : 'Arguments' === t ||
89
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
90
+ ? _arrayLikeToArray(r, a)
91
+ : void 0
92
+ );
93
+ }
96
94
  }
97
- function _arrayLikeToArray(arr, len) {
98
- if (len == null || len > arr.length) len = arr.length;
99
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
100
- return arr2;
95
+ function _arrayLikeToArray(r, a) {
96
+ (null == a || a > r.length) && (a = r.length);
97
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
98
+ return n;
101
99
  }
102
- function _iterableToArrayLimit(arr, i) {
103
- var _i =
104
- null == arr
100
+ function _iterableToArrayLimit(r, l) {
101
+ var t =
102
+ null == r
105
103
  ? null
106
- : ('undefined' != typeof Symbol && arr[Symbol.iterator]) ||
107
- arr['@@iterator'];
108
- if (null != _i) {
109
- var _s,
110
- _e,
111
- _x,
112
- _r,
113
- _arr = [],
114
- _n = !0,
115
- _d = !1;
104
+ : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
105
+ if (null != t) {
106
+ var e,
107
+ n,
108
+ i,
109
+ u,
110
+ a = [],
111
+ f = !0,
112
+ o = !1;
116
113
  try {
117
- if (((_x = (_i = _i.call(arr)).next), 0 === i)) {
118
- if (Object(_i) !== _i) return;
119
- _n = !1;
114
+ if (((i = (t = t.call(r)).next), 0 === l)) {
115
+ if (Object(t) !== t) return;
116
+ f = !1;
120
117
  } else
121
118
  for (
122
119
  ;
123
- !(_n = (_s = _x.call(_i)).done) &&
124
- (_arr.push(_s.value), _arr.length !== i);
125
- _n = !0
120
+ !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l);
121
+ f = !0
126
122
  );
127
- } catch (err) {
128
- (_d = !0), (_e = err);
123
+ } catch (r) {
124
+ (o = !0), (n = r);
129
125
  } finally {
130
126
  try {
131
- if (!_n && null != _i.return && ((_r = _i.return()), Object(_r) !== _r))
127
+ if (!f && null != t.return && ((u = t.return()), Object(u) !== u))
132
128
  return;
133
129
  } finally {
134
- if (_d) throw _e;
130
+ if (o) throw n;
135
131
  }
136
132
  }
137
- return _arr;
133
+ return a;
138
134
  }
139
135
  }
140
- function _arrayWithHoles(arr) {
141
- if (Array.isArray(arr)) return arr;
136
+ function _arrayWithHoles(r) {
137
+ if (Array.isArray(r)) return r;
142
138
  }
143
139
  const _require = require('./error-utils'),
144
140
  throwIfConfigNotfound = _require.throwIfConfigNotfound,
@@ -189,6 +185,9 @@ const _require3 = require('./utils'),
189
185
  verifyPlatforms = _require3.verifyPlatforms,
190
186
  visit = _require3.visit;
191
187
  const invariant = require('invariant');
188
+
189
+ // $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser
190
+
192
191
  function wrapModuleSchema(nativeModuleSchema, hasteModuleName) {
193
192
  return {
194
193
  modules: {
@@ -10,11 +10,11 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- function _slicedToArray(arr, i) {
13
+ function _slicedToArray(r, e) {
14
14
  return (
15
- _arrayWithHoles(arr) ||
16
- _iterableToArrayLimit(arr, i) ||
17
- _unsupportedIterableToArray(arr, i) ||
15
+ _arrayWithHoles(r) ||
16
+ _iterableToArrayLimit(r, e) ||
17
+ _unsupportedIterableToArray(r, e) ||
18
18
  _nonIterableRest()
19
19
  );
20
20
  }
@@ -23,60 +23,64 @@ function _nonIterableRest() {
23
23
  'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
24
24
  );
25
25
  }
26
- function _unsupportedIterableToArray(o, minLen) {
27
- if (!o) return;
28
- if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
29
- var n = Object.prototype.toString.call(o).slice(8, -1);
30
- if (n === 'Object' && o.constructor) n = o.constructor.name;
31
- if (n === 'Map' || n === 'Set') return Array.from(o);
32
- if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
33
- return _arrayLikeToArray(o, minLen);
34
- }
35
- function _arrayLikeToArray(arr, len) {
36
- if (len == null || len > arr.length) len = arr.length;
37
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
38
- return arr2;
39
- }
40
- function _iterableToArrayLimit(arr, i) {
41
- var _i =
42
- null == arr
26
+ function _unsupportedIterableToArray(r, a) {
27
+ if (r) {
28
+ if ('string' == typeof r) return _arrayLikeToArray(r, a);
29
+ var t = {}.toString.call(r).slice(8, -1);
30
+ return (
31
+ 'Object' === t && r.constructor && (t = r.constructor.name),
32
+ 'Map' === t || 'Set' === t
33
+ ? Array.from(r)
34
+ : 'Arguments' === t ||
35
+ /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
36
+ ? _arrayLikeToArray(r, a)
37
+ : void 0
38
+ );
39
+ }
40
+ }
41
+ function _arrayLikeToArray(r, a) {
42
+ (null == a || a > r.length) && (a = r.length);
43
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
44
+ return n;
45
+ }
46
+ function _iterableToArrayLimit(r, l) {
47
+ var t =
48
+ null == r
43
49
  ? null
44
- : ('undefined' != typeof Symbol && arr[Symbol.iterator]) ||
45
- arr['@@iterator'];
46
- if (null != _i) {
47
- var _s,
48
- _e,
49
- _x,
50
- _r,
51
- _arr = [],
52
- _n = !0,
53
- _d = !1;
50
+ : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
51
+ if (null != t) {
52
+ var e,
53
+ n,
54
+ i,
55
+ u,
56
+ a = [],
57
+ f = !0,
58
+ o = !1;
54
59
  try {
55
- if (((_x = (_i = _i.call(arr)).next), 0 === i)) {
56
- if (Object(_i) !== _i) return;
57
- _n = !1;
60
+ if (((i = (t = t.call(r)).next), 0 === l)) {
61
+ if (Object(t) !== t) return;
62
+ f = !1;
58
63
  } else
59
64
  for (
60
65
  ;
61
- !(_n = (_s = _x.call(_i)).done) &&
62
- (_arr.push(_s.value), _arr.length !== i);
63
- _n = !0
66
+ !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l);
67
+ f = !0
64
68
  );
65
- } catch (err) {
66
- (_d = !0), (_e = err);
69
+ } catch (r) {
70
+ (o = !0), (n = r);
67
71
  } finally {
68
72
  try {
69
- if (!_n && null != _i.return && ((_r = _i.return()), Object(_r) !== _r))
73
+ if (!f && null != t.return && ((u = t.return()), Object(u) !== u))
70
74
  return;
71
75
  } finally {
72
- if (_d) throw _e;
76
+ if (o) throw n;
73
77
  }
74
78
  }
75
- return _arr;
79
+ return a;
76
80
  }
77
81
  }
78
- function _arrayWithHoles(arr) {
79
- if (Array.isArray(arr)) return arr;
82
+ function _arrayWithHoles(r) {
83
+ if (Array.isArray(r)) return r;
80
84
  }
81
85
  const _require = require('./error-utils'),
82
86
  throwIfArrayElementTypeAnnotationIsUnsupported =
@@ -10,67 +10,59 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- function ownKeys(object, enumerableOnly) {
14
- var keys = Object.keys(object);
13
+ function ownKeys(e, r) {
14
+ var t = Object.keys(e);
15
15
  if (Object.getOwnPropertySymbols) {
16
- var symbols = Object.getOwnPropertySymbols(object);
17
- enumerableOnly &&
18
- (symbols = symbols.filter(function (sym) {
19
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
+ var o = Object.getOwnPropertySymbols(e);
17
+ r &&
18
+ (o = o.filter(function (r) {
19
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
20
20
  })),
21
- keys.push.apply(keys, symbols);
21
+ t.push.apply(t, o);
22
22
  }
23
- return keys;
23
+ return t;
24
24
  }
25
- function _objectSpread(target) {
26
- for (var i = 1; i < arguments.length; i++) {
27
- var source = null != arguments[i] ? arguments[i] : {};
28
- i % 2
29
- ? ownKeys(Object(source), !0).forEach(function (key) {
30
- _defineProperty(target, key, source[key]);
25
+ function _objectSpread(e) {
26
+ for (var r = 1; r < arguments.length; r++) {
27
+ var t = null != arguments[r] ? arguments[r] : {};
28
+ r % 2
29
+ ? ownKeys(Object(t), !0).forEach(function (r) {
30
+ _defineProperty(e, r, t[r]);
31
31
  })
32
32
  : Object.getOwnPropertyDescriptors
33
- ? Object.defineProperties(
34
- target,
35
- Object.getOwnPropertyDescriptors(source),
36
- )
37
- : ownKeys(Object(source)).forEach(function (key) {
38
- Object.defineProperty(
39
- target,
40
- key,
41
- Object.getOwnPropertyDescriptor(source, key),
42
- );
33
+ ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t))
34
+ : ownKeys(Object(t)).forEach(function (r) {
35
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
43
36
  });
44
37
  }
45
- return target;
38
+ return e;
46
39
  }
47
- function _defineProperty(obj, key, value) {
48
- key = _toPropertyKey(key);
49
- if (key in obj) {
50
- Object.defineProperty(obj, key, {
51
- value: value,
52
- enumerable: true,
53
- configurable: true,
54
- writable: true,
55
- });
56
- } else {
57
- obj[key] = value;
58
- }
59
- return obj;
40
+ function _defineProperty(e, r, t) {
41
+ return (
42
+ (r = _toPropertyKey(r)) in e
43
+ ? Object.defineProperty(e, r, {
44
+ value: t,
45
+ enumerable: !0,
46
+ configurable: !0,
47
+ writable: !0,
48
+ })
49
+ : (e[r] = t),
50
+ e
51
+ );
60
52
  }
61
- function _toPropertyKey(arg) {
62
- var key = _toPrimitive(arg, 'string');
63
- return typeof key === 'symbol' ? key : String(key);
53
+ function _toPropertyKey(t) {
54
+ var i = _toPrimitive(t, 'string');
55
+ return 'symbol' == typeof i ? i : i + '';
64
56
  }
65
- function _toPrimitive(input, hint) {
66
- if (typeof input !== 'object' || input === null) return input;
67
- var prim = input[Symbol.toPrimitive];
68
- if (prim !== undefined) {
69
- var res = prim.call(input, hint || 'default');
70
- if (typeof res !== 'object') return res;
57
+ function _toPrimitive(t, r) {
58
+ if ('object' != typeof t || !t) return t;
59
+ var e = t[Symbol.toPrimitive];
60
+ if (void 0 !== e) {
61
+ var i = e.call(t, r || 'default');
62
+ if ('object' != typeof i) return i;
71
63
  throw new TypeError('@@toPrimitive must return a primitive value.');
72
64
  }
73
- return (hint === 'string' ? String : Number)(input);
65
+ return ('string' === r ? String : Number)(t);
74
66
  }
75
67
  function wrapComponentSchema({
76
68
  filename,
@@ -430,7 +430,6 @@ function getSchemaInfo(property, types) {
430
430
  withNullDefault: false, // Just to make `getTypeAnnotation` signature match with the one from Flow
431
431
  };
432
432
  }
433
-
434
433
  function flattenProperties(typeDefinition, types, parser) {
435
434
  return typeDefinition
436
435
  .map(property => {
@@ -10,33 +10,32 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- function _defineProperty(obj, key, value) {
14
- key = _toPropertyKey(key);
15
- if (key in obj) {
16
- Object.defineProperty(obj, key, {
17
- value: value,
18
- enumerable: true,
19
- configurable: true,
20
- writable: true,
21
- });
22
- } else {
23
- obj[key] = value;
24
- }
25
- return obj;
13
+ function _defineProperty(e, r, t) {
14
+ return (
15
+ (r = _toPropertyKey(r)) in e
16
+ ? Object.defineProperty(e, r, {
17
+ value: t,
18
+ enumerable: !0,
19
+ configurable: !0,
20
+ writable: !0,
21
+ })
22
+ : (e[r] = t),
23
+ e
24
+ );
26
25
  }
27
- function _toPropertyKey(arg) {
28
- var key = _toPrimitive(arg, 'string');
29
- return typeof key === 'symbol' ? key : String(key);
26
+ function _toPropertyKey(t) {
27
+ var i = _toPrimitive(t, 'string');
28
+ return 'symbol' == typeof i ? i : i + '';
30
29
  }
31
- function _toPrimitive(input, hint) {
32
- if (typeof input !== 'object' || input === null) return input;
33
- var prim = input[Symbol.toPrimitive];
34
- if (prim !== undefined) {
35
- var res = prim.call(input, hint || 'default');
36
- if (typeof res !== 'object') return res;
30
+ function _toPrimitive(t, r) {
31
+ if ('object' != typeof t || !t) return t;
32
+ var e = t[Symbol.toPrimitive];
33
+ if (void 0 !== e) {
34
+ var i = e.call(t, r || 'default');
35
+ if ('object' != typeof i) return i;
37
36
  throw new TypeError('@@toPrimitive must return a primitive value.');
38
37
  }
39
- return (hint === 'string' ? String : Number)(input);
38
+ return ('string' === r ? String : Number)(t);
40
39
  }
41
40
  const _require = require('../errors'),
42
41
  UnsupportedObjectPropertyTypeAnnotationParserError =
@@ -18,6 +18,11 @@ function extractNativeModuleName(filename) {
18
18
  // .android.js, .android.ts, .android.tsx, .ios.js, .ios.ts, .ios.tsx, .js, .ts, .tsx
19
19
  return path.basename(filename).split('.')[0];
20
20
  }
21
+
22
+ // $FlowFixMe[unclear-type] there's no flowtype for ASTs
23
+
24
+ // $FlowFixMe[unclear-type] there's no flowtype for ASTs
25
+
21
26
  function createParserErrorCapturer() {
22
27
  // $FlowFixMe[missing-empty-array-annot]
23
28
  const errors = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/codegen",
3
- "version": "0.75.0-rc.6",
3
+ "version": "0.75.0",
4
4
  "description": "Code generation tools for React Native",
5
5
  "license": "MIT",
6
6
  "repository": {