mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: client: view: flac: add support
This commit is contained in:
parent
1dfa7ca355
commit
4ee38db68c
2 changed files with 8 additions and 1 deletions
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue