mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 02:35:23 -04:00
Utils: Fix getServerVersionFromPackageJson
The cache is never null, because it defaults to undefined, and therefore this function always returns undefined. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
caa4b1c927
commit
dff5a635e0
2 changed files with 28 additions and 1 deletions
|
@ -11,7 +11,7 @@ import { join as joinPath } from 'path';
|
|||
let versionCache: ServerVersion;
|
||||
|
||||
export async function getServerVersionFromPackageJson(): Promise<ServerVersion> {
|
||||
if (versionCache === null) {
|
||||
if (versionCache === undefined) {
|
||||
const rawFileContent: string = await fs.readFile(
|
||||
joinPath(__dirname, '../../package.json'),
|
||||
{ encoding: 'utf8' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue