serialized-query
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -9,3 +9,3 @@ import { rtdb } from "firebase-api-surface"; | ||
static path<T = any>(path?: string | LazyPath): SerializedQuery<T>; | ||
protected _db: ISimplifiedDBAdaptor; | ||
db: ISimplifiedDBAdaptor; | ||
protected _path: string | LazyPath; | ||
@@ -15,3 +15,3 @@ protected _limitToFirst: number; | ||
protected _orderBy: "orderByChild" | "orderByKey" | "orderByValue" | "orderByValue"; | ||
protected _orderKey: string; | ||
protected _orderKey: keyof T; | ||
protected _startAt: string; | ||
@@ -21,7 +21,7 @@ protected _endAt: string; | ||
protected _handleSnapshot: (snap: rtdb.IDataSnapshot) => any; | ||
constructor(path: string | LazyPath); | ||
constructor(path?: string | LazyPath); | ||
readonly path: string | LazyPath; | ||
limitToFirst(num: number): this; | ||
limitToLast(num: number): this; | ||
orderByChild(child: string): this; | ||
orderByChild(child: keyof T): this; | ||
orderByValue(): this; | ||
@@ -28,0 +28,0 @@ orderByKey(): this; |
@@ -16,3 +16,3 @@ "use strict"; | ||
class SerializedQuery { | ||
constructor(path) { | ||
constructor(path = "/") { | ||
this._orderBy = "orderByKey"; | ||
@@ -64,3 +64,3 @@ this._path = typeof path === "string" ? slashNotation(path) : path; | ||
setDB(db) { | ||
this._db = db; | ||
this.db = db; | ||
return this; | ||
@@ -70,3 +70,3 @@ } | ||
if (!db) { | ||
db = this._db; | ||
db = this.db; | ||
} | ||
@@ -73,0 +73,0 @@ let q = db.ref(typeof this._path === "function" ? slashNotation(this._path()) : this._path); |
{ | ||
"name": "serialized-query", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A simple Typescript class to serialize Firebase queries", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package