Function: f-ext-p

f-ext-p is a byte-compiled function defined in f.el.

Signature

(f-ext-p PATH &optional EXT)

Documentation

Return t if extension of PATH is EXT, false otherwise.

If EXT is nil or omitted, return t if PATH has any extension, false otherwise.

The extension, in a file name, is the part that follows the last
'.', excluding version numbers and backup suffixes.

Aliases

f-ext?

Source Code

;; Defined in ~/.emacs.d/elpa/f-20241003.1131/f.el
(defun f-ext-p (path &optional ext)
  "Return t if extension of PATH is EXT, false otherwise.

If EXT is nil or omitted, return t if PATH has any extension,
false otherwise.

The extension, in a file name, is the part that follows the last
'.', excluding version numbers and backup suffixes."
  (if ext
      (string= (f-ext path) ext)
    (not (eq (f-ext path) nil))))