Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ async function yamlLoader(_, content) {
`'yaml' is required for the YAML configuration files. Make sure it is installed\nError: ${e.message}`
)
}
/* c8 ignore stop */
}
return yaml.parse(content);
return yaml.parse(content)
}

/** @return {import('lilconfig').Options} */
Expand Down
5 changes: 5 additions & 0 deletions src/req.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,23 @@ async function req(name, rootFile = __filename) {
/* c8 ignore start */
throw err
}
/* c8 ignore stop */
}

if (tsx === undefined) {
try {
tsx = await import('tsx/cjs/api')
} catch (error) {
/* c8 ignore start */
importError.push(error)
}
/* c8 ignore stop */
}

if (tsx) {
let loaded = tsx.require(name, rootFile)
return loaded && '__esModule' in loaded ? loaded.default : loaded
/* c8 ignore start */
}

if (jiti === undefined) {
Expand All @@ -57,6 +61,7 @@ async function req(name, rootFile = __filename) {
.map(error => error.message)
.join('\n')}`
)
/* c8 ignore stop */
}

module.exports = req