Skip to content

Commit

Permalink
feat: support of Identity class
Browse files Browse the repository at this point in the history
  • Loading branch information
akdasa committed Dec 29, 2022
1 parent a20331f commit 626a6ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions lib/FirebaseRepository.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
Aggregate, AnyIdentity, Expression, LogicalOperators, Operators,
Aggregate, AnyIdentity, Expression, Identity, LogicalOperators, Operators,
Predicate, Query, Repository, Result
} from '@akdasa-studios/framework'
import {
Expand Down Expand Up @@ -140,7 +140,7 @@ class QueryConverter {
where(
query.field,
this.operatorsMap[query.operator],
query.value
this.getValue(query.value)
)]
} else if (query instanceof Expression) {
if (query.operator !== LogicalOperators.And) { throw 'not supported query' }
Expand All @@ -151,4 +151,11 @@ class QueryConverter {
}
return result
}

getValue(object: unknown) {
if (object instanceof Identity) {
return object.value
}
return object
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@akdasa-studios/framework-firebase",
"version": "0.2.3",
"version": "0.2.4",
"description": "Firebease support for Framework",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit 626a6ec

Please sign in to comment.