import { camelCase } from '@sap-cloud-sdk/util' ; import { EntityBase , EntityApi } from '../entity-base' ; param entity param entityApi returns internal export function getEntityKeys < EntityT extends EntityBase > ( entity , entityApi ) { if ( ! entity ) { throw new Error ( 'getEntityKeys() cannot extract keys from an undefined or null object.' ) ; } return entityApi . entityConstructor . _keys . reduce ( ( prev , curr ) => ( { ... prev , [ curr ] : encodeURIComponent ( entity [ camelCase ( curr ) ] ) } ) , { } ) ; }