const KEY = '$___storybook.Boolean';

const booleanType = {
  KEY,
  is: value => value instanceof Boolean,
  serialize: value => ({ [KEY]: value.valueOf() }),
  /* eslint-disable-next-line no-new-wrappers */
  deserialize: value => new Boolean(value[KEY]),
};

export default booleanType;
