Remove duplicated getLast (#5889)
parent
ed1db90c68
commit
9352331f1a
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const stringWidth = require("string-width");
|
const stringWidth = require("string-width");
|
||||||
const escapeStringRegexp = require("escape-string-regexp");
|
const escapeStringRegexp = require("escape-string-regexp");
|
||||||
|
const getLast = require("../utils/get-last");
|
||||||
|
|
||||||
// eslint-disable-next-line no-control-regex
|
// eslint-disable-next-line no-control-regex
|
||||||
const notAsciiRegex = /[^\x20-\x7F]/;
|
const notAsciiRegex = /[^\x20-\x7F]/;
|
||||||
|
@ -37,13 +38,6 @@ function getPenultimate(arr) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLast(arr) {
|
|
||||||
if (arr.length > 0) {
|
|
||||||
return arr[arr.length - 1];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function skip(chars) {
|
function skip(chars) {
|
||||||
return (text, index, opts) => {
|
return (text, index, opts) => {
|
||||||
const backwards = opts && opts.backwards;
|
const backwards = opts && opts.backwards;
|
||||||
|
|
Loading…
Reference in New Issue