"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPackageJson = void 0;
exports.getPackageVersion = getPackageVersion;
exports.getPackageName = getPackageName;
const fs_1 = require("fs");
const lodash_1 = require("lodash");
const path_1 = require("path");
const process_1 = require("process");
exports.getPackageJson = (0, lodash_1.memoize)(() => {
    try {
        const pkgJsonStr = (0, fs_1.readFileSync)((0, path_1.join)((0, process_1.cwd)(), 'package.json'), 'utf8');
        const pkgJson = JSON.parse(pkgJsonStr);
        return pkgJson;
        // eslint-disable-next-line unused-imports/no-unused-vars
    }
    catch (err) {
        return undefined;
    }
});
function getPackageVersion() {
    const pkgJson = (0, exports.getPackageJson)();
    return pkgJson?.version;
}
getPackageVersion.__type = ['getPackageVersion', 'P"/!'];
function getPackageName() {
    const pkgJson = (0, exports.getPackageJson)();
    return pkgJson?.name;
}
getPackageName.__type = ['getPackageName', 'P"/!'];
//# sourceMappingURL=package.js.map