You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 regels
441 B

  1. /*!
  2. * is-extglob <https://github.com/jonschlinkert/is-extglob>
  3. *
  4. * Copyright (c) 2014-2016, Jon Schlinkert.
  5. * Licensed under the MIT License.
  6. */
  7. module.exports = function isExtglob(str) {
  8. if (typeof str !== 'string' || str === '') {
  9. return false;
  10. }
  11. var match;
  12. while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
  13. if (match[2]) return true;
  14. str = str.slice(match.index + match[0].length);
  15. }
  16. return false;
  17. };