core-nails 1.0.13 → 1.0.14

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.
@@ -1,7 +1,7 @@
1
1
  function InitializeModel(opts) {
2
2
  const { collection: collectionName, schema, FirebaseAdmin } = opts;
3
3
  const db = FirebaseAdmin.firestore();
4
- const collection = db.collection(collectionName);
4
+ const collection = db.collection(process.env.COLLECTION_SCOPE ? `${process.env.COLLECTION_SCOPE}__${collectionName}` : collectionName);
5
5
  function parseDoc(doc) {
6
6
  if (!doc.exists)
7
7
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-nails",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "scripts": {
5
5
  "build": "tsc",
6
6
  "bump": "npm version patch"
@@ -13,7 +13,7 @@ function InitializeModel<TSchema extends ZodObject<ZodRawShape>>(opts: {
13
13
  type WithId = T & { id: string };
14
14
 
15
15
  const db = FirebaseAdmin.firestore();
16
- const collection = db.collection(collectionName);
16
+ const collection = db.collection(process.env.COLLECTION_SCOPE ? `${process.env.COLLECTION_SCOPE}__${collectionName}` : collectionName);
17
17
 
18
18
  function parseDoc(doc: any): WithId | null {
19
19
  if (!doc.exists) return null;