Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
606 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | var utils = require('./utils');
|
---|
| 4 |
|
---|
| 5 | var OldValue = /*#__PURE__*/function () {
|
---|
| 6 | function OldValue(unprefixed, prefixed, string, regexp) {
|
---|
| 7 | this.unprefixed = unprefixed;
|
---|
| 8 | this.prefixed = prefixed;
|
---|
| 9 | this.string = string || prefixed;
|
---|
| 10 | this.regexp = regexp || utils.regexp(prefixed);
|
---|
| 11 | }
|
---|
| 12 | /**
|
---|
| 13 | * Check, that value contain old value
|
---|
| 14 | */
|
---|
| 15 |
|
---|
| 16 |
|
---|
| 17 | var _proto = OldValue.prototype;
|
---|
| 18 |
|
---|
| 19 | _proto.check = function check(value) {
|
---|
| 20 | if (value.includes(this.string)) {
|
---|
| 21 | return !!value.match(this.regexp);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | return false;
|
---|
| 25 | };
|
---|
| 26 |
|
---|
| 27 | return OldValue;
|
---|
| 28 | }();
|
---|
| 29 |
|
---|
| 30 | module.exports = OldValue; |
---|
Note:
See
TracBrowser
for help on using the repository browser.