Skip to content

Commit

Permalink
Accept URL for stopAt option
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 8, 2023
1 parent 12605f9 commit ba19153
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -9,7 +9,7 @@ export const findUpStop = Symbol('findUpStop');
export async function findUpMultiple(name, options = {}) {
let directory = path.resolve(toPath(options.cwd) || '');
const {root} = path.parse(directory);
const stopAt = path.resolve(directory, options.stopAt || root);
const stopAt = path.resolve(directory, toPath(options.stopAt ?? root));
const limit = options.limit || Number.POSITIVE_INFINITY;
const paths = [name].flat();

Expand Down Expand Up @@ -53,7 +53,7 @@ export async function findUpMultiple(name, options = {}) {
export function findUpMultipleSync(name, options = {}) {
let directory = path.resolve(toPath(options.cwd) || '');
const {root} = path.parse(directory);
const stopAt = options.stopAt || root;
const stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);
const limit = options.limit || Number.POSITIVE_INFINITY;
const paths = [name].flat();

Expand Down

0 comments on commit ba19153

Please sign in to comment.