-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
153 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import 'package:json_path/fun_sdk.dart'; | ||
|
||
/// Returns all siblings of the given nodes. | ||
class Siblings implements Fun1<Nodes, Nodes> { | ||
class Siblings implements Fun1<NodeList, NodeList> { | ||
const Siblings(); | ||
|
||
@override | ||
final name = 'siblings'; | ||
|
||
@override | ||
Nodes call(Nodes nodes) => nodes | ||
NodeList call(NodeList nodes) => nodes | ||
.expand((node) => node.parent?.children.where((it) => node != it) ?? []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import 'package:json_path/fun_sdk.dart'; | ||
import 'package:json_path/src/selector.dart'; | ||
|
||
Selector arrayIndexSelector(int offset) => (node) sync* { | ||
final element = node.element(offset); | ||
if (element != null) yield element; | ||
}; | ||
SingularSelector arrayIndexSelector(int offset) => | ||
(node) => SingularNodeList.from(node.element(offset)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import 'package:json_path/fun_sdk.dart'; | ||
import 'package:json_path/src/selector.dart'; | ||
|
||
Selector childSelector(String key) => (node) sync* { | ||
final child = node.child(key); | ||
if (child != null) yield child; | ||
}; | ||
SingularSelector childSelector(String key) => | ||
(node) => SingularNodeList.from(node.child(key)); |
Oops, something went wrong.