How to check file is minified (.min) programmatically Magento 2?

You can check any file is minified or not using Magento 2.
If any file contains the name with .min. like jquery.min.js or owlcarousel.min.js

If you are working on the project and some time if you need to check file is minified or not programmatically, in this case this article is useful.

You can check it using simple PHP functions,

<?php

    /**
     * Is Minified Filename
     *
     * @param string $filename
     * @return bool
     */
    public function isMinifiedFilename($filename)
    {
        return substr($filename, strrpos($filename, '.') - 4, 5) == '.min.';
    }

Check from the template or other Class,

$filename = "jquery.min.js";
echo $this->isMinifiedFilename($filename); // true

$filename = "jquery.js";
echo $this->isMinifiedFilename($filename); // false

You can verify the file is minified or not using the above function.