FIXES: palindrome abc -> abccba (#831)

* FIXES: palindrome abc -> abccba

* FIXES: tests for palindrome

---------

Co-authored-by: Bernhard Wagner <gitcommit@nosuch.biz>
This commit is contained in:
Bernhard Wagner 2023-12-05 11:15:13 +01:00 committed by GitHub
parent b374cdf47c
commit 1bca05e349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 27 deletions

View file

@ -1985,7 +1985,7 @@ Pattern.prototype.hush = function () {
* note("c d e g").palindrome()
*/
export const palindrome = register('palindrome', function (pat) {
return pat.every(2, rev);
return pat.lastOf(2, rev);
});
/**