Blame view

node_modules/underscore.string/helper/adjacent.js 262 Bytes
f7563de62   Palak Handa   first commit
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);
  };