source: node_modules/d3-selection/src/selection/selectChild.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 403 bytes
Line 
1import {childMatcher} from "../matcher.js";
2
3var find = Array.prototype.find;
4
5function childFind(match) {
6 return function() {
7 return find.call(this.children, match);
8 };
9}
10
11function childFirst() {
12 return this.firstElementChild;
13}
14
15export default function(match) {
16 return this.select(match == null ? childFirst
17 : childFind(typeof match === "function" ? match : childMatcher(match)));
18}
Note: See TracBrowser for help on using the repository browser.