Remove duplicated getLast (#5889)

master
fisker Cheung 2019-02-21 23:03:35 +08:00 committed by Lucas Duailibe
parent ed1db90c68
commit 9352331f1a
1 changed files with 1 additions and 7 deletions

View File

@ -2,6 +2,7 @@
const stringWidth = require("string-width");
const escapeStringRegexp = require("escape-string-regexp");
const getLast = require("../utils/get-last");
// eslint-disable-next-line no-control-regex
const notAsciiRegex = /[^\x20-\x7F]/;
@ -37,13 +38,6 @@ function getPenultimate(arr) {
return null;
}
function getLast(arr) {
if (arr.length > 0) {
return arr[arr.length - 1];
}
return null;
}
function skip(chars) {
return (text, index, opts) => {
const backwards = opts && opts.backwards;