Return `true` if a file extension matches the given string, array of strings, or RegExp pattern.