wishthis/node_modules/autoprefixer/lib/old-value.js

23 lines
463 B
JavaScript
Raw Normal View History

2023-08-17 09:47:40 +00:00
let utils = require('./utils')
class OldValue {
constructor(unprefixed, prefixed, string, regexp) {
this.unprefixed = unprefixed
this.prefixed = prefixed
this.string = string || prefixed
this.regexp = regexp || utils.regexp(prefixed)
2022-01-21 08:28:41 +00:00
}
2023-08-17 09:47:40 +00:00
/**
* Check, that value contain old value
*/
check(value) {
2022-01-21 08:28:41 +00:00
if (value.includes(this.string)) {
2023-08-17 09:47:40 +00:00
return !!value.match(this.regexp)
2022-01-21 08:28:41 +00:00
}
2023-08-17 09:47:40 +00:00
return false
}
}
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
module.exports = OldValue