All files / src mollie.js

50% Statements 2/4
66.67% Branches 2/3
100% Functions 1/1
50% Lines 2/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19                    1x 1x              
import createHttpClient from './create-http-client';
import createMollieApi from './create-mollie-api';
 
/**
 * Create Mollie client.
 * @param options
 * @returns {Object} available resources
 * @since 2.0.0
 */
export default function mollie(options = {}) {
  Eif (!options.apiKey) {
    throw new TypeError('Missing parameter "apiKey".');
  }
 
  const httpClient = createHttpClient(options);
 
  return createMollieApi({ httpClient });
}