UNPKG

@types/gitignore-parser

Version:
43 lines (35 loc) 1.52 kB
# Installation > `npm install --save @types/gitignore-parser` # Summary This package contains type definitions for gitignore-parser (https://github.com/codemix/gitignore-parser). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gitignore-parser. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gitignore-parser/index.d.ts) ````ts /** * Compile the given `.gitignore` content (not filename!) * and return an object with `accepts`, `denies` and `maybe` methods. * These methods each accepts a single filename and determines whether * they are acceptable or unacceptable according to the `.gitignore` definition. */ export function compile( content: string, ): { accepts(input: string): boolean; denies(input: string): boolean; maybe(input: string): boolean; }; /** * Parse the given `.gitignore` content and return an array * containing two further arrays - positives and negatives. * Each of these two arrays in turn contains two regexps, one * strict and one for 'maybe'. */ export function parse(content: string): [GitignoreParseResultSet, GitignoreParseResultSet]; export type GitignoreParseResultSet = [RegExp, RegExp]; // [strict, maybe] ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 03:09:37 GMT * Dependencies: none # Credits These definitions were written by [Alex Nuccio](https://github.com/anuccio1), and [Matt Schwartz](https://github.com/microsoftly).