firebase / firebase/snippets-web
get_custom_object and other tests/snippets should not rely on `toString` to verify custom object types
- Dominant language
- JavaScript
- Stars
- 802
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/firebase/snippets-web/blob/1abb6ce1a784ae5552946dff5f1f5aab7dcbda30/snippets/firestore-next/test-firestore/get_custom_object.js#L16
The `toString()` method exists on each `Object` already, so it is not a great example to highlight that we get a custom object type back when using `withConverter`. I recommend using `name`, `state`, and/or `country` instead.
Contributor guide
Research direction
Start at snippets/firestore-next/test-firestore/get_custom_object.js#L16 and review how the custom object is checked in that example. Replace reliance on toString with the suggested name, state, or country properties, then check the related tests or snippets for the same pattern and confirm they demonstrate the converted object fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100