adjacent.js 262 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 var makeString = require('./makeString'); module.exports = function adjacent(str, direction) { str = makeString(str); if (str.length === 0) { return ''; } return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + direction); };