diff --git a/index.d.ts b/index.d.ts index bb24d62..e7af83e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2,30 +2,30 @@ export = precinct; /** * Finds the list of dependencies for the given file * - * @param {String|Object} content - File's content or AST - * @param {Object} [options] - * @param {String} [options.type] - The type of content being passed in. Useful if you want to use a non-JS detective + * @param {string|object} content - File's content or AST + * @param {object} [options] + * @param {string} [options.type] - The type of content being passed in. Useful if you want to use a non-JS detective * @param {Record} [options.walker] - Options to pass to node-source-walk - * @return {String[]} + * @return {string[]} */ -declare function precinct(content: string | any, options?: { - type?: string; - walker?: Record; +declare function precinct(content: string | object, options?: { + type?: string | undefined; + walker?: Record | undefined; }): string[]; declare namespace precinct { /** * Returns the dependencies for the given file path * - * @param {String} filename - * @param {Object} [options] - * @param {Boolean} [options.includeCore=true] - Whether or not to include core modules in the dependency list - * @param {Object} [options.fileSystem=undefined] - An alternative fs implementation to use for reading the file path. + * @param {string} filename + * @param {object} [options] + * @param {boolean} [options.includeCore=true] - Whether or not to include core modules in the dependency list + * @param {object} [options.fileSystem=undefined] - An alternative fs implementation to use for reading the file path. * @param {Record} [options.walker] - Options to pass to node-source-walk - * @return {String[]} + * @return {string[]} */ function paperwork(filename: string, options?: { - includeCore?: boolean; - fileSystem?: any; - walker?: Record; + includeCore?: boolean | undefined; + fileSystem?: object | undefined; + walker?: Record | undefined; }): string[]; } diff --git a/index.js b/index.js index 1cc47a9..351a3bc 100644 --- a/index.js +++ b/index.js @@ -22,11 +22,11 @@ const debug = debuglog('precinct'); /** * Finds the list of dependencies for the given file * - * @param {String|Object} content - File's content or AST - * @param {Object} [options] - * @param {String} [options.type] - The type of content being passed in. Useful if you want to use a non-JS detective + * @param {string|object} content - File's content or AST + * @param {object} [options] + * @param {string} [options.type] - The type of content being passed in. Useful if you want to use a non-JS detective * @param {Record} [options.walker] - Options to pass to node-source-walk - * @return {String[]} + * @return {string[]} */ function precinct(content, options = {}) { debug('options given: %o', options); @@ -81,12 +81,12 @@ function precinct(content, options = {}) { /** * Returns the dependencies for the given file path * - * @param {String} filename - * @param {Object} [options] - * @param {Boolean} [options.includeCore=true] - Whether or not to include core modules in the dependency list - * @param {Object} [options.fileSystem=undefined] - An alternative fs implementation to use for reading the file path. + * @param {string} filename + * @param {object} [options] + * @param {boolean} [options.includeCore=true] - Whether or not to include core modules in the dependency list + * @param {object} [options.fileSystem=undefined] - An alternative fs implementation to use for reading the file path. * @param {Record} [options.walker] - Options to pass to node-source-walk - * @return {String[]} + * @return {string[]} */ precinct.paperwork = (filename, options = {}) => { options = { includeCore: true, ...options }; diff --git a/package-lock.json b/package-lock.json index 3629c9a..dc22cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "module-definition": "^6.0.2", "node-source-walk": "^7.0.2", "postcss": "^8.5.14", - "typescript": "^5.9.3" + "typescript": "^6.0.3" }, "bin": { "precinct": "bin/cli.js" @@ -8235,9 +8235,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -8922,6 +8922,20 @@ "node": "*" } }, + "node_modules/xo/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 62f96da..34d86a5 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "module-definition": "^6.0.2", "node-source-walk": "^7.0.2", "postcss": "^8.5.14", - "typescript": "^5.9.3" + "typescript": "^6.0.3" }, "devDependencies": { "c8": "^10.1.3",