UNPKG

scancss

Version:

A robust CSS stylesheet statistics collector and analyzer

25 lines (19 loc) 877 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleVendorPrefix = handleVendorPrefix; var _reExistingVendorPrefix = require('../../constants/reExistingVendorPrefix'); var _rePrefixedString = require('../../constants/rePrefixedString'); var _countUsage = require('../../calculators/countUsage'); function handleVendorPrefix(str, report) { report.vendorPrefixes.total++; if (_reExistingVendorPrefix.reExistingVendorPrefix.test(str)) { const prefix = str.match(_reExistingVendorPrefix.reExistingVendorPrefix)[0]; (0, _countUsage.countUsage)(prefix, report.vendorPrefixes.usage); } else if (_rePrefixedString.rePrefixedString.test(str)) { const prefix = str.match(_rePrefixedString.rePrefixedString)[0]; report.vendorPrefixes.unknown.total++; (0, _countUsage.countUsage)(prefix, report.vendorPrefixes.unknown.usage); } }