Skip to content
Closed
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
30 changes: 15 additions & 15 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>} [options.walker] - Options to pass to node-source-walk
* @return {String[]}
* @return {string[]}
*/
declare function precinct(content: string | any, options?: {
type?: string;
walker?: Record<string, any>;
declare function precinct(content: string | object, options?: {
type?: string | undefined;
walker?: Record<string, any> | 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<string, any>} [options.walker] - Options to pass to node-source-walk
* @return {String[]}
* @return {string[]}
*/
function paperwork(filename: string, options?: {
includeCore?: boolean;
fileSystem?: any;
walker?: Record<string, any>;
includeCore?: boolean | undefined;
fileSystem?: object | undefined;
walker?: Record<string, any> | undefined;
}): string[];
}
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>} [options.walker] - Options to pass to node-source-walk
* @return {String[]}
* @return {string[]}
*/
function precinct(content, options = {}) {
debug('options given: %o', options);
Expand Down Expand Up @@ -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<string, any>} [options.walker] - Options to pass to node-source-walk
* @return {String[]}
* @return {string[]}
*/
precinct.paperwork = (filename, options = {}) => {
options = { includeCore: true, ...options };
Expand Down
22 changes: 18 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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