Skip to content

Commit

Permalink
refactor(CollectionReference): Rename metaItem method to `getItemMe…
Browse files Browse the repository at this point in the history
…tadata` in CollectionReference

BREAKING CHANGE: The `metaItem` method in the `CollectionReference` not available anymore. use `getItemMetadata` instead.

Co-authored-by: Mohammad Honarvar <[email protected]>
  • Loading branch information
alimd and mohammadhonarvar committed Aug 31, 2024
1 parent 44ee78e commit 3c9cfdb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/reference/src/collection-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,16 @@ export class CollectionReference<TItem extends JsonifiableObject = JsonifiableOb
/**
* Retrieves an item's metadata from the collection. If the item does not exist, an error is thrown.
*
* @param id - The ID of the item.
* @param itemId - The ID of the item.
* @returns The metadata of the item with the given ID.
* @example
* ```typescript
* const itemMeta = collectionRef.getItemMetadata('item1');
* ```
*/
metaItem(id: string | number): Readonly<CollectionItemMeta> {
const meta = this.item__(id).meta;
this.logger__.logMethodFull?.('meta', id, meta);
getItemMetadata(itemId: string | number): Readonly<CollectionItemMeta> {
const meta = this.item__(itemId).meta;
this.logger__.logMethodFull?.('getItemMetadata', itemId, meta);
return meta;
}

Expand Down

0 comments on commit 3c9cfdb

Please sign in to comment.