db-vendo-client/parse/operator.js

16 lines
250 B
JavaScript
Raw Permalink Normal View History

2022-05-07 16:17:37 +02:00
import slugg from 'slugg'
2017-11-11 22:35:41 +01:00
const parseOperator = (ctx, a) => {
2018-04-12 21:25:40 +02:00
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
2018-04-12 21:25:40 +02:00
name
2017-11-11 22:35:41 +01:00
}
}
2022-05-07 16:17:37 +02:00
export {
parseOperator,
}