frontend/.pnpm-store/v3/files/92/c91ff0ea20df3c4f64b010de86370b76e4258971a759dbfd5ea5672b05d17f32f14bc07970fa15c1cb9674efe5e95a3340c8a91951d10e8db344ee93b3a429

23 lines
465 B
Plaintext

let utils = require('./utils')
class OldValue {
constructor (unprefixed, prefixed, string, regexp) {
this.unprefixed = unprefixed
this.prefixed = prefixed
this.string = string || prefixed
this.regexp = regexp || utils.regexp(prefixed)
}
/**
* Check, that value contain old value
*/
check (value) {
if (value.includes(this.string)) {
return !!value.match(this.regexp)
}
return false
}
}
module.exports = OldValue