Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ const transformKeys = (obj, transformFunc) => {

/**
* Finds an included resource by type and id.
* @param {Array} included - The array of included resources.
* @param {Array|undefined} included - The array of included resources.
* @param {string} type - The type of the resource to find.
* @param {string} id - The id of the resource to find.
* @returns {Object|undefined} The found resource or undefined.
*/
const findIncluded = (included, type, id) => {
if (!(Array.isArray(included))) {
return
}
return included.find(item => item.type === type && item.id === id);
};

Expand Down