mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-09-19 10:32:57 +02:00
16 lines
382 B
JavaScript
16 lines
382 B
JavaScript
/* eslint-disable import/prefer-default-export */
|
|
|
|
/**
|
|
* Returns id without the feedId prefix.
|
|
*
|
|
* @param {String} feedScopedId should be in feedId:objectId format.
|
|
*/
|
|
export const getIdWithoutFeed = feedScopedId => {
|
|
if (!feedScopedId) {
|
|
return undefined;
|
|
}
|
|
if (feedScopedId.indexOf(':') === -1) {
|
|
return feedScopedId;
|
|
}
|
|
return feedScopedId.split(':')[1];
|
|
};
|