node-red-contrib-chatbot
Version:
REDBot a Chat bot for a full featured chat bot for Telegram, Facebook Messenger and Slack. Almost no coding skills required
14 lines (12 loc) • 312 B
JavaScript
/**
* hasField
* @param {object} obj - Hash of flags
*/
const hasField = function(obj) {
if (obj == null) {
return true;
}
const fields = Array.from(arguments).slice(1); // all except first
return fields.some(field => obj[field] === undefined || obj[field] === true);
};
export default hasField;