選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

23 行
463 B

  1. let utils = require('./utils')
  2. class OldValue {
  3. constructor(unprefixed, prefixed, string, regexp) {
  4. this.unprefixed = unprefixed
  5. this.prefixed = prefixed
  6. this.string = string || prefixed
  7. this.regexp = regexp || utils.regexp(prefixed)
  8. }
  9. /**
  10. * Check, that value contain old value
  11. */
  12. check(value) {
  13. if (value.includes(this.string)) {
  14. return !!value.match(this.regexp)
  15. }
  16. return false
  17. }
  18. }
  19. module.exports = OldValue