import _ from 'lodash';
import { runtimeValidate } from './global';
import { buildDefaultOption, buildSpecificOption } from './default';
import * as color from './color';

const buildOption = (option) => {
  option = option || {};

  runtimeValidate();

  const exports = {};
  const defaultOption = buildDefaultOption(option);
  const specificOption = buildSpecificOption(option);
  return _.merge(exports, defaultOption, specificOption, option);
};

export { buildOption, color };
export default buildOption;
