"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getRealmOptions = getRealmOptions;
exports.getSerializerOptions = getSerializerOptions;
exports.getDebuggerOptions = getDebuggerOptions;

var _realm = require("./realm.js");

var _invariant = require("./invariant.js");

var _invariant2 = _interopRequireDefault(_invariant);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Copyright (c) 2017-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

function getRealmOptions({
  compatibility = "browser",
  debugNames = false,
  errorHandler,
  mathRandomSeed,
  omitInvariants = false,
  emitConcreteModel = false,
  uniqueSuffix,
  reactEnabled,
  reactOutput,
  reactVerbose,
  residual,
  serialize = !residual,
  check,
  strictlyMonotonicDateNow,
  stripFlow,
  timeout,
  maxStackDepth,
  abstractValueImpliesMax
}) {
  return {
    compatibility,
    debugNames,
    errorHandler,
    mathRandomSeed,
    omitInvariants,
    emitConcreteModel,
    uniqueSuffix,
    reactEnabled,
    reactOutput,
    reactVerbose,
    residual,
    serialize,
    check,
    strictlyMonotonicDateNow,
    stripFlow,
    timeout,
    maxStackDepth,
    abstractValueImpliesMax
  };
}

function getSerializerOptions({
  lazyObjectsRuntime,
  heapGraphFormat,
  delayInitializations = false,
  delayUnsupportedRequires = false,
  accelerateUnsupportedRequires = true,
  internalDebug = false,
  debugScopes = false,
  debugIdentifiers,
  logStatistics = false,
  logModules = false,
  profile = false,
  inlineExpressions = false,
  simpleClosures = false,
  initializeMoreModules = false,
  trace = false
}) {
  let result = {
    delayInitializations,
    delayUnsupportedRequires,
    accelerateUnsupportedRequires,
    initializeMoreModules,
    internalDebug,
    debugScopes,
    debugIdentifiers,
    logStatistics,
    logModules,
    profile,
    inlineExpressions,
    simpleClosures,
    trace
  };
  if (lazyObjectsRuntime !== undefined) {
    result.lazyObjectsRuntime = lazyObjectsRuntime;
  }
  if (heapGraphFormat !== undefined) {
    result.heapGraphFormat = heapGraphFormat;
  }
  return result;
}

function getDebuggerOptions({ debugInFilePath, debugOutFilePath }) {
  (0, _invariant2.default)(debugInFilePath !== undefined, "Debugger invoked without input file path");
  (0, _invariant2.default)(debugOutFilePath !== undefined, "Debugger invoked without output file path");
  let result = {
    inFilePath: debugInFilePath,
    outFilePath: debugOutFilePath
  };
  return result;
}
//# sourceMappingURL=prepack-options.js.map