AssetCompress\Middleware\AssetCompressMiddleware::mapType PHP Method

mapType() protected method

Map an extension to a content type
protected mapType ( AssetTarget $build ) : string
$build MiniAsset\AssetTarget The build target.
return string The mapped content type.
    protected function mapType($build)
    {
        $ext = $build->ext();
        $types = ['css' => 'text/css', 'js' => 'application/javascript'];
        return isset($types[$ext]) ? $types[$ext] : 'application/octet-stream';
    }