Szenario
A method matter returns an object, like return {content, data}
Conflict
The second call of the method (a method from a node module) overwrites previous vars set from return.
import matter from 'gray-matter'
const test = () => {
...
const { content, data } = matter(source1)
const { content, data } = matter(source2) // this overwrites previous content, data vars
...
}
Goal / Question
Setting the return values in different named vars, like:
const { content2, data2 } = matter(source2) // like so it leads to an compiling error property content2 does not exists on type [...]
So, how can be the return values assigned to different named vars as they are named in the type?