@bone-ui/utils
Advanced tools
Comparing version
@@ -9,1 +9,2 @@ import React from 'react'; | ||
export declare function isReactText(children: any): boolean; | ||
export declare function getValidChildren(children: React.ReactNode): any[]; |
@@ -53,2 +53,8 @@ 'use strict'; | ||
} | ||
function getValidChildren(children) { | ||
var childrenArray = Array.isArray(children) ? children : [children]; | ||
return childrenArray.filter(function (child) { | ||
return React.isValidElement(child); | ||
}); | ||
} | ||
@@ -61,2 +67,3 @@ exports.__DEV__ = __DEV__; | ||
exports.fromEntries = fromEntries; | ||
exports.getValidChildren = getValidChildren; | ||
exports.guid = guid; | ||
@@ -63,0 +70,0 @@ exports.isReactText = isReactText; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=(r=require("react"))&&"object"==typeof r&&"default"in r?r.default:r;exports.__DEV__=!1,exports.chunk=function(r,t){return r.reduce((function(r,e,n){return n%t==0?r.push([e]):r[r.length-1].push(e),r}),[])},exports.cx=function(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];return t.filter(Boolean).join(" ")},exports.first=function(r){return null!=r&&r.length?r[0]:void 0},exports.forwardRef=function(r){return t.forwardRef(r)},exports.fromEntries=function(r){return r.reduce((function(r,t){return r[t[0]]=t[1],r}),{})},exports.guid=function(){return String.fromCharCode(Math.floor(26*Math.random())+97)+Math.random().toString(16).slice(2)+Date.now().toString(16).slice(4)},exports.isReactText=function(r){return["string","number"].includes(typeof r)},exports.last=function(r){var t=null==r?0:r.length;return t?r[t-1]:void 0}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,t=(r=require("react"))&&"object"==typeof r&&"default"in r?r.default:r;exports.__DEV__=!1,exports.chunk=function(r,t){return r.reduce((function(r,e,n){return n%t==0?r.push([e]):r[r.length-1].push(e),r}),[])},exports.cx=function(){for(var r=arguments.length,t=new Array(r),e=0;e<r;e++)t[e]=arguments[e];return t.filter(Boolean).join(" ")},exports.first=function(r){return null!=r&&r.length?r[0]:void 0},exports.forwardRef=function(r){return t.forwardRef(r)},exports.fromEntries=function(r){return r.reduce((function(r,t){return r[t[0]]=t[1],r}),{})},exports.getValidChildren=function(r){return(Array.isArray(r)?r:[r]).filter((function(r){return t.isValidElement(r)}))},exports.guid=function(){return String.fromCharCode(Math.floor(26*Math.random())+97)+Math.random().toString(16).slice(2)+Date.now().toString(16).slice(4)},exports.isReactText=function(r){return["string","number"].includes(typeof r)},exports.last=function(r){var t=null==r?0:r.length;return t?r[t-1]:void 0}; | ||
//# sourceMappingURL=utils.cjs.production.min.js.map |
@@ -47,4 +47,10 @@ import React from 'react'; | ||
} | ||
function getValidChildren(children) { | ||
var childrenArray = Array.isArray(children) ? children : [children]; | ||
return childrenArray.filter(function (child) { | ||
return React.isValidElement(child); | ||
}); | ||
} | ||
export { __DEV__, chunk, cx, first, forwardRef, fromEntries, guid, isReactText, last }; | ||
export { __DEV__, chunk, cx, first, forwardRef, fromEntries, getValidChildren, guid, isReactText, last }; | ||
//# sourceMappingURL=utils.esm.js.map |
{ | ||
"name": "@bone-ui/utils", | ||
"version": "0.15.0", | ||
"version": "0.16.0", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
"module": "dist/utils.esm.js", | ||
"gitHead": "d79bdb04ddb154cfec5af23de0a0896214c67848" | ||
"gitHead": "cd59cb32b62da9ea9e3cdb7d517b38bb181e388d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19271
13.29%179
11.88%