Files
codeql-action/node_modules/github-linguist/dist/utils.js
Andrew Eisenberg c4a84a93d4 Add the github-linguist package
This commit only adds a single package and all of its transitive
dependencies. The github-linguist package will be used for counting
lines of code as a baseline for databases we are analyzing.
2021-04-22 15:59:49 -07:00

29 lines
985 B
JavaScript

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExtensionJustify = exports.getVersion = void 0;
const fs_1 = __importDefault(require("fs"));
const path_1 = __importDefault(require("path"));
// @ts-ignore
const slash2_1 = __importDefault(require("slash2"));
const packagePath = slash2_1.default(path_1.default.join(__dirname, '../', 'package.json'));
/**
* Get package version.
*
* @export getVersion
* @returns {string}
*/
function getVersion() {
const packageInfo = JSON.parse(fs_1.default.readFileSync(packagePath, 'utf8'));
return (packageInfo && packageInfo.version) || 'invalid version!';
}
exports.getVersion = getVersion;
exports.ExtensionJustify = {
'.ts': 'typescript',
'.jsx': 'javascript',
'.js': 'javascript',
'.tsx': 'typescript',
};
//# sourceMappingURL=utils.js.map