CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
old-value.js23 linesDownload Raw Back to lib
1let utils = require('./utils')2 3class OldValue {4  constructor(unprefixed, prefixed, string, regexp) {5    this.unprefixed = unprefixed6    this.prefixed = prefixed7    this.string = string || prefixed8    this.regexp = regexp || utils.regexp(prefixed)9  }10 11  /**12   * Check, that value contain old value13   */14  check(value) {15    if (value.includes(this.string)) {16      return !!value.match(this.regexp)17    }18    return false19  }20}21 22module.exports = OldValue23