This commit is contained in:
Harvey Zack committed 2018-11-10 11:57:28 +08:00
1 parent c25038b74c
commit ae548e93c8
18 files changed
+176 -101

No files matched your search

@@ -0,0 +1,12 @@
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}'`);
});
}