3 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5 var utils = require('./utils');
7 var OldValue = function () {
8 function OldValue(unprefixed, prefixed, string, regexp) {
9 _classCallCheck(this, OldValue);
11 this.unprefixed = unprefixed;
12 this.prefixed = prefixed;
13 this.string = string || prefixed;
14 this.regexp = regexp || utils.regexp(prefixed);
18 * Check, that value contain old value
22 OldValue.prototype.check = function check(value) {
23 if (value.indexOf(this.string) !== -1) {
24 return !!value.match(this.regexp);
32 module.exports = OldValue;