UNPKG

613 BJavaScriptView Raw
1"use strict";
2
3var utils = require('./utils');
4
5var OldValue =
6/*#__PURE__*/
7function () {
8 function OldValue(unprefixed, prefixed, string, regexp) {
9 this.unprefixed = unprefixed;
10 this.prefixed = prefixed;
11 this.string = string || prefixed;
12 this.regexp = regexp || utils.regexp(prefixed);
13 }
14 /**
15 * Check, that value contain old value
16 */
17
18
19 var _proto = OldValue.prototype;
20
21 _proto.check = function check(value) {
22 if (value.indexOf(this.string) !== -1) {
23 return !!value.match(this.regexp);
24 }
25
26 return false;
27 };
28
29 return OldValue;
30}();
31
32module.exports = OldValue;
\No newline at end of file