- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
24 lines
512 B
JavaScript
24 lines
512 B
JavaScript
var startsAsUrl = require('./starts-as-url');
|
|
|
|
var OptimizationLevel = require('../../../options/optimization-level').OptimizationLevel;
|
|
|
|
var URL_PREFIX_PATTERN = /^url\(/i;
|
|
|
|
var plugin = {
|
|
level1: {
|
|
value: function urlPrefix(_name, value, options) {
|
|
if (!options.level[OptimizationLevel.One].normalizeUrls) {
|
|
return value;
|
|
}
|
|
|
|
if (!startsAsUrl(value)) {
|
|
return value;
|
|
}
|
|
|
|
return value.replace(URL_PREFIX_PATTERN, 'url(');
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = plugin;
|