'use strict';

const index = require('./index-4f00f593.js');

function assertSome(value) {
  const option = index.fromNullable(value);
  if (index.isSome(option)) {
    return option;
  }
  throw new Error('Expected value');
}
function getOrDefault(option, value) {
  return index.pipe(option, index.getOrElse(() => value));
}
function getOrError(option, error = 'Option value is none.') {
  return index.pipe(option, index.getOrElse(() => {
    throw new Error(error);
  }));
}
function toSelectInputOptionsArray(list) {
  return list.map((s) => ({ label: String(s), value: s }));
}

exports.assertSome = assertSome;
exports.getOrDefault = getOrDefault;
exports.getOrError = getOrError;
exports.toSelectInputOptionsArray = toSelectInputOptionsArray;
