<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond &%{QUERY_STRING} ^(?=.*&w=(\d+))(?=.*&h=(\d+))
RewriteCond %{DOCUMENT_ROOT}/resized/$1_%1_%2.$2 -f
RewriteRule ^(original/.+)\.(.+) /resized/$1_%1_%2.$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /resizer.php?path=$1 [L,QSA]
</IfModule>
interface PostAttachVideo {
type: 'video'
attach: AttachVideo
}
interface PostAttachAudio {
type: 'audio'
attach: AttachAudio
}
type PostAttach = PostAttachAudio | PostAttachVideo
function isAudio(attach: PostAttach): attach is PostAttachAudio {
return attach.type === 'audio';
}