react-children-utilities
Advanced tools
Comparing version
import type { ReactNode } from 'react'; | ||
declare const deepFilter: (children: ReactNode, deepFilterFn: (child: ReactNode, index?: number | undefined, children?: ReactNode[] | undefined) => boolean) => ReactNode[]; | ||
declare const deepFilter: (children: ReactNode | ReactNode[], deepFilterFn: (child: ReactNode, index?: number | undefined, children?: ReactNode[] | undefined) => boolean) => ReactNode[]; | ||
export default deepFilter; | ||
//# sourceMappingURL=deepFilter.d.ts.map |
import type { ReactNode } from 'react'; | ||
declare const deepFind: (children: ReactNode, deepFindFn: (child: ReactNode, index?: number | undefined, children?: readonly ReactNode[] | undefined) => boolean) => ReactNode | undefined; | ||
declare const deepFind: (children: ReactNode | ReactNode[], deepFindFn: (child: ReactNode, index?: number | undefined, children?: readonly ReactNode[] | undefined) => boolean) => ReactNode | undefined; | ||
export default deepFind; | ||
//# sourceMappingURL=deepFind.d.ts.map |
import type { ReactNode } from 'react'; | ||
declare const deepForEach: (children: ReactNode, deepForEachFn: (child: ReactNode, index?: number | undefined) => void) => void; | ||
declare const deepForEach: (children: ReactNode | ReactNode[], deepForEachFn: (child: ReactNode, index?: number | undefined) => void) => void; | ||
export default deepForEach; | ||
//# sourceMappingURL=deepForEach.d.ts.map |
import type { ReactNode } from 'react'; | ||
declare const deepMap: (children: ReactNode, deepMapFn: (child: ReactNode, index?: number | undefined, children?: readonly ReactNode[] | undefined) => ReactNode) => ReactNode[]; | ||
declare const deepMap: (children: ReactNode | ReactNode[], deepMapFn: (child: ReactNode, index?: number | undefined, children?: readonly ReactNode[] | undefined) => ReactNode) => ReactNode[]; | ||
export default deepMap; | ||
//# sourceMappingURL=deepMap.d.ts.map |
import type { ReactNode } from 'react'; | ||
declare const filter: (children: ReactNode, filterFn: (child: ReactNode, index?: number | undefined, children?: ReactNode[] | undefined) => boolean) => ReactNode[]; | ||
declare const filter: (children: ReactNode | ReactNode[], filterFn: (child: ReactNode, index?: number | undefined, children?: ReactNode[] | undefined) => boolean) => ReactNode[]; | ||
export default filter; | ||
//# sourceMappingURL=filter.d.ts.map |
@@ -5,4 +5,4 @@ import type { ReactNode } from 'react'; | ||
}; | ||
declare const groupByType: (children: ReactNode, types?: readonly ReactNode[], rest?: string) => Record<string, ReactNode[]>; | ||
declare const groupByType: (children: ReactNode | ReactNode[], types?: readonly ReactNode[], rest?: string) => Record<string, ReactNode[]>; | ||
export default groupByType; | ||
//# sourceMappingURL=groupByType.d.ts.map |
import type { ReactElement, ReactNode } from 'react'; | ||
declare const hasChildren: (element: ReactNode) => element is ReactElement<{ | ||
children: ReactNode[]; | ||
children: ReactNode | ReactNode[]; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
export default hasChildren; | ||
//# sourceMappingURL=hasChildren.d.ts.map |
import type { ReactElement, ReactNode } from 'react'; | ||
declare const hasComplexChildren: (element: ReactNode) => element is ReactElement<{ | ||
children: ReactNode[]; | ||
children: ReactNode | ReactNode[]; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
export default hasComplexChildren; | ||
//# sourceMappingURL=hasComplexChildren.d.ts.map |
import type { ReactNode } from 'react'; | ||
export declare const childToString: (child?: ReactNode) => string; | ||
declare const onlyText: (children: ReactNode) => string; | ||
declare const onlyText: (children: ReactNode | ReactNode[]) => string; | ||
export default onlyText; | ||
//# sourceMappingURL=onlyText.d.ts.map |
import type { ReactNode } from 'react'; | ||
declare const onlyValid: (children: ReactNode) => ReactNode[]; | ||
declare const onlyValid: (children: ReactNode | ReactNode[]) => ReactNode[]; | ||
export default onlyValid; | ||
//# sourceMappingURL=onlyValid.d.ts.map |
{ | ||
"name": "react-children-utilities", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"description": "Recursive and extended utils for React children opaque data structure", | ||
@@ -50,33 +50,26 @@ "keywords": [ | ||
"size": "bundlewatch", | ||
"test": "jest --coverage", | ||
"thanks": "credits . --reporter markdown > THANKS.md", | ||
"test": "jest", | ||
"test:coverage": "jest --coverage", | ||
"update:normalize": "cp -rf node_modules/normalize.css/normalize.css docs/_sass/normalize.scss && prettier docs/_sass/normalize.scss --write", | ||
"verify": "yarn lint && yarn check-types && yarn test && yarn build && yarn size" | ||
"verify": "yarn lint && yarn check-types && yarn test:coverage && yarn build && yarn size" | ||
}, | ||
"resolutions": { | ||
"axios": "^0.21.1" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^12.1.4", | ||
"@commitlint/config-conventional": "^12.1.4", | ||
"@types/enzyme": "^3.10.8", | ||
"@types/enzyme-adapter-react-16": "^1.0.6", | ||
"@types/jest": "^26.0.23", | ||
"@types/react": "^17.0.9", | ||
"@types/react-dom": "^17.0.6", | ||
"@typescript-eslint/eslint-plugin": "^4.26.0", | ||
"@typescript-eslint/parser": "^4.26.0", | ||
"@commitlint/cli": "^13.1.0", | ||
"@commitlint/config-conventional": "^13.1.0", | ||
"@types/jest": "^26.0.24", | ||
"@types/react": "^17.0.15", | ||
"@types/react-dom": "^17.0.9", | ||
"@types/react-test-renderer": "^17.0.1", | ||
"@typescript-eslint/eslint-plugin": "^4.28.5", | ||
"@typescript-eslint/parser": "^4.28.5", | ||
"all-contributors-cli": "^6.20.0", | ||
"bundlewatch": "^0.3.2", | ||
"codecov": "^3.8.2", | ||
"credits-cli": "^3.1.0", | ||
"del-cli": "^3.0.1", | ||
"enzyme": "^3.11.0", | ||
"enzyme-adapter-react-16": "^1.15.6", | ||
"eslint": "^7.27.0", | ||
"codecov": "^3.8.3", | ||
"del-cli": "^4.0.1", | ||
"eslint": "^7.31.0", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-import": "^2.23.4", | ||
"eslint-plugin-jest": "^24.3.6", | ||
"eslint-plugin-jest": "^24.4.0", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
@@ -86,14 +79,12 @@ "eslint-plugin-prettier": "^3.4.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"flow-bin": "^0.152.0", | ||
"flow-bin": "^0.156.0", | ||
"flowgen": "^1.14.1", | ||
"husky": "^6.0.0", | ||
"jest": "^26.6.3", | ||
"jest-environment-enzyme": "^7.1.2", | ||
"jest-enzyme": "^7.1.2", | ||
"jest-junit": "^12.1.0", | ||
"lint-staged": "^11.0.0", | ||
"husky": "^7.0.1", | ||
"jest": "^27.0.6", | ||
"jest-junit": "^12.2.0", | ||
"lint-staged": "^11.1.1", | ||
"normalize.css": "^8.0.1", | ||
"pinst": "^2.1.6", | ||
"prettier": "^2.3.0", | ||
"prettier-plugin-organize-imports": "^2.1.0", | ||
"prettier": "^2.3.2", | ||
"prettier-plugin-organize-imports": "^2.3.3", | ||
"prettier-plugin-packagejson": "^2.2.11", | ||
@@ -104,6 +95,7 @@ "raf": "^3.4.1", | ||
"react-test-renderer": "^17.0.2", | ||
"rollup": "^2.50.5", | ||
"rollup": "^2.54.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"ts-jest": "^26.5.6", | ||
"typescript": "^4.3.2" | ||
"ts-jest": "^27.0.4", | ||
"type-fest": "^1.2.2", | ||
"typescript": "^4.3.5" | ||
}, | ||
@@ -110,0 +102,0 @@ "peerDependencies": { |
@@ -14,18 +14,18 @@ /// <reference types="react" /> | ||
declare const _default: { | ||
deepFilter: (children: import("react").ReactNode, deepFilterFn: (child: import("react").ReactNode, index?: number | undefined, children?: import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode[]; | ||
deepFind: (children: import("react").ReactNode, deepFindFn: (child: import("react").ReactNode, index?: number | undefined, children?: readonly import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode; | ||
deepForEach: (children: import("react").ReactNode, deepForEachFn: (child: import("react").ReactNode, index?: number | undefined) => void) => void; | ||
deepMap: (children: import("react").ReactNode, deepMapFn: (child: import("react").ReactNode, index?: number | undefined, children?: readonly import("react").ReactNode[] | undefined) => import("react").ReactNode) => import("react").ReactNode[]; | ||
filter: (children: import("react").ReactNode, filterFn: (child: import("react").ReactNode, index?: number | undefined, children?: import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode[]; | ||
groupByType: (children: import("react").ReactNode, types?: readonly import("react").ReactNode[], rest?: string) => Record<string, import("react").ReactNode[]>; | ||
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[]; | ||
deepFind: (children: import("react").ReactNode | import("react").ReactNode[], deepFindFn: (child: import("react").ReactNode, index?: number | undefined, children?: readonly import("react").ReactNode[] | undefined) => boolean) => import("react").ReactNode; | ||
deepForEach: (children: import("react").ReactNode | import("react").ReactNode[], deepForEachFn: (child: import("react").ReactNode, index?: number | undefined) => void) => void; | ||
deepMap: (children: import("react").ReactNode | import("react").ReactNode[], deepMapFn: (child: import("react").ReactNode, index?: number | undefined, children?: readonly import("react").ReactNode[] | undefined) => import("react").ReactNode) => 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[]; | ||
groupByType: (children: import("react").ReactNode | import("react").ReactNode[], types?: readonly import("react").ReactNode[], rest?: string) => Record<string, import("react").ReactNode[]>; | ||
hasChildren: (element: import("react").ReactNode) => element is import("react").ReactElement<{ | ||
children: import("react").ReactNode[]; | ||
children: import("react").ReactNode | import("react").ReactNode[]; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
hasComplexChildren: (element: import("react").ReactNode) => element is import("react").ReactElement<{ | ||
children: import("react").ReactNode[]; | ||
children: import("react").ReactNode | import("react").ReactNode[]; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
onlyText: (children: import("react").ReactNode) => string; | ||
onlyValid: (children: import("react").ReactNode) => import("react").ReactNode[]; | ||
map<T, C>(children: C | C[], fn: (child: C, index: number) => T): C extends null | undefined ? C : Exclude<T, boolean | null | undefined>[]; | ||
forEach<C_1>(children: C_1 | C_1[], fn: (child: C_1, index: number) => void): void; | ||
onlyText: (children: import("react").ReactNode | import("react").ReactNode[]) => string; | ||
onlyValid: (children: import("react").ReactNode | import("react").ReactNode[]) => import("react").ReactNode[]; | ||
map<T, C>(children: C | readonly C[], fn: (child: C, index: number) => T): C extends null | undefined ? C : Exclude<T, boolean | null | undefined>[]; | ||
forEach<C_1>(children: C_1 | readonly C_1[], fn: (child: C_1, index: number) => void): void; | ||
count(children: any): number; | ||
@@ -32,0 +32,0 @@ only<C_2>(children: C_2): C_2 extends any[] ? never : C_2; |
# React Children Utilities | ||
[![Gzip Bundle Size][badge-size]][url-size] [![Build Status][badge-ci]][url-ci] [![Test Coverage Status][badge-cov]][url-cov] [![Known Vulnerabilities][badge-sec]][url-sec] | ||
Recursive and extended utils for React children opaque data structure. | ||
[![All Contributors][badge-contributors]](#contributors-) [![npm version][badge-version]][url-version] [![npm downloads][badge-downloads]][url-downloads] | ||
<!-- BADGES - START --> | ||
[badge-ci]: https://circleci.com/gh/fernandopasik/react-children-utilities.svg?style=svg | ||
[badge-contributors]: https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square | ||
[badge-cov]: https://codecov.io/gh/fernandopasik/react-children-utilities/branch/master/graph/badge.svg | ||
[badge-downloads]: https://img.shields.io/npm/dm/react-children-utilities.svg | ||
[badge-sec]: https://snyk.io/test/github/fernandopasik/react-children-utilities/badge.svg?targetFile=package.json | ||
[badge-size]: http://img.badgesize.io/https://unpkg.com/react-children-utilities/react-children-utilities.min.js?compression=gzip | ||
[badge-version]: https://img.shields.io/npm/v/react-children-utilities.svg?logo=npm | ||
[url-ci]: https://circleci.com/gh/fernandopasik/react-children-utilities 'Build Status' | ||
[url-cov]: https://codecov.io/gh/fernandopasik/react-children-utilities 'Test Coverage Status' | ||
[url-downloads]: https://www.npmjs.com/package/react-children-utilities 'npm downloads' | ||
[url-sec]: https://snyk.io/test/github/fernandopasik/react-children-utilities?targetFile=package.json 'Known Vulnerabilities' | ||
[url-size]: https://unpkg.com/react-children-utilities/react-children-utilities.min.js 'Gzip Bundle Size' | ||
[url-version]: https://www.npmjs.com/package/react-children-utilities 'npm version' | ||
[](https://unpkg.com/react-children-utilities/react-children-utilities.min.js 'Gzip Bundle Size') | ||
[](https://circleci.com/gh/fernandopasik/react-children-utilities 'Build Status') | ||
[](https://codecov.io/gh/fernandopasik/react-children-utilities 'Coverage Status') | ||
[](https://snyk.io/test/github/fernandopasik/react-children-utilities?targetFile=package.json 'Known Vulnerabilities') | ||
Recursive and extended utils for React children opaque data structure. | ||
[](#contributors) | ||
[](https://www.npmjs.com/package/react-children-utilities 'npm version') | ||
[](https://www.npmjs.com/package/react-children-utilities 'npm downloads') | ||
<!-- BADGES - END --> | ||
## Installation | ||
@@ -103,2 +98,2 @@ | ||
MIT (c) 2018 [Fernando Pasik](https://fernandopasik.com) | ||
MIT (c) 2016 [Fernando Pasik](https://fernandopasik.com) |
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
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
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56875
1.33%41
-10.87%99
-4.81%