'use strict';

var path = require('path');
var fs = require('fs');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var path__default = /*#__PURE__*/_interopDefault(path);
var fs__default = /*#__PURE__*/_interopDefault(fs);

function readFile(filePath) {
  return new Promise((resolve, reject) => {
    fs__default.default.readFile(filePath, "utf8", (error, result) => {
      if (error) {
        reject(error);
      } else {
        resolve(result);
      }
    });
  });
}

// src/getDataPath.ts
async function getDataPath(directoryPath, fileName) {
  const filePath = path__default.default.join(directoryPath, fileName);
  const fileContent = await readFile(filePath);
  const data = JSON.parse(fileContent);
  return {
    path: filePath,
    data
  };
}

exports.getDataPath = getDataPath;
