Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81155 views
1
/**
2
* Copyright 2013-2014, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @providesModule merge
10
*/
11
12
"use strict";
13
14
var assign = require('Object.assign');
15
16
/**
17
* Shallow merges two structures into a return value, without mutating either.
18
*
19
* @param {?object} one Optional object with properties to merge from.
20
* @param {?object} two Optional object with properties to merge from.
21
* @return {object} The shallow extension of one by two.
22
*/
23
var merge = function(one, two) {
24
return assign({}, one, two);
25
};
26
27
module.exports = merge;
28
29
// deprecation notice
30
console.warn(
31
'react/lib/merge has been deprecated and will be removed in the ' +
32
'next version of React. All uses can be replaced with ' +
33
'Object.assign({}, a, b) or _.extend({}, a, b).'
34
);
35
36