vendor-prefixes.js 492 B

123456789101112131415161718192021222324
  1. var VENDOR_PREFIX_PATTERN = /(?:^|\W)(-\w+-)/g;
  2. function unique(value) {
  3. var prefixes = [];
  4. var match;
  5. // eslint-disable-next-line no-cond-assign
  6. while ((match = VENDOR_PREFIX_PATTERN.exec(value)) !== null) {
  7. if (prefixes.indexOf(match[0]) == -1) {
  8. prefixes.push(match[0]);
  9. }
  10. }
  11. return prefixes;
  12. }
  13. function same(value1, value2) {
  14. return unique(value1).sort().join(',') == unique(value2).sort().join(',');
  15. }
  16. module.exports = {
  17. unique: unique,
  18. same: same
  19. };