'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var addAll = require('./add-all.js');
var last = require('it-last');
var configure = require('./lib/configure.js');
var normaliseInputSingle = require('ipfs-core-utils/files/normalise-input-single');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var last__default = /*#__PURE__*/_interopDefaultLegacy(last);

function createAdd(options) {
  const all = addAll.createAddAll(options);
  return configure.configure(() => {
    async function add(input, options = {}) {
      return await last__default["default"](all(normaliseInputSingle.normaliseInput(input), options));
    }
    return add;
  })(options);
}

exports.createAdd = createAdd;
