Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-children-utilities

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-children-utilities - npm Package Compare versions

Comparing version 2.6.0 to 2.6.1

22

package.json
{
"name": "react-children-utilities",
"version": "2.6.0",
"version": "2.6.1",
"description": "Recursive and extended utils for React children opaque data structure",

@@ -43,3 +43,3 @@ "keywords": [

"flowgen": "flowgen react-children-utilities.d.ts --quiet -o react-children-utilities.js.flow",
"format": "prettier --no-error-on-unmatched-pattern --write ** ./* ./.??*",
"format": "prettier --write .",
"lint": "eslint . --ext js,jsx,ts,tsx",

@@ -60,8 +60,8 @@ "prepare": "husky install",

"@commitlint/config-conventional": "^13.1.0",
"@types/jest": "^26.0.24",
"@types/react": "^17.0.15",
"@types/jest": "^27.0.1",
"@types/react": "^17.0.18",
"@types/react-dom": "^17.0.9",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^4.29.0",
"@typescript-eslint/parser": "^4.29.0",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"all-contributors-cli": "^6.20.0",

@@ -74,3 +74,3 @@ "bundlewatch": "^0.3.2",

"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-import": "^2.24.0",
"eslint-plugin-jest": "^24.4.0",

@@ -81,3 +81,3 @@ "eslint-plugin-jsx-a11y": "^6.4.1",

"eslint-plugin-react-hooks": "^4.2.0",
"flow-bin": "^0.156.0",
"flow-bin": "^0.157.0",
"flowgen": "^1.14.1",

@@ -87,3 +87,3 @@ "husky": "^7.0.1",

"jest-junit": "^12.2.0",
"lint-staged": "^11.1.1",
"lint-staged": "^11.1.2",
"normalize.css": "^8.0.1",

@@ -98,6 +98,6 @@ "pinst": "^2.1.6",

"react-test-renderer": "^17.0.2",
"rollup": "^2.55.1",
"rollup": "^2.56.2",
"rollup-plugin-terser": "^7.0.2",
"ts-jest": "^27.0.4",
"type-fest": "^1.3.0",
"type-fest": "^2.0.0",
"typescript": "^4.3.5"

@@ -104,0 +104,0 @@ },

@@ -7,2 +7,3 @@ /// <reference types="react" />

import filter from './lib/filter.js';
import getElementName from './lib/getElementName.js';
import groupByType from './lib/groupByType.js';

@@ -13,3 +14,3 @@ import hasChildren from './lib/hasChildren.js';

import onlyValid from './lib/onlyValid.js';
export { deepFilter, deepFind, deepForEach, deepMap, filter, groupByType, hasChildren, hasComplexChildren, onlyText, onlyValid, };
export { deepFilter, deepFind, deepForEach, deepMap, filter, getElementName, groupByType, hasChildren, hasComplexChildren, onlyText, onlyValid, };
declare const _default: {

@@ -21,2 +22,3 @@ deepFilter: (children: import("react").ReactNode | import("react").ReactNode[], deepFilterFn: (child: import("react").ReactNode, index?: number | undefined, children?: import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode[];

filter: (children: import("react").ReactNode | import("react").ReactNode[], filterFn: (child: import("react").ReactNode, index?: number | undefined, children?: import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode[];
getElementName: (element: import("react").ReactNode) => string | null;
groupByType: (children: import("react").ReactNode | import("react").ReactNode[], types?: readonly (string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<{}>)[], rest?: string) => Record<string, import("react").ReactNode[]>;

@@ -23,0 +25,0 @@ hasChildren: (element: import("react").ReactNode) => element is import("react").ReactElement<{

@@ -7,2 +7,3 @@ import { Children } from 'react';

import filter from './lib/filter.js';
import getElementName from './lib/getElementName.js';
import groupByType from './lib/groupByType.js';

@@ -13,3 +14,3 @@ import hasChildren from './lib/hasChildren.js';

import onlyValid from './lib/onlyValid.js';
export { deepFilter, deepFind, deepForEach, deepMap, filter, groupByType, hasChildren, hasComplexChildren, onlyText, onlyValid, };
export { deepFilter, deepFind, deepForEach, deepMap, filter, getElementName, groupByType, hasChildren, hasComplexChildren, onlyText, onlyValid, };
export default {

@@ -22,2 +23,3 @@ ...Children,

filter,
getElementName,
groupByType,

@@ -24,0 +26,0 @@ hasChildren,

@@ -1,2 +0,2 @@

import{isValidElement as e,Children as r,cloneElement as n}from"react";const t=r=>e(r)&&Boolean(r.t.children),o=n=>e(n)&&t(n)&&r.toArray(n.t.children).reduce(((r,n)=>r||e(n)),!1),l=(t,a)=>r.toArray(t).filter(a).map((r=>e(r)&&o(r)?n(r,{...r.t,children:l(r.t.children,a)}):r)),a=(n,t)=>{let l;return r.toArray(n).find(((r,n,i)=>t(r,n,i)?(l=r,!0):!(!e(r)||!o(r))&&(l=a(r.t.children,t),void 0!==l))),l},i=(n,t)=>{r.forEach(n,((r,n)=>{e(r)&&o(r)&&i(r.t.children,t),t(r,n)}))},d=(t,l)=>r.toArray(t).map(((r,t,a)=>e(r)&&o(r)?l(n(r,{...r.t,children:d(r.t.children,l)})):l(r,t,a))),p=(e,n)=>r.toArray(e).filter(n),s=(n,t=[],o="rest")=>{const l=t.map((e=>"string"==typeof e?e:e.name));return r.toArray(n).reduce(((r,n)=>{const t={...r},a=e(i=n)?"string"==typeof i.type?i.type:i.type.name:null;var i;const d=null!==a&&l.includes(a)?a:o;return void 0===t[d]&&(t[d]=[]),t[d]=[...t[d],n],t}),{})},c=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString(),u=n=>n instanceof Array||e(n)?r.toArray(n).reduce(((r,n)=>{let o="";return o=e(n)&&t(n)?u(n.t.children):e(n)&&!t(n)?"":c(n),r.concat(o)}),""):c(n),y=r=>l(r,(r=>e(r)));var f={...r,o:l,l:a,i:i,p:d,filter:p,u:s,h:t,v:o,g:u,m:y};export{l as deepFilter,a as deepFind,i as deepForEach,d as deepMap,f as default,p as filter,s as groupByType,t as hasChildren,o as hasComplexChildren,u as onlyText,y as onlyValid};
import{isValidElement as e,Children as r,cloneElement as t}from"react";const n=r=>e(r)&&Boolean(r.t.children),l=t=>e(t)&&n(t)&&r.toArray(t.t.children).reduce(((r,t)=>r||e(t)),!1),o=(n,a)=>r.toArray(n).filter(a).map((r=>e(r)&&l(r)?t(r,{...r.t,children:o(r.t.children,a)}):r)),a=(t,n)=>{let o;return r.toArray(t).find(((r,t,i)=>n(r,t,i)?(o=r,!0):!(!e(r)||!l(r))&&(o=a(r.t.children,n),void 0!==o))),o},i=(t,n)=>{r.forEach(t,((r,t)=>{e(r)&&l(r)&&i(r.t.children,n),n(r,t)}))},d=(n,o)=>r.toArray(n).map(((r,n,a)=>e(r)&&l(r)?o(t(r,{...r.t,children:d(r.t.children,o)})):o(r,n,a))),p=(e,t)=>r.toArray(e).filter(t),s=r=>e(r)?"string"==typeof r.type?r.type:r.type.name:null,u=(e,t=[],n="rest")=>{const l=t.map((e=>"string"==typeof e?e:e.name));return r.toArray(e).reduce(((e,r)=>{const t={...e},o=s(r),a=null!==o&&l.includes(o)?o:n;return void 0===t[a]&&(t[a]=[]),t[a]=[...t[a],r],t}),{})},c=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString(),y=t=>t instanceof Array||e(t)?r.toArray(t).reduce(((r,t)=>{let l="";return l=e(t)&&n(t)?y(t.t.children):e(t)&&!n(t)?"":c(t),r.concat(l)}),""):c(t),f=r=>o(r,(r=>e(r)));var h={...r,l:o,o:a,i:i,p:d,filter:p,u:s,h:u,m:n,g:l,v:y,C:f};export{o as deepFilter,a as deepFind,i as deepForEach,d as deepMap,h as default,p as filter,s as getElementName,u as groupByType,n as hasChildren,l as hasComplexChildren,y as onlyText,f as onlyValid};
//# sourceMappingURL=react-children-utilities.min.js.map

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc