UNPKG

@juzi/wechaty

Version:

Wechaty is a RPA SDK for Chatbot Makers.

12 lines 599 B
import { ContactImpl, MessageImpl, } from '../user-modules/mod.js'; const sayOptionKeys = [ 'mentionList', 'quoteMessage', ]; export const isSayOptionsObject = (target) => { return (typeof target === 'object' && Object.keys(target).every(item => sayOptionKeys.includes(item)) && (typeof target.mentionList === 'undefined' || (Array.isArray(target.mentionList) && target.mentionList.every((c) => ContactImpl.valid(c) || c === '@all'))) && (typeof target.quoteMessage === 'undefined' || MessageImpl.valid(target.quoteMessage))); }; //# sourceMappingURL=types.js.map