Flow type vendor/core/merge.js

Summary:
This is used by Image.android.js and needs to be flow typed to be able to have confidence in the requireNativeComponent type change

Changelog:
[Internal] Flow type vendor/core/merge.js

Reviewed By: JoshuaGross

Differential Revision: D17561195

fbshipit-source-id: 2639f2628e15b2dd5469bb2ebfe935a444025a21
This commit is contained in:
Eli White
2019-09-24 18:51:45 -07:00
committed by Facebook Github Bot
parent fb90f64d9c
commit 419722bd07
+6 -2
View File
@@ -3,9 +3,12 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
*/
"use strict";
'use strict';
const mergeInto = require('./mergeInto');
@@ -16,10 +19,11 @@ const mergeInto = require('./mergeInto');
* @param {?object} two Optional object with properties to merge from.
* @return {object} The shallow extension of one by two.
*/
const merge = function(one, two) {
const merge = function<T1, T2>(one: T1, two: T2): {...T1, ...T2} {
const result = {};
mergeInto(result, one);
mergeInto(result, two);
// $FlowFixMe mergeInto is not typed
return result;
};