b831c9d119fce9b72f0fcf95b9da704454f0753b1530f6c291358a6f6db48d4defe645536eb13b2ca7923afd13101ca5190281b1b497fd156762b61aecba12 437 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const isCSSLengthUnit = require('./isCSSLengthUnit');
  3. const unit = require('../util/unit');
  4. function isStop(str) {
  5. let stop = !str;
  6. if (!stop) {
  7. const node = unit(str);
  8. if (node) {
  9. if (node.number === 0 || (!isNaN(node.number) && isCSSLengthUnit(node.unit))) {
  10. stop = true;
  11. }
  12. } else {
  13. stop = (/^calc\(\S+\)$/g).test(str);
  14. }
  15. }
  16. return stop;
  17. }
  18. module.exports = isStop;