mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 09:12:03 +00:00
14 lines
299 B
TypeScript
14 lines
299 B
TypeScript
import sdk from '@scrypted/sdk';
|
|
|
|
export function safeParseJson(value: string) {
|
|
try {
|
|
return JSON.parse(value);
|
|
}
|
|
catch (e) {
|
|
}
|
|
}
|
|
|
|
export function getAllDevices() {
|
|
return Object.keys(sdk.systemManager.getSystemState()).map(id => sdk.systemManager.getDeviceById(id));
|
|
}
|