mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
13 lines
418 B
JavaScript
13 lines
418 B
JavaScript
import { ArtPlayerError } from '../utils';
|
|
|
|
export default function validElementMap(paths, value) {
|
|
return Object.keys(value).every(key => {
|
|
const mapValue = value[key];
|
|
const mapType = typeof mapValue;
|
|
if (mapValue instanceof Element || mapType === 'string') {
|
|
return true;
|
|
}
|
|
throw new ArtPlayerError(`${paths.join('.')} require 'string' or 'Element' type, but got '${mapType}'`);
|
|
});
|
|
}
|