mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
[web] change esm codemod to use vitest and general refactor GitOrigin-RevId: 7f8c699b160ee0b7ff991d6284cb126165694c4f
14 lines
226 B
JavaScript
14 lines
226 B
JavaScript
/**
|
|
*
|
|
* @return {Node}
|
|
*/
|
|
function getLastImport(body) {
|
|
return body.reduce((lastIndex, node, index) => {
|
|
return node.type === 'ImportDeclaration' ? index : lastIndex
|
|
}, -1)
|
|
}
|
|
|
|
module.exports = {
|
|
getLastImport,
|
|
}
|