• Checks if a given string represents an image file path with extensions such as jpg, jpeg, png, gif, webp, or avif.

    Example

    isImage('dummy.jpeg')
    // => true

    isImage('dummy.weBp')
    // => true

    isImage('dummy.PNG')

    // => true

    isImage('dummy.docx')
    // => false

    isImage('/home/demo/dummy')
    // => false

    isImage(undefined)
    // => false

    Parameters

    • path: string

    Returns boolean

    true if the given string represents an image file path, false otherwise.

Generated using TypeDoc v0.24.7