npm.io
0.0.3 • Published 2 years ago

@types/gitignore-parser

Licence
MIT
Version
0.0.3
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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

/**
 * 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 0337 GMT
  • Dependencies: none

Credits

These definitions were written by Alex Nuccio, and Matt Schwartz.