-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSDoc comment for deserialise()
is inconsistent with implementation
#578
Comments
Thank you, it seems some of the JSDoc examples didn't get updated in the 9.x release. |
I'm fairly certain this is not an actual problem. If you run the example exactly as-is, you get the expected output. I have removed the variable names from my example below to avoid confusing
I think its worth noting that
response.data , which explains the difference between the between the output of deserialise and linkRelationships
|
If I run the linked example exactly as is: const { deserialise } = require("kitsu-core");
deserialise({
data: {
id: '1',
relationships: {
user: {
data: {
type: 'users',
id: '2' }
}
}
},
included: [
{
type: 'users',
id: '2',
attributes: { slug: 'wopian' }
}
]
}) the output is: { data: { id: '1', user: { data: { type: 'users', id: '2', slug: 'wopian' }}}} while the JSDoc comment says it should be: { data: { id: '1', user: { type: 'users', id: '2', slug: 'wopian' } } } |
Yes, 9.x added This didn't get updated in the documentation and appears I forgot to make this change after this issue was opened :( |
Thank you for the fix! :) |
Released in 10.0.0-alpha.26 and 9.1.26 |
This example states that the linked relationship
user
will look like this:However, according to the linkRelationships documentation and a brief test, the function output looks like this:
The text was updated successfully, but these errors were encountered: