|
Last change
on this file since 505f39a was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Working / before login
|
-
Property mode
set to
100644
|
|
File size:
463 bytes
|
| Line | |
|---|
| 1 | let utils = require('./utils')
|
|---|
| 2 |
|
|---|
| 3 | class OldValue {
|
|---|
| 4 | constructor(unprefixed, prefixed, string, regexp) {
|
|---|
| 5 | this.unprefixed = unprefixed
|
|---|
| 6 | this.prefixed = prefixed
|
|---|
| 7 | this.string = string || prefixed
|
|---|
| 8 | this.regexp = regexp || utils.regexp(prefixed)
|
|---|
| 9 | }
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Check, that value contain old value
|
|---|
| 13 | */
|
|---|
| 14 | check(value) {
|
|---|
| 15 | if (value.includes(this.string)) {
|
|---|
| 16 | return !!value.match(this.regexp)
|
|---|
| 17 | }
|
|---|
| 18 | return false
|
|---|
| 19 | }
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | module.exports = OldValue
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.