mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-07 08:40:29 +03:00
18 lines
466 B
JavaScript
18 lines
466 B
JavaScript
'use strict';
|
|
|
|
const {clients} = require('../config');
|
|
|
|
module.exports.findById = (id, done) => {
|
|
for (const client of clients) {
|
|
if (client.id === id) return done(null, client);
|
|
}
|
|
return done(new Error('Client Not Found'));
|
|
};
|
|
|
|
module.exports.findByClientId = (clientId, done) => {
|
|
for (const client of clients) {
|
|
if (client.clientId === clientId) return done(null, client);
|
|
}
|
|
return done(new Error('Client Not Found'));
|
|
};
|