pkg-types
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,4 +0,25 @@ | ||
import { ResolveOptions } from 'mlly'; | ||
import { ResolveOptions as ResolveOptions$1 } from 'mlly'; | ||
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>; | ||
declare type StripEnums<T extends Record<string, any>> = { | ||
@@ -162,23 +183,3 @@ [K in keyof T]: T[K] extends boolean ? T[K] : T[K] extends string ? T[K] : T[K] extends object ? T[K] : T[K] extends Array<any> ? T[K] : T[K] extends undefined ? undefined : any; | ||
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>; | ||
declare type ResolveOptions = ResolveOptions$1 & FindNearestFileOptions; | ||
declare function definePackageJSON(pkg: PackageJson): PackageJson; | ||
@@ -193,2 +194,2 @@ declare function defineTSConfig(tsconfig: TSConfig): TSConfig; | ||
export { FindNearestFileOptions, PackageJson, PackageJsonPerson, StripEnums, TSConfig, definePackageJSON, defineTSConfig, findNearestFile, readPackageJSON, readTSConfig, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig }; | ||
export { FindNearestFileOptions, PackageJson, PackageJsonPerson, ResolveOptions, StripEnums, TSConfig, definePackageJSON, defineTSConfig, findNearestFile, readPackageJSON, readTSConfig, resolvePackageJSON, resolveTSConfig, writePackageJSON, writeTSConfig }; |
{ | ||
"name": "pkg-types", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`", | ||
@@ -17,3 +17,3 @@ "license": "MIT", | ||
"scripts": { | ||
"prepare": "unbuild", | ||
"prepack": "unbuild", | ||
"release": "standard-version && npm publish && git push --follow-tags", | ||
@@ -20,0 +20,0 @@ "test": "mocha -r jiti/register ./test/**/*.test.*", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
18252
344