processRelationPath.js 324 B

12345678910111213141516
  1. const utils = require('../../api/utils')
  2. const { browserPath } = utils
  3. const posix = browserPath()
  4. function processRelationPath(self, relation) {
  5. const from = self.is
  6. let to = relation
  7. if (to[0] === '.') {
  8. to = `../${to}`
  9. }
  10. const _p = posix.join(from, to)
  11. return _p
  12. }
  13. module.exports = processRelationPath