Subclass of MessengerRegexpAPI that is used to translate messages of external messenger of Model to internal messenger of Model.
var ModelMsgAPI = _.createSubclass(MessengerRegexpAPI, 'ModelMsgAPI');
module.exports = ModelMsgAPI;
_.extendProto(ModelMsgAPI, {
translateToSourceMessage: translateToSourceMessage,
});
Option name | Type | Description |
---|---|---|
accessPath | String | relative access path to be translated |
return | RegExp,String |
ModelMsgAPI instance method
Translates subscription paths with "*"s to regex, leaving other strings untouched.
function translateToSourceMessage(accessPath) {
if (accessPath instanceof RegExp) return accessPath;
return pathUtils.createRegexPath(accessPath);
}