index.js 168 B

12345678910
  1. 'use strict';
  2. module.exports = function (str) {
  3. var tail = str.length;
  4. while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) {
  5. tail--;
  6. }
  7. return str.slice(0, tail);
  8. };