@types/gitignore-parser
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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 03:09:37 GMT
  • Dependencies: none

Credits

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

Readme

Keywords

none

Package Sidebar

Install

npm i @types/gitignore-parser

Weekly Downloads

188

Version

0.0.3

License

MIT

Unpacked Size

4.48 kB

Total Files

5

Last publish

Collaborators

  • types