Remove duplicated getLast (#5889)
parent
ed1db90c68
commit
9352331f1a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue