Files
freeCodeCamp/common/app/routes/Jobs/utils.js

23 lines
381 B
JavaScript
Raw Normal View History

2015-09-24 20:28:04 -07:00
const defaults = {
'string': {
value: '',
valid: false,
pristine: true,
type: 'string'
},
bool: {
value: false,
type: 'boolean'
}
};
export function getDefaults(type, value) {
if (!type) {
return defaults['string'];
}
if (value) {
return Object.assign({}, defaults[type], { value });
}
return Object.assign({}, defaults[type]);
2015-09-24 20:28:04 -07:00
}