Home Reference Source Test Repository

Function

Static Public Summary
public

Creates recommendation objects from collection doc ensuring that necessary properties are present

Static Public

public createRecommendations(collectionDoc: CollectionDocJSON): Array<Recommendation> source

import createRecommendations from '@npr/npr-one-sdk/util/recommendation-creator.js'

Creates recommendation objects from collection doc ensuring that necessary properties are present

Params:

NameTypeAttributeDescription
collectionDoc CollectionDocJSON

Throw:

TypeError

if the collectionDoc passed in is not valid

Test: