| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 11 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import Handlebars from 'handlebars' |
||
| 2 | |||
| 3 | /** |
||
| 4 | * Handlebars helper, remove config.root from array of path |
||
| 5 | */ |
||
| 6 | export default function removeRootPath(obj, url, formater) { |
||
| 7 | obj = JSON.parse(JSON.stringify(obj).replace(new RegExp(JSON.parse(url).root, 'g'), '')) |
||
| 8 | obj = Handlebars.helpers[formater](obj) |
||
| 9 | |||
| 10 | return obj |
||
| 11 | } |
||
| 12 |