mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 01:26:16 -08:00
14 lines
353 B
JavaScript
14 lines
353 B
JavaScript
import { ArtPlayerError } from '../utils';
|
|
|
|
export default function validStringEmpty(paths, value, type) {
|
|
if (type !== 'string') {
|
|
throw new ArtPlayerError(`${paths.join('.')} required 'string' type.`);
|
|
}
|
|
|
|
if (value.trim() === '') {
|
|
throw new ArtPlayerError(`${paths.join('.')} can not be empty`);
|
|
}
|
|
|
|
return true;
|
|
}
|