mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
fb90f64d9c
commit
419722bd07
Vendored
+6
-2
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user