Skip to content

Commit

Permalink
chore: getPackageJson findUp默认为true
Browse files Browse the repository at this point in the history
chore:  getPackageJson findUp默认为true
  • Loading branch information
zhangfisher authored Feb 28, 2025
2 parents 8cce532 + 74c0053 commit 251ffd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/package/getPackageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from "node:path"
* @param findUp 是否向上查找package.json,默认为true
* @returns
*/
export function getPackageJson(entry?:string,findUp?:boolean):PackageJson | undefined{
export function getPackageJson(entry?:string,findUp:boolean = true):PackageJson | undefined{
const packageRoot =findUp ? getPackageRootPath(entry) as string : entry || process.cwd()
try{
return require(path.join(packageRoot,"package.json"))
Expand Down

0 comments on commit 251ffd0

Please sign in to comment.