您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

30 行
606 B

  1. "use strict";
  2. var utils = require('./utils');
  3. var OldValue = /*#__PURE__*/function () {
  4. function OldValue(unprefixed, prefixed, string, regexp) {
  5. this.unprefixed = unprefixed;
  6. this.prefixed = prefixed;
  7. this.string = string || prefixed;
  8. this.regexp = regexp || utils.regexp(prefixed);
  9. }
  10. /**
  11. * Check, that value contain old value
  12. */
  13. var _proto = OldValue.prototype;
  14. _proto.check = function check(value) {
  15. if (value.includes(this.string)) {
  16. return !!value.match(this.regexp);
  17. }
  18. return false;
  19. };
  20. return OldValue;
  21. }();
  22. module.exports = OldValue;