Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// getPreposition.js

(function () {
  /* global adventurejs A */

  var p = adventurejs.Dictionary.prototype;

  /**
   * Determine whether string is recognized as a preposition
   * and return the string.
   * @memberOf adventurejs.Dictionary
   * @method adventurejs.Dictionary#getPreposition
   * @kind function
   * @param {String} word
   * @returns {String|Boolean}
   */
  p.getPreposition = function Dictionary_getPreposition(word) {
    if (this.prepositions.includes(word)) return word;
    else return false;
  };
})();