@shisyamo4131/air-firebase-v2-client-adapter 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -612,7 +612,8 @@ class ClientAdapter {
612
612
  * @throws {Error} If `docId` is not set, or if `callback` is not a function.
613
613
  * `docId` が未設定、または `callback` が関数でない場合にスローされます。
614
614
  */
615
- async update({ transaction = null, callback = null, prefix = null } = {}) {
615
+ async update(args = {}) {
616
+ const { transaction = null, callback = null, prefix = null } = args;
616
617
  if (callback !== null && typeof callback !== "function") {
617
618
  throw new ClientAdapterError(ERRORS.VALIDATION_INVALID_CALLBACK);
618
619
  }
@@ -739,7 +740,8 @@ class ClientAdapter {
739
740
  * @throws {Error} If `docId` is missing, `callback` is not a function, or document is undeletable.
740
741
  * `docId` が未設定、`callback` が関数でない、または削除対象のドキュメントが存在しない場合。
741
742
  */
742
- async delete({ transaction = null, callback = null, prefix = null } = {}) {
743
+ async delete(args = {}) {
744
+ const { transaction = null, callback = null, prefix = null } = args;
743
745
  if (callback !== null && typeof callback !== "function") {
744
746
  throw new ClientAdapterError(ERRORS.VALIDATION_INVALID_CALLBACK);
745
747
  }
@@ -985,6 +987,7 @@ class ClientAdapter {
985
987
  const queryConstraints = [];
986
988
 
987
989
  if (typeof constraints === "string") {
990
+ if (!constraints) return this.docs; // 空文字列の場合は何もせず返す
988
991
  queryConstraints.push(...this.createTokenMapQueries(constraints));
989
992
  queryConstraints.push(...this.createQueries(options));
990
993
  } else if (Array.isArray(constraints)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shisyamo4131/air-firebase-v2-client-adapter",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "client adapter for FireModel",
5
5
  "type": "module",
6
6
  "main": "index.js",