// getVerb.js
(function () {
/* global AdventureJS A */
var p = AdventureJS.Dictionary.prototype;
/**
* A method to get a dictionary verb object from a verb name string.
* @memberOf AdventureJS.Dictionary
* @method AdventureJS.Dictionary#getVerb
* @param {String} verb
* @returns {object}
* @TODO this needs more robust case handling due to
* camelCase verbs like getOn.
*/
p.getVerb = function (verb) {
if ("string" !== typeof verb) return false;
const direction = this.getDirection(verb);
return (
this.verbs[verb] ||
this.verbs[verb.toLowerCase()] ||
this.verbs[this.getDirection(verb)] ||
null
);
};
})();