Skip to content

Commit

Permalink
Prepare 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
tp committed Nov 18, 2024
1 parent 945725e commit 00c60b2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cloc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker run --rm -v "$PWD/":/indexed_entity_store:ro aldanial/cloc --fmt=4 /indexed_entity_store/lib
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.0-dev3"
version: "2.0.0"
leak_tracker:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions lib/src/index_collector.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
part of 'index_entity_store.dart';

/// Creates an index column in the current store
// NOTE(tp): This is implemented as a `class` with `call` such that we can
// correctly capture the index type `I` and forward that to `IndexColumn`
class IndexCollector<T> {
Expand Down
8 changes: 8 additions & 0 deletions lib/src/index_column.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
return v;
}

/// Returns a query matching index values which are equal to [value]
// NOTE(tp): Parameters here are typed as `dynamic`, even though they must be `I`. This is done so we can throw a more detailed exeption instead of the default low-level `TypeError`
Query equals(dynamic value) {
if (value is int && I == double) {
Expand All @@ -85,6 +86,7 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
);
}

/// Returns a query matching index values which are greater than [value]
Query greaterThan(dynamic value) {
if (value is int && I == double) {
value = value.toDouble();
Expand All @@ -107,6 +109,7 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
// return greaterThan(value);
// }

/// Returns a query matching index values which are greater than or equal to [value]
Query greaterThanOrEqual(dynamic value) {
if (value is int && I == double) {
value = value.toDouble();
Expand All @@ -132,6 +135,7 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
// return greaterThanOrEqual(value);
// }

/// Returns a query matching index values which are less than [value]
Query lessThan(dynamic value) {
if (value is int && I == double) {
value = value.toDouble();
Expand All @@ -154,6 +158,7 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
// return lessThan(value);
// }

/// Returns a query matching index values which are less than or equal to [value]
Query lessThanOrEqual(dynamic value) {
if (value is int && I == double) {
value = value.toDouble();
Expand All @@ -179,6 +184,9 @@ class IndexColumn<T /* entity type */, I /* index type */ > {
// return lessThanOrEqual(value);
// }

/// Returns a query matching index values which contain [value]
///
/// By default this uses a case-sensitive string comparison, but can be changed to be case-insensitive via [caseInsensitive].
Query contains(dynamic value, {bool caseInsensitive = false}) {
if (value is! String || value is! I) {
throw Exception(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: indexed_entity_store
description: A fast, simple, and synchronous entity store for Flutter applications.
version: 2.0.0-dev3
version: 2.0.0
repository: https://github.com/LunaONE/indexed_entity_store

environment:
Expand Down

0 comments on commit 00c60b2

Please sign in to comment.