mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
17 lines
264 B
JavaScript
17 lines
264 B
JavaScript
import slugg from 'slugg';
|
|
|
|
const parseOperator = (ctx, a) => {
|
|
const name = a.name && a.name.trim();
|
|
if (!name) {
|
|
return null;
|
|
}
|
|
return {
|
|
type: 'operator',
|
|
id: slugg(a.name), // todo: find a more reliable way
|
|
name,
|
|
};
|
|
};
|
|
|
|
export {
|
|
parseOperator,
|
|
};
|