import { getProp , cloneObject } from "@esri/hub-common" ; import { IInitiativeModel } from "@esri/hub-common" ; param model protected export function upgradeToTwoDotOne ( model ) { const currVersion = getProp ( model , "item.properties.schemaVersion" ) ; if ( currVersion < 2.1 ) { const clone = cloneObject ( model ) as IInitiativeModel ; clone . item . properties . schemaVersion = 2.1 ; const collaborationGroupId = getProp ( model , "item.properties.groupId" ) ; if ( collaborationGroupId ) { clone . item . properties . collaborationGroupId = collaborationGroupId ; delete clone . item . properties . groupId ; } return clone ; } else { return model ; } }