-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Merge PR #54667 [contentful-resolve-response] update resolveRespons…
…e params by @UrielCuriel
- Loading branch information
1 parent
f7b79ae
commit 32ac206
Showing
2 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
25 changes: 11 additions & 14 deletions
25
types/contentful-resolve-response/contentful-resolve-response-tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
|
||
import resolveResponse = require('contentful-resolve-response'); | ||
|
||
var response = { | ||
items: [ | ||
{ | ||
someValue: 'wow', | ||
someLink: {sys: {type: 'Link', linkType: 'Entry', id: 'suchId'}} | ||
} | ||
], | ||
includes: { | ||
Entry: [ | ||
{sys: {type: 'Entry', id: 'suchId'}, very: 'doge'} | ||
] | ||
} | ||
items: [ | ||
{ | ||
someValue: 'wow', | ||
someLink: { sys: { type: 'Link', linkType: 'Entry', id: 'suchId' } }, | ||
}, | ||
], | ||
includes: { | ||
Entry: [{ sys: { type: 'Entry', id: 'suchId' }, very: 'doge' }], | ||
}, | ||
}; | ||
|
||
var items = resolveResponse(response) | ||
var resolveResponseOptions = { removeUnresolved: true }; | ||
var items = resolveResponse(response, resolveResponseOptions); | ||
|
||
console.log(items); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters