Helper function to check if a file path is an ES module (.mjs) but not a source map (.mjs.map)
| 46 | |
| 47 | // Helper function to check if a file path is an ES module (.mjs) but not a source map (.mjs.map) |
| 48 | bool ModuleInternal::IsESModule(const std::string& path) { |
| 49 | return path.size() >= 4 && path.compare(path.size() - 4, 4, ".mjs") == 0 && |
| 50 | !(path.size() >= 8 && path.compare(path.size() - 8, 8, ".mjs.map") == 0); |
| 51 | } |
| 52 | |
| 53 | ModuleInternal::ModuleInternal() |
| 54 | : m_isolate(nullptr), m_requireFunction(nullptr), m_requireFactoryFunction(nullptr) { |