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

old-value.js 607B

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