Files
codeql-action/node_modules/github-linguist/src/utils.ts
Andrew Eisenberg b29bf7b05a Upgrade linguist dependency
This version changes how it counts python heredoc. All heredoc is
counted as code.
2021-08-25 11:15:45 -07:00

25 lines
541 B
TypeScript

import fs from 'fs';
import path from 'path';
import slash from 'slash2';
const packagePath = slash(path.join(__dirname, '../', 'package.json'));
/**
* Get package version.
*
* @export getVersion
* @returns {string}
*/
export function getVersion(): string {
const packageInfo = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
return (packageInfo && packageInfo.version) || 'invalid version!';
}
export const ExtensionJustify = {
'.ts': 'typescript',
'.jsx': 'javascript',
'.js': 'javascript',
'.tsx': 'typescript',
};