utils.js 226 B

12345678910111213
  1. /**
  2. *
  3. * @return {Node}
  4. */
  5. function getLastImport(body) {
  6. return body.reduce((lastIndex, node, index) => {
  7. return node.type === 'ImportDeclaration' ? index : lastIndex
  8. }, -1)
  9. }
  10. module.exports = {
  11. getLastImport,
  12. }