npmtest-react-native-web (v0.0.1)

Code coverage report for node-npmtest-react-native-web/node_modules/react-native-web/dist/modules/ReactNativePropRegistry/index.js

Statements: 72.73% (32 / 44)      Branches: 37.5% (6 / 16)      Functions: 66.67% (6 / 9)      Lines: 65.22% (15 / 23)      Ignored: none     

All files » node-npmtest-react-native-web/node_modules/react-native-web/dist/modules/ReactNativePropRegistry/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50                        2   1 1 1 1   59   1   59 59 59   59 59 59                               1     1  
 
 
 
 
 
 
 
 
 
 
 
 
'use strict';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;Eif("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){Iif(protoProps)defineProperties(Constructor.prototype,protoProps);Eif(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}
 
var emptyObject={};
var objects={};
var prefix='r';
var uniqueID=1;
 
var createKey=function createKey(id){return prefix+'-'+id;};var
 
ReactNativePropRegistry=function(){function ReactNativePropRegistry(){_classCallCheck(this,ReactNativePropRegistry);}_createClass(ReactNativePropRegistry,null,[{key:'register',value:function register(
object){
var id=uniqueID++;
Eif(process.env.NODE_ENV!=='production'){
Object.freeze(object);
}
var key=createKey(id);
objects[key]=object;
return id;
}},{key:'getByID',value:function getByID(
 
id){
if(!id){
 
 
return emptyObject;
}
var key=createKey(id);
var object=objects[key];
if(!object){
console.warn('Invalid style with id `'+id+'`. Skipping ...');
return emptyObject;
}
return object;
}}]);return ReactNativePropRegistry;}();
 
 
module.exports=ReactNativePropRegistry;