Comparing version 0.0.4 to 0.0.5
@@ -48,8 +48,17 @@ var Detector, featureData, missingSupport, _; | ||
return detector.process(css, function(_arg1) { | ||
var feature, usage; | ||
var browser, feature, loc, message, usage, versions, _i, _len; | ||
feature = _arg1.feature, usage = _arg1.usage; | ||
versions = features[feature].missing; | ||
browsers = []; | ||
for (_i = 0, _len = versions.length; _i < _len; _i++) { | ||
browser = versions[_i]; | ||
browsers.push(browser + ' (' + _.keys(versions[browser]).join(',') + ')'); | ||
} | ||
loc = usage.source; | ||
message = loc.id + ' line ' + loc.start.line + " : " + feature + ' not supported by ' + browsers.join(','); | ||
return cb({ | ||
feature: feature, | ||
featureData: features[feature], | ||
usage: usage | ||
usage: usage, | ||
message: message | ||
}); | ||
@@ -56,0 +65,0 @@ }); |
{ | ||
"name": "doiuse", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Lint CSS for browser support against caniuse database.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -17,20 +17,3 @@ doiuse | ||
onUnsupportedFeatureUse: function(usageInfo) { | ||
// get human-readable list of browsers (from among those WE selected) that | ||
// don't support the given feature. | ||
var versions = usageInfo.featureData.missing; | ||
var browsers = []; | ||
for(browser in versions) { | ||
browsers.push( | ||
browser + ' (' + Object.keys(versions[browser]).join(',') + ')' | ||
); | ||
} | ||
// the location in the CSS file that triggered this callback | ||
var loc = usageInfo.usage.source; | ||
console.log( | ||
loc.id + ' line ' + loc.start.line + " : " + | ||
usageInfo.feature + ' not supported by ' + browsers.join(',') | ||
); | ||
console.log(usageInfo.message); | ||
} | ||
@@ -37,0 +20,0 @@ })).process("a { background-size: cover; }") |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48387
910
77