.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / autoprefixer / lib / old-value.js
1 'use strict';
2
3 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
5 var utils = require('./utils');
6
7 var OldValue = function () {
8     function OldValue(unprefixed, prefixed, string, regexp) {
9         _classCallCheck(this, OldValue);
10
11         this.unprefixed = unprefixed;
12         this.prefixed = prefixed;
13         this.string = string || prefixed;
14         this.regexp = regexp || utils.regexp(prefixed);
15     }
16
17     /**
18      * Check, that value contain old value
19      */
20
21
22     OldValue.prototype.check = function check(value) {
23         if (value.indexOf(this.string) !== -1) {
24             return !!value.match(this.regexp);
25         }
26         return false;
27     };
28
29     return OldValue;
30 }();
31
32 module.exports = OldValue;