feature: client: view: flac: add support

This commit is contained in:
coderaiser 2026-05-26 23:15:51 +03:00 committed by coderiaser
parent 1dfa7ca355
commit 4ee38db68c
2 changed files with 8 additions and 1 deletions

View file

@ -1,7 +1,7 @@
import {extname} from 'node:path';
import currify from 'currify';
export const isAudio = (name) => /\.(mp3|ogg|m4a)$/i.test(name);
export const isAudio = (name) => /\.(mp3|ogg|m4a|flac)$/i.test(name);
const testRegExp = currify((name, reg) => reg.test(name));
const getRegExp = (ext) => RegExp(`\\.${ext}$`, 'i');

View file

@ -8,6 +8,13 @@ test('cloudcmd: client: view: types: isAudio', (t) => {
t.end();
});
test('cloudcmd: client: view: types: isAudio: flac', (t) => {
const result = isAudio('hello.flac');
t.ok(result);
t.end();
});
test('cloudcmd: client: view: types: isAudio: no', (t) => {
const result = isAudio('hello');