Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var result = shorthandParser.apply(this, arguments);
return result === '' ? {} : result;
};
// Current versions of the cssstyle parseInteger function can't actually
// handle string inputs.
var badInt = cssPropertyParsers.parseInteger('5');
if (badInt !== '5') {
cssPropertyParsers.parseInteger = function parseInteger(val) {
return String(parseInt(val, 10));
};
}
// Current versions of the cssstyle parseNumber function can't actually
// handle string inputs.
var badNum = cssPropertyParsers.parseNumber('0.5');
if (badNum !== '0.5') {
cssPropertyParsers.parseNumber = function parseNumber(val) {
return String(parseFloat(val, 10));
};
}
}
// We can't require jsdom/lib/jsdom/browser/utils directly, because it
// requires jsdom, which requires utils circularly, so the utils module
// won't be fully populated when its (non-existent) NOT_IMPLEMENTED
// property is imported elsewhere. Instead, the only thing that seems to
// work is to override the utils module in require.cache, so that we never
// have to evaluate the original module.
try {
var utilsId = require.resolve('jsdom/lib/jsdom/browser/utils');
} catch (err) {