Skip to content

Commit fa77fbb

Browse files
author
Patrick Wozniak
committed
rn 0.56 ios compatibility
1 parent ce41a32 commit fa77fbb

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/create-text-gradient-class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import * as React from 'react';
1515
import StyleSheetPropType from 'react-native/Libraries/StyleSheet/StyleSheetPropType';
1616
import ReactNativeViewAttributes from 'react-native/Libraries/Components/View/ReactNativeViewAttributes';
17-
import mergeFast from 'react-native/Libraries/Utilities/mergeFast';
17+
import mergeFast from './mergeFast';
1818
import PropTypes from 'prop-types';
1919
import createReactClass from 'create-react-class';
2020
import TextStylePropTypes from 'react-native/Libraries/Text/TextStylePropTypes';

src/mergeFast.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Copyright (c) 2015-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @providesModule mergeFast
8+
* @flow
9+
*/
10+
'use strict';
11+
12+
/**
13+
* Faster version of `merge` that doesn't check its arguments and
14+
* also merges prototype inherited properties.
15+
*
16+
* @param {object} one Any non-null object.
17+
* @param {object} two Any non-null object.
18+
* @return {object} Merging of two objects, including prototype
19+
* inherited properties.
20+
*/
21+
var mergeFast = function(one: Object, two: Object): Object {
22+
var ret = {};
23+
for (var keyOne in one) {
24+
ret[keyOne] = one[keyOne];
25+
}
26+
for (var keyTwo in two) {
27+
ret[keyTwo] = two[keyTwo];
28+
}
29+
return ret;
30+
};
31+
32+
module.exports = mergeFast;

0 commit comments

Comments
 (0)