// hasDescription.js
(function () {
/* global adventurejs A */
var p = adventurejs.Asset.prototype;
/**
* See if asset has a description for an identifier,
* such as "look in book", where
* "in" has been defined as a key at
* asset.descriptions.in.
* "look" is always the default identifier.
* @memberOf adventurejs.Asset
* @method adventurejs.Asset#hasDescription
* @param {String} identifier
* @return {String|Boolean}
*/
p.hasDescription = function Asset_hasDescription(identifier) {
identifier = identifier || "look";
let description = this.descriptions[identifier];
if (
("string" === typeof description && description.length) ||
"function" === typeof description ||
Array.isArray(description)
) {
return true;
}
return false;
};
})();