// obfuscate.js
/* global adventurejs A */
/**
* Obfuscate a string. Used to make saved game files
* non human readable via a simple character shift.
* @method adventurejs#obfuscate
* @memberOf adventurejs
* @param {String} text
* @returns {String}
*/
adventurejs.obfuscate = function Adventurejs_obfuscate(text) {
if (!text) return "";
return Array.from(text)
.map((c) => String.fromCharCode(c.charCodeAt(0) + 3))
.join("");
};