1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/packages/utils/object.ts

8 lines
267 B
TypeScript
Raw Normal View History

/* eslint-disable import/prefer-default-export */
export function checkObjectHasProperties(object: any, properties: string[]) {
for (const prop of properties) {
if (!(prop in object)) throw new Error(`Missing property "${prop}": ${JSON.stringify(object)}`);
}
}