react-children-utilities
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -1,3 +0,3 @@ | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var cov_23kj5vbf82=function(){var path='/Users/fernandopasik/Sites/react-children-utilities/src/index.js',hash='01a36fa4fec80adf74b800bdcd76840785c38333',global=new Function('return this')(),gcv='__coverage__',coverageData={path:'/Users/fernandopasik/Sites/react-children-utilities/src/index.js',statementMap:{'0':{start:{line:14,column:4},end:{line:16,column:24}},'1':{start:{line:28,column:4},end:{line:39,column:13}},'2':{start:{line:32,column:22},end:{line:32,column:48}},'3':{start:{line:33,column:21},end:{line:33,column:61}},'4':{start:{line:34,column:16},end:{line:34,column:45}},'5':{start:{line:35,column:8},end:{line:38,column:10}},'6':{start:{line:49,column:4},end:{line:60,column:9}},'7':{start:{line:51,column:8},end:{line:58,column:9}},'8':{start:{line:54,column:10},end:{line:57,column:14}},'9':{start:{line:59,column:8},end:{line:59,column:32}},'10':{start:{line:69,column:4},end:{line:77,column:9}},'11':{start:{line:71,column:8},end:{line:75,column:9}},'12':{start:{line:74,column:10},end:{line:74,column:64}},'13':{start:{line:76,column:8},end:{line:76,column:29}},'14':{start:{line:87,column:4},end:{line:96,column:9}},'15':{start:{line:90,column:8},end:{line:94,column:9}},'16':{start:{line:93,column:10},end:{line:93,column:65}},'17':{start:{line:95,column:8},end:{line:95,column:33}},'18':{start:{line:105,column:4},end:{line:111,column:16}},'19':{start:{line:107,column:36},end:{line:110,column:7}}},fnMap:{'0':{name:'(anonymous_0)',decl:{start:{line:30,column:14},end:{line:30,column:15}},loc:{start:{line:30,column:32},end:{line:39,column:7}},line:30},'1':{name:'(anonymous_1)',decl:{start:{line:50,column:21},end:{line:50,column:22}},loc:{start:{line:50,column:30},end:{line:60,column:7}},line:50},'2':{name:'(anonymous_2)',decl:{start:{line:70,column:25},end:{line:70,column:26}},loc:{start:{line:70,column:34},end:{line:77,column:7}},line:70},'3':{name:'(anonymous_3)',decl:{start:{line:89,column:12},end:{line:89,column:13}},loc:{start:{line:89,column:21},end:{line:96,column:7}},line:89},'4':{name:'(anonymous_4)',decl:{start:{line:107,column:14},end:{line:107,column:15}},loc:{start:{line:107,column:36},end:{line:110,column:7}},line:107}},branchMap:{'0':{loc:{start:{line:33,column:21},end:{line:33,column:61}},type:'cond-expr',locations:[{start:{line:33,column:33},end:{line:33,column:53}},{start:{line:33,column:56},end:{line:33,column:61}}],line:33},'1':{loc:{start:{line:34,column:16},end:{line:34,column:45}},type:'cond-expr',locations:[{start:{line:34,column:28},end:{line:34,column:38}},{start:{line:34,column:41},end:{line:34,column:45}}],line:34},'2':{loc:{start:{line:37,column:23},end:{line:37,column:39}},type:'binary-expr',locations:[{start:{line:37,column:23},end:{line:37,column:33}},{start:{line:37,column:37},end:{line:37,column:39}}],line:37},'3':{loc:{start:{line:51,column:8},end:{line:58,column:9}},type:'if',locations:[{start:{line:51,column:8},end:{line:58,column:9}},{start:{line:51,column:8},end:{line:58,column:9}}],line:51},'4':{loc:{start:{line:51,column:12},end:{line:52,column:53}},type:'binary-expr',locations:[{start:{line:51,column:12},end:{line:51,column:23}},{start:{line:51,column:27},end:{line:51,column:47}},{start:{line:52,column:13},end:{line:52,column:53}}],line:51},'5':{loc:{start:{line:71,column:8},end:{line:75,column:9}},type:'if',locations:[{start:{line:71,column:8},end:{line:75,column:9}},{start:{line:71,column:8},end:{line:75,column:9}}],line:71},'6':{loc:{start:{line:71,column:12},end:{line:72,column:53}},type:'binary-expr',locations:[{start:{line:71,column:12},end:{line:71,column:23}},{start:{line:71,column:27},end:{line:71,column:47}},{start:{line:72,column:13},end:{line:72,column:53}}],line:71},'7':{loc:{start:{line:90,column:8},end:{line:94,column:9}},type:'if',locations:[{start:{line:90,column:8},end:{line:94,column:9}},{start:{line:90,column:8},end:{line:94,column:9}}],line:90},'8':{loc:{start:{line:90,column:12},end:{line:91,column:53}},type:'binary-expr',locations:[{start:{line:90,column:12},end:{line:90,column:23}},{start:{line:90,column:27},end:{line:90,column:47}},{start:{line:91,column:13},end:{line:91,column:53}}],line:90},'9':{loc:{start:{line:109,column:8},end:{line:109,column:89}},type:'cond-expr',locations:[{start:{line:109,column:46},end:{line:109,column:81}},{start:{line:109,column:84},end:{line:109,column:89}}],line:109},'10':{loc:{start:{line:109,column:8},end:{line:109,column:43}},type:'binary-expr',locations:[{start:{line:109,column:8},end:{line:109,column:19}},{start:{line:109,column:23},end:{line:109,column:43}}],line:109}},s:{'0':0,'1':0,'2':0,'3':0,'4':0,'5':0,'6':0,'7':0,'8':0,'9':0,'10':0,'11':0,'12':0,'13':0,'14':0,'15':0,'16':0,'17':0,'18':0,'19':0},f:{'0':0,'1':0,'2':0,'3':0,'4':0},b:{'0':[0,0],'1':[0,0],'2':[0,0],'3':[0,0],'4':[0,0,0],'5':[0,0],'6':[0,0,0],'7':[0,0],'8':[0,0,0],'9':[0,0],'10':[0,0]},_coverageSchema:'332fd63041d2c1bcb487cc26dd0d5f7d97098a6c'},coverage=global[gcv]||(global[gcv]={});if(coverage[path]&&coverage[path].hash===hash){return coverage[path]}coverageData.hash=hash;return coverage[path]=coverageData}();var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _react=require('react');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}exports.default=_extends({},_react.Children,{filter:function filter(children,filterFn){++cov_23kj5vbf82.s[0];return _react.Children.toArray(children).filter(filterFn)},groupByType:function groupByType(children,types,rest){++cov_23kj5vbf82.s[1];return _react.Children.toArray(children).reduce(function(group,child){++cov_23kj5vbf82.f[0];var isGrouped=(++cov_23kj5vbf82.s[2],types.includes(child.type)),addChild=(++cov_23kj5vbf82.s[3],isGrouped?(++cov_23kj5vbf82.b[0][0],child.props.children):(++cov_23kj5vbf82.b[0][1],child)),key=(++cov_23kj5vbf82.s[4],isGrouped?(++cov_23kj5vbf82.b[1][0],child.type):(++cov_23kj5vbf82.b[1][1],rest));++cov_23kj5vbf82.s[5];return _extends({},group,_defineProperty({},key,[].concat(_toConsumableArray((++cov_23kj5vbf82.b[2][0],group[key])||(++cov_23kj5vbf82.b[2][1],[])),[addChild])))},{})},deepMap:function deepMap(children,deepMapFn){var _this=this;++cov_23kj5vbf82.s[6];return _react.Children.map(children,function(child){++cov_23kj5vbf82.f[1];++cov_23kj5vbf82.s[7];if((++cov_23kj5vbf82.b[4][0],child.props)&&(++cov_23kj5vbf82.b[4][1],child.props.children)&&(++cov_23kj5vbf82.b[4][2],_typeof(child.props.children)==='object')){++cov_23kj5vbf82.b[3][0];++cov_23kj5vbf82.s[8];return deepMapFn((0,_react.cloneElement)(child,_extends({},child.props,{children:_this.deepMap(child.props.children,deepMapFn)})))}else{++cov_23kj5vbf82.b[3][1]}++cov_23kj5vbf82.s[9];return deepMapFn(child)})},deepForEach:function deepForEach(children,deepForEachFn){var _this2=this;++cov_23kj5vbf82.s[10];_react.Children.forEach(children,function(child){++cov_23kj5vbf82.f[2];++cov_23kj5vbf82.s[11];if((++cov_23kj5vbf82.b[6][0],child.props)&&(++cov_23kj5vbf82.b[6][1],child.props.children)&&(++cov_23kj5vbf82.b[6][2],_typeof(child.props.children)==='object')){++cov_23kj5vbf82.b[5][0];++cov_23kj5vbf82.s[12];_this2.deepForEach(child.props.children,deepForEachFn)}else{++cov_23kj5vbf82.b[5][1]}++cov_23kj5vbf82.s[13];deepForEachFn(child)})},deepFind:function deepFind(children,deepFindFn){var _this3=this;++cov_23kj5vbf82.s[14];return _react.Children.toArray(children).find(function(child){++cov_23kj5vbf82.f[3];++cov_23kj5vbf82.s[15];if((++cov_23kj5vbf82.b[8][0],child.props)&&(++cov_23kj5vbf82.b[8][1],child.props.children)&&(++cov_23kj5vbf82.b[8][2],_typeof(child.props.children)==='object')){++cov_23kj5vbf82.b[7][0];++cov_23kj5vbf82.s[16];return _this3.deepFind(child.props.children,deepFindFn)}else{++cov_23kj5vbf82.b[7][1]}++cov_23kj5vbf82.s[17];return deepFindFn(child)})},onlyText:function onlyText(children){var _this4=this;++cov_23kj5vbf82.s[18];return _react.Children.toArray(children).reduce(function(flattened,child){++cov_23kj5vbf82.f[4];++cov_23kj5vbf82.s[19];return[].concat(_toConsumableArray(flattened),[(++cov_23kj5vbf82.b[10][0],child.props)&&(++cov_23kj5vbf82.b[10][1],child.props.children)?(++cov_23kj5vbf82.b[9][0],_this4.onlyText(child.props.children)):(++cov_23kj5vbf82.b[9][1],child)])},[]).join('')}}); | ||
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};var _extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target};var _react=require('react');function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i]}return arr2}else{return Array.from(arr)}}exports.default=_extends({},_react.Children,{filter:function filter(children,filterFn){return _react.Children.toArray(children).filter(filterFn)},groupByType:function groupByType(children,types,rest){return _react.Children.toArray(children).reduce(function(group,child){var isGrouped=types.includes(child.type),addChild=isGrouped?child.props.children:child,key=isGrouped?child.type:rest;return _extends({},group,_defineProperty({},key,[].concat(_toConsumableArray(group[key]||[]),[addChild])))},{})},deepMap:function deepMap(children,deepMapFn){var _this=this;return _react.Children.map(children,function(child){if(child.props&&child.props.children&&_typeof(child.props.children)==='object'){return deepMapFn((0,_react.cloneElement)(child,_extends({},child.props,{children:_this.deepMap(child.props.children,deepMapFn)})))}return deepMapFn(child)})},deepForEach:function deepForEach(children,deepForEachFn){var _this2=this;_react.Children.forEach(children,function(child){if(child.props&&child.props.children&&_typeof(child.props.children)==='object'){_this2.deepForEach(child.props.children,deepForEachFn)}deepForEachFn(child)})},deepFind:function deepFind(children,deepFindFn){var _this3=this;return _react.Children.toArray(children).find(function(child){if(child.props&&child.props.children&&_typeof(child.props.children)==='object'){return _this3.deepFind(child.props.children,deepFindFn)}return deepFindFn(child)})},onlyText:function onlyText(children){var _this4=this;return _react.Children.toArray(children).reduce(function(flattened,child){return[].concat(_toConsumableArray(flattened),[child.props&&child.props.children?_this4.onlyText(child.props.children):child])},[]).join('')}}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-children-utilities", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "Extended utils for React.Children opaque data structure", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
"dependencies": { | ||
"prop-types": "^15.5.8", | ||
"prop-types": "^15.5.10", | ||
"react": "^15.5.4", | ||
@@ -60,4 +60,4 @@ "react-dom": "^15.5.4" | ||
"husky": "^0.13.3", | ||
"jest": "^19.0.2", | ||
"jest-enzyme": "^3.0.1", | ||
"jest": "^20.0.1", | ||
"jest-enzyme": "^3.1.1", | ||
"prepare-commit-msg-angular": "^0.2.0", | ||
@@ -64,0 +64,0 @@ "react-addons-test-utils": "^15.5.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
163835
202
Updatedprop-types@^15.5.10