Flowify Library/Utilities/

This commit is contained in:
Marshall Roch
2015-03-23 17:09:14 -07:00
parent 540cb4bb8e
commit cf126f1172
19 changed files with 125 additions and 34 deletions

View File

@@ -7,11 +7,14 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule nativeModulePrefixNormalizer
* @flow
*/
'use strict';
// Dirty hack to support old (RK) and new (RCT) native module name conventions
function nativeModulePrefixNormalizer(modules) {
function nativeModulePrefixNormalizer(
modules: {[key: string]: any}
): void {
Object.keys(modules).forEach((moduleName) => {
var strippedName = moduleName.replace(/^(RCT|RK)/, '');
if (modules['RCT' + strippedName] && modules['RK' + strippedName]) {