|
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:
421 bytes
|
| Line | |
|---|
| 1 | import {childMatcher} from "../matcher.js";
|
|---|
| 2 |
|
|---|
| 3 | var filter = Array.prototype.filter;
|
|---|
| 4 |
|
|---|
| 5 | function children() {
|
|---|
| 6 | return Array.from(this.children);
|
|---|
| 7 | }
|
|---|
| 8 |
|
|---|
| 9 | function childrenFilter(match) {
|
|---|
| 10 | return function() {
|
|---|
| 11 | return filter.call(this.children, match);
|
|---|
| 12 | };
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | export default function(match) {
|
|---|
| 16 | return this.selectAll(match == null ? children
|
|---|
| 17 | : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
|---|
| 18 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.