|
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 | |
|---|
| 1 | import {childMatcher} from "../matcher.js";
|
|---|
| 2 |
|
|---|
| 3 | var find = Array.prototype.find;
|
|---|
| 4 |
|
|---|
| 5 | function childFind(match) {
|
|---|
| 6 | return function() {
|
|---|
| 7 | return find.call(this.children, match);
|
|---|
| 8 | };
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | function childFirst() {
|
|---|
| 12 | return this.firstElementChild;
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | export 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.