Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const check = (attr) => {
if (note[attr]) {
if (typeof note[attr] === 'string') {
assert(devices.find((d) => d.model === note[attr]), note[attr]);
} else {
for (const m of note[attr]) {
assert(devices.find((d) => d.model === m), m);
}
}
}
};