default properties
This commit is contained in:
parent
3dbdcdba07
commit
d23c190cad
1 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
import operations from 'shared/operations';
|
import operations from 'shared/operations';
|
||||||
|
import * as properties from './properties';
|
||||||
|
|
||||||
const VALID_TOP_KEYS = ['keymaps', 'search', 'blacklist', 'properties'];
|
const VALID_TOP_KEYS = ['keymaps', 'search', 'blacklist', 'properties'];
|
||||||
const VALID_OPERATION_VALUES = Object.keys(operations).map((key) => {
|
const VALID_OPERATION_VALUES = Object.keys(operations).map((key) => {
|
||||||
|
@ -48,12 +49,12 @@ const validateSearch = (search) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateProperties = (properties) => {
|
const validateProperties = (props) => {
|
||||||
for (let name of Object.keys(properties)) {
|
for (let name of Object.keys(props)) {
|
||||||
if (!properties.types[name]) {
|
if (!properties.types[name]) {
|
||||||
throw new Error(`Unknown property name: "${name}"`);
|
throw new Error(`Unknown property name: "${name}"`);
|
||||||
}
|
}
|
||||||
if (typeof properties[name] !== properties.types[name]) {
|
if (typeof props[name] !== properties.types[name]) {
|
||||||
throw new Error(`Invalid type for property: "${name}"`);
|
throw new Error(`Invalid type for property: "${name}"`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue