pkg-types
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -161,2 +161,27 @@ import { CompilerOptions, TypeAcquisition } from 'typescript'; | ||
interface FindNearestFileOptions { | ||
/** | ||
* The starting directory for the search. | ||
* @default . (same as `process.cwd()`) | ||
*/ | ||
startingFrom?: string; | ||
/** | ||
* A pattern to match a path segment above which you don't want to ascend | ||
* @default /^node_modules$/ | ||
*/ | ||
rootPattern?: RegExp; | ||
/** | ||
* A matcher that can evaluate whether the given path is a valid file (for example, | ||
* by testing whether the file path exists. | ||
* | ||
* @default fs.statSync(path).isFile() | ||
*/ | ||
test?: (filePath: string) => boolean | null | Promise<boolean | null>; | ||
} | ||
declare function findNearestFile(filename: string, _options?: FindNearestFileOptions): Promise<string | null>; | ||
declare function findNearestPackageJSON(id?: string): Promise<string | null>; | ||
declare function findNearestTSConfig(id?: string): Promise<string | null>; | ||
declare function readNearestPackageJSON(id?: string): Promise<PackageJson | null>; | ||
declare function readNearestTSConfig(id?: string): Promise<TSConfig | null>; | ||
declare function definePackageJSON(pkg: PackageJson): PackageJson; | ||
@@ -169,2 +194,2 @@ declare function defineTSConfig(tsconfig: TSConfig): TSConfig; | ||
export { PackageJson, PackageJsonPerson, StripEnums, TSConfig, definePackageJSON, defineTSConfig, readPackageJSON, readTSConfig, writePackageJSON, writeTSConfig }; | ||
export { FindNearestFileOptions, PackageJson, PackageJsonPerson, StripEnums, TSConfig, definePackageJSON, defineTSConfig, findNearestFile, findNearestPackageJSON, findNearestTSConfig, readNearestPackageJSON, readNearestTSConfig, readPackageJSON, readTSConfig, writePackageJSON, writeTSConfig }; |
{ | ||
"name": "pkg-types", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
20750
6
365