Skip to content
Open
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
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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`);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down