Files
zigbee2mqtt/lib/util/data.ts
T
Nerivec 48d77e4b5e fix: Enforce TS strict type checking (#23601)
* Enforce TS `strict` type checking.

* updates

* updates

* updates

* Updates

* Updates

* pretty

* u

* u

* u

* Updates

* updates

* Updates

* Updates

* `ReadonlyArray`

* scenesChanged

* objectID

* Improve coverage

* u

* u

* process feedback

---------

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
2024-09-07 11:40:50 +00:00

22 lines
464 B
TypeScript

import path from 'path';
function setPath(): string {
return process.env.ZIGBEE2MQTT_DATA ? process.env.ZIGBEE2MQTT_DATA : path.normalize(path.join(__dirname, '..', '..', 'data'));
}
let dataPath = setPath();
function joinPath(file: string): string {
return path.resolve(dataPath, file);
}
function getPath(): string {
return dataPath;
}
function _testReload(): void {
dataPath = setPath();
}
export default {joinPath, getPath, _testReload};