-
released this
2023-12-06 15:51:55 +00:00 | 6 commits to main since this releaseAdded the ability to generically interact with Entries inside of Collections, which now allows you to specify how entries are structured in your Database via Interfaces.
Example:
interface Dog extends EntryData { name: string, age: number, race: name } const collection = ms.getCollection<Dog>("dog-list"); collection.getEntries({ name: "Bella" }).then(entry => { console.log(`Bella's race is: ${entry.getValue("race")}`) });
TypeScript automatically detects the type of all of the entry's values with the help of the interface we have created in the above example.
Changelog:
- Added Generic Types
- Removed
.getValuesAs<T>
What's Changed
- Added Generic Types - Version 2.0.0 by @MarciiTheDev in https://github.com/MarciiTheDev/marcsync-nodejs-client/pull/4
- Version 2.0.0 Release Merge by @MarciiTheDev in https://github.com/MarciiTheDev/marcsync-nodejs-client/pull/5
New Contributors
- @MarciiTheDev made their first contribution in https://github.com/MarciiTheDev/marcsync-nodejs-client/pull/4
Full Changelog: https://github.com/MarciiTheDev/marcsync-nodejs-client/compare/v1.1.4-dev...v1.2.0
Downloads