diff --git a/index.js b/index.js index 0eea20c..dda61df 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ import path from 'path'; import {readFile} from 'fs/promises'; import {pathToFileURL} from 'url'; import camelcase from 'camelcase'; -import {findUp} from 'find-up'; +import {up as findUp, any as findAnyUp} from 'empathic/find'; import resolveFrom from 'resolve-from'; import getPackageType from 'get-package-type'; @@ -33,7 +33,7 @@ function camelcasedConfig(config) { async function findPackage(options) { const cwd = options.cwd || process.env.NYC_CWD || process.cwd(); - const pkgPath = await findUp('package.json', {cwd}); + const pkgPath = findUp('package.json', {cwd}); if (pkgPath) { const pkgConfig = JSON.parse(await readFile(pkgPath, 'utf8')).nyc || {}; if ('cwd' in pkgConfig) { @@ -133,7 +133,7 @@ async function applyExtends(config, filename, loopCheck = new Set()) { export async function loadNycConfig(options = {}) { const {cwd, pkgConfig} = await findPackage(options); const configFiles = [].concat(options.nycrcPath || standardConfigFiles); - const configFile = await findUp(configFiles, {cwd}); + const configFile = findAnyUp(configFiles, {cwd}); if (options.nycrcPath && !configFile) { throw new Error(`Requested configuration file ${options.nycrcPath} not found`); } diff --git a/package.json b/package.json index 8ee2d70..b441efa 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "homepage": "https://github.com/istanbuljs/load-nyc-config#readme", "dependencies": { "camelcase": "^9.0.0", - "find-up": "^8.0.0", + "empathic": "^2.0.0", "get-package-type": "^0.1.0", "resolve-from": "^5.0.0", "yaml": "^2.8.3"