db-vendo-client/parse/operator.js

16 lines
273 B
JavaScript
Raw Normal View History

2017-11-11 22:35:41 +01:00
'use strict'
const slugg = require('slugg')
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
}
}
module.exports = parseOperator