Skip to content

Commit

Permalink
refactor: Rename exists method to itemExists in CollectionReference
Browse files Browse the repository at this point in the history
BREAKING CHANGE: exists renamed to itemExists in CollectionReference
  • Loading branch information
alimd committed Sep 1, 2024
1 parent 4dfee95 commit 7555803
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/reference/src/collection-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,16 @@ export class CollectionReference<TItem extends JsonifiableObject = JsonifiableOb
*
* @example
* ```typescript
* const doesExist = collectionRef.exists('item1');
* const doesExist = collectionRef.itemExists('item1');
*
* if (doesExist) {
* collectionRef.create('item1', { key: 'value' });
* }
* ```
*/
exists(itemId: string | number): boolean {
itemExists(itemId: string | number): boolean {
const exists = Object.hasOwn(this.context__.data, itemId);
this.logger__.logMethodFull?.('exists', itemId, exists);
this.logger__.logMethodFull?.('itemExists', itemId, exists);
return exists;
}

Expand Down

0 comments on commit 7555803

Please sign in to comment.