1
0
Förgrening 0
spegling av https://github.com/HSLdevcom/digitransit-ui synced 2025-09-19 10:32:57 +02:00
digitransit-ui/app/util/feedScopedIdUtils.js
2022-10-11 16:53:14 +03:00

16 rader
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];
};