parent
a84332cba6
commit
baeeb549d4
@ -0,0 +1,6 @@
|
||||
var makeString = require('./makeString');
|
||||
|
||||
module.exports = function adjacent(str, direction) {
|
||||
str = makeString(str);
|
||||
return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + direction);
|
||||
};
|
@ -0,0 +1,5 @@
|
||||
var adjacent = require('./helper/adjacent');
|
||||
|
||||
module.exports = function succ(str) {
|
||||
return adjacent(str, -1);
|
||||
};
|
@ -1,6 +1,5 @@
|
||||
var makeString = require('./helper/makeString');
|
||||
var adjacent = require('./helper/adjacent');
|
||||
|
||||
module.exports = function succ(str) {
|
||||
str = makeString(str);
|
||||
return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + 1);
|
||||
return adjacent(str, 1);
|
||||
};
|
||||
|
Loading…
Reference in new issue