text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  var fs = require("fs");
  /**
   * @param  packageJsonPath Path to package.json
   * @param  loadPackageJson Function that reads and parses package.json.
   * @param  fileExists Function that checks for existance of a file.
   * @returns string
   */
  function readPackage(packageJsonPath, 
      // tslint:disable-next-line:no-any
      loadPackageJson, fileExists) {
      // tslint:disable-next-line:no-any
      if (loadPackageJson === void 0) { loadPackageJson = loadJsonFromDisk; }
      if (fileExists === void 0) { fileExists = fs.existsSync; }
      return ((packageJsonPath.match(/package\.json$/) &&
          fileExists(packageJsonPath) &&
          loadPackageJson(packageJsonPath)) ||
          undefined);
  }
  exports.readPackage = readPackage;
  function loadJsonFromDisk(file) {
      var packageJson = require(file);
      return packageJson;
  }
  