Options
All
  • Public
  • Public/Protected
  • All
Menu

Module helpers/images

Index

Type aliases

IMatcherFunction

IMatcherFunction: (path: string, size: ISize, source: Vinyl) => boolean

Type declaration

    • (path: string, size: ISize, source: Vinyl): boolean
    • Parameters

      • path: string
      • size: ISize
      • source: Vinyl

      Returns boolean

Matcher

Matcher: string | IMatcherFunction

There is support of 3 types of matchers:

  1. Glob pattern of file path;
  2. Media query to match image by size;
  3. (path: string, size: ISize, source: Vinyl) => boolean function.

Functions

attachMetadata

  • attachMetadata(source: Vinyl, force?: boolean): Promise<ISrcSetVinyl>
  • Attach image metadata to the vinyl file.

    Parameters

    • source: Vinyl

      Image file.

    • force: boolean = false

      Force refetch metadata.

    Returns Promise<ISrcSetVinyl>

    Source image file with attached metadata.

cloneSrcSetVinyl

getFormat

isVinylBuffer

  • isVinylBuffer(source: Vinyl): boolean
  • Check object is Vinyl-buffer.

    Parameters

    • source: Vinyl

      Object to check.

    Returns boolean

    Result.

matchImage

  • Match image file by path and size

    Parameters

    Returns Promise<boolean>

    Image is matched or not.

Generated using TypeDoc