codeowners-utils
Utilities for working with CODEOWNERS files
Install
npm install --save codeowners-utils
API
From the generated dist/codeowners-utils.d.ts
file:
export interface CodeOwnersEntry {
pattern: string
owners: Array<string>
}
export declare function parse(str: string): Array<CodeOwnersEntry>
export declare let CODEOWNERS_PATHS: string[]
export declare function findOwnersPath(cwd: string): Promise<string | null>
export declare function loadOwners(
cwd: string,
): Promise<Array<CodeOwnersEntry> | null>
export declare function matchPattern(filename: string, pattern: string): boolean
export declare function matchFile(
filename: string,
entries: Array<CodeOwnersEntry>,
): CodeOwnersEntry | null
export declare function filterUnmatchedFiles(
files: Array<string>,
entries: Array<CodeOwnersEntry>,
): string[]
export declare function findUnmatchedFilesFromEntries(
entries: Array<CodeOwnersEntry>,
cwd: string,
): Promise<Array<string>>
export declare function findUnmatchedFiles(
cwd: string,
): Promise<Array<string> | null>