This commit is contained in:
Harvey Zack committed 2018-11-12 10:00:55 +08:00
1 parent eed28c1d21
commit 7f1e1dc255
10 files changed
+44 -89

No files matched your search

-5
View File
@@ -1,6 +1,5 @@
import validElement from './validElement';
import validStringEmpty from './validStringEmpty';
import validElementMap from './validElementMap';
export default {
container: {
@@ -64,10 +63,6 @@ export default {
url: 'string'
}
},
replace: {
type: 'object',
validator: validElementMap
},
theme: 'string',
hotkey: 'boolean',
pip: 'boolean',
@@ -1,12 +0,0 @@
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}'`);
});
}