From d378406ea07440b5ca68892f7104ab8f8079ba32 Mon Sep 17 00:00:00 2001 From: f3ath Date: Tue, 28 Jul 2020 22:54:47 -0700 Subject: [PATCH] Add example to linter --- .github/workflows/dart.yml | 2 +- lib/src/json_path.dart | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 13980bc..cdb2d6a 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -19,6 +19,6 @@ jobs: - name: Install dependencies run: pub get - name: Analyzer - run: dartanalyzer --fatal-infos --fatal-warnings lib test + run: dartanalyzer --fatal-infos --fatal-warnings lib test example - name: Tests run: pub run test \ No newline at end of file diff --git a/lib/src/json_path.dart b/lib/src/json_path.dart index 3196b3b..23f9f15 100644 --- a/lib/src/json_path.dart +++ b/lib/src/json_path.dart @@ -5,7 +5,9 @@ import 'package:json_path/src/selector/selector.dart'; import 'package:json_path/src/state.dart'; import 'package:json_path/src/tokenize.dart'; +/// A JSONPath expression class JsonPath { + /// Creates an instance from string factory JsonPath(String expression) { State state = Ready(Root()); for (final node in Node.build(tokenize(expression)).children) { @@ -18,7 +20,7 @@ class JsonPath { final Selector _selector; - /// Filters the given [json]. + /// Filters the given [json] object. /// Returns an Iterable of all elements found Iterable select(json) => _selector([Result(json, '')]);