react-children-utilities
Advanced tools
Comparing version 2.3.0 to 2.4.0
import { Children, cloneElement, isValidElement } from 'react'; | ||
import hasComplexChildren from './hasComplexChildren'; | ||
import hasComplexChildren from './hasComplexChildren.js'; | ||
const deepFilter = (children, deepFilterFn) => { | ||
@@ -4,0 +4,0 @@ return Children.toArray(children) |
import { Children, isValidElement } from 'react'; | ||
import hasComplexChildren from './hasComplexChildren'; | ||
import hasComplexChildren from './hasComplexChildren.js'; | ||
const deepFind = (children, deepFindFn) => { | ||
@@ -4,0 +4,0 @@ // eslint-disable-next-line @typescript-eslint/init-declarations |
import { Children, isValidElement } from 'react'; | ||
import hasComplexChildren from './hasComplexChildren'; | ||
import hasComplexChildren from './hasComplexChildren.js'; | ||
const deepForEach = (children, deepForEachFn) => { | ||
@@ -4,0 +4,0 @@ Children.forEach(children, (child, index) => { |
import { Children, cloneElement, isValidElement } from 'react'; | ||
import hasComplexChildren from './hasComplexChildren'; | ||
import hasComplexChildren from './hasComplexChildren.js'; | ||
const deepMap = (children, deepMapFn) => { | ||
@@ -4,0 +4,0 @@ return Children.toArray(children).map((child, index, mapChildren) => { |
import type { ReactElement, ReactNode } from 'react'; | ||
declare const hasChildren: (element: ReactNode) => element is ReactElement<{ | ||
children: ReactNode[]; | ||
}, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
}, 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[]; | ||
}, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
export default hasComplexChildren; | ||
//# sourceMappingURL=hasComplexChildren.d.ts.map |
import { Children, isValidElement } from 'react'; | ||
import hasChildren from './hasChildren'; | ||
import hasChildren from './hasChildren.js'; | ||
const hasComplexChildren = (element) => isValidElement(element) && | ||
@@ -4,0 +4,0 @@ hasChildren(element) && |
@@ -1,5 +0,5 @@ | ||
import type { ReactNode } from 'react'; | ||
export declare const childToString: (child?: string | number | boolean | {} | null | undefined) => string; | ||
import type { ReactNode, ReactText } from 'react'; | ||
export declare const childToString: (child?: boolean | {} | ReactText | null | undefined) => string; | ||
declare const onlyText: (children: ReactNode) => string; | ||
export default onlyText; | ||
//# sourceMappingURL=onlyText.d.ts.map |
import { Children, isValidElement } from 'react'; | ||
import hasChildren from './hasChildren'; | ||
import hasChildren from './hasChildren.js'; | ||
export const childToString = (child) => { | ||
@@ -4,0 +4,0 @@ if (typeof child === 'undefined' || child === null || typeof child === 'boolean') { |
import { isValidElement } from 'react'; | ||
import deepFilter from './deepFilter'; | ||
import deepFilter from './deepFilter.js'; | ||
const onlyValid = (children) => deepFilter(children, (child) => isValidElement(child)); | ||
export default onlyValid; | ||
//# sourceMappingURL=onlyValid.js.map |
{ | ||
"name": "react-children-utilities", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Recursive and extended utils for React children opaque data structure", | ||
@@ -36,4 +36,5 @@ "keywords": [ | ||
"scripts": { | ||
"add-js-extension": "replace-in-files --regex=\"(import .* from '\\.[^']*)\" --replacement=\"$&.js\" lib/**/*.js react-children-utilities.js", | ||
"prebuild": "del lib react-children-utilities.*", | ||
"build": "tsc && rollup -c && yarn flowgen", | ||
"build": "tsc && yarn add-js-extension && rollup -c && yarn flowgen", | ||
"check-types": "tsc --noEmit -p tsconfig.all.json && flow", | ||
@@ -60,4 +61,4 @@ "clean": "del coverage lib react-children-utilities.*", | ||
"devDependencies": { | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"@commitlint/cli": "^12.0.0", | ||
"@commitlint/config-conventional": "^12.0.0", | ||
"@types/enzyme": "^3.10.8", | ||
@@ -68,4 +69,4 @@ "@types/enzyme-adapter-react-16": "^1.0.6", | ||
"@types/react-dom": "^17.0.1", | ||
"@typescript-eslint/eslint-plugin": "^4.15.1", | ||
"@typescript-eslint/parser": "^4.15.1", | ||
"@typescript-eslint/eslint-plugin": "^4.15.2", | ||
"@typescript-eslint/parser": "^4.15.2", | ||
"all-contributors-cli": "^6.20.0", | ||
@@ -80,5 +81,5 @@ "bundlesize": "^1.0.0-beta.2", | ||
"eslint-config-airbnb": "^18.2.1", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.3", | ||
"eslint-plugin-jest": "^24.1.5", | ||
"eslint-plugin-jsx-a11y": "^6.4.1", | ||
@@ -88,5 +89,5 @@ "eslint-plugin-prettier": "^3.3.1", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"flow-bin": "^0.144.0", | ||
"flow-bin": "^0.145.0", | ||
"flowgen": "1.13.0", | ||
"husky": "^5.0.9", | ||
"husky": "^5.1.1", | ||
"jest": "^26.6.3", | ||
@@ -98,6 +99,6 @@ "jest-environment-enzyme": "^7.1.2", | ||
"normalize.css": "^8.0.1", | ||
"pinst": "^2.1.4", | ||
"pinst": "^2.1.6", | ||
"prettier": "^2.2.1", | ||
"prettier-plugin-organize-imports": "^1.1.1", | ||
"prettier-plugin-packagejson": "^2.2.9", | ||
"prettier-plugin-packagejson": "^2.2.10", | ||
"raf": "^3.4.1", | ||
@@ -107,6 +108,7 @@ "react": "^17.0.1", | ||
"react-test-renderer": "^17.0.1", | ||
"rollup": "^2.39.0", | ||
"replace-in-files-cli": "^1.0.0", | ||
"rollup": "^2.39.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"ts-jest": "^26.5.1", | ||
"typescript": "^4.1.5" | ||
"ts-jest": "26.5.1", | ||
"typescript": "^4.2.2" | ||
}, | ||
@@ -113,0 +115,0 @@ "peerDependencies": { |
@@ -22,6 +22,6 @@ /// <reference types="react" /> | ||
children: import("react").ReactNode[]; | ||
}, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
hasComplexChildren: (element: import("react").ReactNode) => element is import("react").ReactElement<{ | ||
children: import("react").ReactNode[]; | ||
}, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>; | ||
}, string | import("react").JSXElementConstructor<any>>; | ||
onlyText: (children: import("react").ReactNode) => string; | ||
@@ -33,5 +33,5 @@ onlyValid: (children: import("react").ReactNode) => import("react").ReactNode[]; | ||
only<C_2>(children: C_2): C_2 extends any[] ? never : C_2; | ||
toArray(children: string | number | boolean | {} | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactNodeArray | import("react").ReactPortal | import("react").ReactNode[] | null | undefined): (string | number | {} | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactNodeArray | import("react").ReactPortal)[]; | ||
toArray(children: import("react").ReactNode | import("react").ReactNode[]): (import("react").ReactChild | import("react").ReactFragment | import("react").ReactPortal)[]; | ||
}; | ||
export default _default; | ||
//# sourceMappingURL=react-children-utilities.d.ts.map |
import { Children } from 'react'; | ||
import deepFilter from './lib/deepFilter'; | ||
import deepFind from './lib/deepFind'; | ||
import deepForEach from './lib/deepForEach'; | ||
import deepMap from './lib/deepMap'; | ||
import filter from './lib/filter'; | ||
import groupByType from './lib/groupByType'; | ||
import hasChildren from './lib/hasChildren'; | ||
import hasComplexChildren from './lib/hasComplexChildren'; | ||
import onlyText from './lib/onlyText'; | ||
import onlyValid from './lib/onlyValid'; | ||
import deepFilter from './lib/deepFilter.js'; | ||
import deepFind from './lib/deepFind.js'; | ||
import deepForEach from './lib/deepForEach.js'; | ||
import deepMap from './lib/deepMap.js'; | ||
import filter from './lib/filter.js'; | ||
import groupByType from './lib/groupByType.js'; | ||
import hasChildren from './lib/hasChildren.js'; | ||
import hasComplexChildren from './lib/hasComplexChildren.js'; | ||
import onlyText from './lib/onlyText.js'; | ||
import onlyValid from './lib/onlyValid.js'; | ||
export { deepFilter, deepFind, deepForEach, deepMap, filter, groupByType, hasChildren, hasComplexChildren, onlyText, onlyValid, }; | ||
@@ -13,0 +13,0 @@ export default Object.assign(Object.assign({}, Children), { deepFilter, |
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
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
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
56793
47
226