db-vendo-client/parse/operator.js

18 lines
264 B
JavaScript
Raw Normal View History

import slugg from 'slugg';
2017-11-11 22:35:41 +01:00
const parseOperator = (ctx, a) => {
const name = a.name && a.name.trim();
if (!name) {
return null;
}
2017-11-11 22:35:41 +01:00
return {
type: 'operator',
id: slugg(a.name), // todo: find a more reliable way
name,
};
};
2017-11-11 22:35:41 +01:00
2022-05-07 16:17:37 +02:00
export {
parseOperator,
};