diff --git a/lib/find-nearest-package.js b/lib/find-nearest-package.js index 6d70683..2728409 100644 --- a/lib/find-nearest-package.js +++ b/lib/find-nearest-package.js @@ -1,13 +1,13 @@ import parse from 'parse-author' import {read} from 'to-vfile' -import {findUpOne} from 'vfile-find-up' +import {findUp} from 'vfile-find-up' /** * @param {string} base * @returns {Promise<{license: string|undefined, name: string|undefined, url: string|undefined}>} */ export async function findNearestPackage(base) { - const file = await findUpOne('package.json', base) + const file = await findUp('package.json', base) if (file) { await read(file) diff --git a/lib/index.js b/lib/index.js index 9eacaba..cede4f3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -38,7 +38,7 @@ import path from 'node:path' import spdx from 'spdx-license-list' -import {findUpOne} from 'vfile-find-up' +import {findUp} from 'vfile-find-up' import {headingRange} from 'mdast-util-heading-range' import {findNearestPackage} from './find-nearest-package.js' import {findLicense} from './find-license.js' @@ -64,7 +64,7 @@ export default function remarkLicense(options = {}) { // Else is for stdin, typically not used. /* c8 ignore next */ const base = file.dirname ? path.resolve(file.cwd, file.dirname) : file.cwd - const packageFile = await findUpOne('package.json', base) + const packageFile = await findUp('package.json', base) /** @type {string|undefined} */ let defaultName /** @type {string|undefined} */ diff --git a/package.json b/package.json index e34011f..e10f25c 100644 --- a/package.json +++ b/package.json @@ -42,25 +42,25 @@ "index.js" ], "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-heading-range": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-heading-range": "^4.0.0", "parse-author": "^2.0.0", "spdx-license-list": "^6.0.0", - "to-vfile": "^7.0.0", - "unified": "^10.0.0", - "vfile-find-up": "^6.0.0" + "to-vfile": "^8.0.0", + "unified": "^11.0.0", + "vfile-find-up": "^7.0.0" }, "devDependencies": { "@types/node": "^20.0.0", "@types/parse-author": "^2.0.0", "c8": "^8.0.0", "prettier": "^3.0.0", - "remark": "^14.0.0", + "remark": "^15.0.0", "remark-cli": "^11.0.0", "remark-preset-wooorm": "^9.0.0", "semver": "^7.0.0", "type-coverage": "^2.0.0", - "type-fest": "^2.0.0", + "type-fest": "^4.0.0", "typescript": "^5.0.0", "xo": "^0.56.0" },