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

Extended utils for React.Children opaque data structure

  • 0.1.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66K
decreased by-2.63%
Maintainers
1
Weekly downloads
 
Created
Source

React Children Utilities

npm version Build Status Dependency Status devDependency Status Coverage Status

Extended utils for React.Children opaque data structure.

Install

npm install --save react-children-utilities

Usage

Instead of requiring Children from React, require this one, it will extend existing capabilities from Children in your current React version.

var Children = require('react-children-utilities');

With ES6 modules

import Children from 'react-children-utilities';

Api documentation

Children.filter

Creates a new children array with all elements that pass the test implemented by the provided function.

Children.filter(children, callback)

Children.groupByType

Returns an object with keys that map each tag name to an array of children of that type, and a key that maps the rest of children.

Children.groupByType(children, tagNames[, restKey])

Children.deepMap

Creates a new children array with the results of calling a provided function on every element (and its children) in the provided children.

Children.deepMap(children, callback)

Children.deepForEach

Executes a provided function on every element (and its children) in the provided children.

Children.deepForEach(children, callback)

Children.deepFind

Returns the first element in the children (and its children) that satisfies the provided testing function.

Children.deepFind(children, callback)

Children.onlyText

Strips all html and returns only text nodes

Children.onlyText(children)

License

MIT (c) 2017 Fernando Pasik

Keywords

FAQs

Package last updated on 16 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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