ignore

  • Version 5.1.9
  • Published
  • 47.6 kB
  • No dependencies
  • MIT license

Install

npm i ignore
yarn add ignore
pnpm add ignore

Overview

Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.

Index

Functions

function ignore

ignore: typeof ignore;
  • Creates new ignore manager.

Interfaces

interface Ignore

interface Ignore {}

    method add

    add: { (pattern: string | Ignore): this; (patterns: (string | Ignore)[]): this };
    • Adds a rule rules to the current manager.

      Parameter pattern

      Returns

      IgnoreBase

    • Adds several rules to the current manager.

      Parameter patterns

      Returns

      IgnoreBase

    method createFilter

    createFilter: () => (pathname: Pathname) => boolean;
    • Creates a filter function which could filter an array of paths with Array.prototype.filter.

    method filter

    filter: (pathnames: Pathname[]) => Pathname[];
    • Filters the given array of pathnames, and returns the filtered array. NOTICE that each path here should be a relative path to the root of your repository.

      Parameter paths

      the array of paths to be filtered.

      Returns

      The filtered array of paths

    method ignores

    ignores: (pathname: Pathname) => boolean;
    • Returns Boolean whether pathname should be ignored.

      Parameter pathname

      a path to check

      Returns

      boolean

    method test

    test: (pathname: Pathname) => TestResult;
    • Returns whether pathname should be ignored or unignored

      Parameter pathname

      a path to check

      Returns

      TestResult

    Namespaces

    namespace ignore

    namespace ignore {}

      function isPathValid

      isPathValid: (pathname: string) => boolean;

        Package Files (1)

        Dependencies (0)

        No dependencies.

        Dev Dependencies (15)

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ignore.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ignore)
        • HTML
          <a href="https://www.jsdocs.io/package/ignore"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>