Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function caniuse() {
const feature = getSelectedText();
if (feature === '') { return ''; }
let result = {};
try {
result = api.getSupport(feature);
} catch (e) {
const suggestions = utils.provideMatches(feature);
if (suggestions.length === 0) {
vscode.window.showErrorMessage('Cannot find property in local database, you can still search through status bar.');
} else {
// returns promise based string
return utils.pickSuggestions(suggestions);
}
}
const showAll = vscode.workspace.getConfiguration('caniuse').show_all;
// returns actual string
return utils.statusBuilder(result, !showAll);
}
module.exports = function (options) {
options = Object.assign({}, DEFAULTS_OPTIONS, options);
var browsers = browserslist(options.browsers);
var isFallbackNeeded = !caniuse.isSupported("css-grid", browsers);
var isIEHackNeeded = !caniuse.isSupported("css-supports-api", browsers);
if (options.hasOwnProperty("fallback")) {
isFallbackNeeded = options.fallback;
isIEHackNeeded = options.fallback;
}
return function (css, result) {
css.walkDecls('grid-kiss', function (decl) {
var input = parse(decl, options);
var grid = { props: new Map(), rule: decl.parent };
var zones = [];
var indent = decl.raws.before.match(/.*$/)[0];
var nameMapping = new Map();
export function isEs5SupportNeeded(projectRoot: string): boolean {
const browsersList: string[] = browserslist(
undefined, {
path: projectRoot,
});
return !caniuse.isSupported('es6-module', browsersList.join(', '));
}
if (!conditions.length || conditions.find(function (condition) {
return !isSupported(condition, options.browsers);
})) {
processor.use(require(feature)(
function chooseTerserEcmaVersion( browsers ) {
if ( ! caniuse.isSupported( 'arrow-functions', browsers ) ) {
return 5;
}
if ( ! caniuse.isSupported( 'es6-class', browsers ) ) {
return 5;
}
return 6;
}
module.exports = function (options) {
options = Object.assign({}, DEFAULTS_OPTIONS, options);
var browsers = browserslist(options.browsers);
var isFallbackNeeded = !caniuse.isSupported("css-grid", browsers);
var isIEHackNeeded = !caniuse.isSupported("css-supports-api", browsers);
if (options.hasOwnProperty("fallback")) {
isFallbackNeeded = options.fallback;
isIEHackNeeded = options.fallback;
}
return function (css, result) {
css.walkDecls('grid-kiss', function (decl) {
var input = parse(decl, options);
var grid = { props: new Map(), rule: decl.parent };
var zones = [];
var indent = decl.raws.before.match(/.*$/)[0];
var nameMapping = new Map();
grid.props.set("display", "grid");
return moduleFeatures.every(ft => caniuse.isSupported(ft, browserTarget));
}
/**
* The following transforms are prepended in reverse order to ensure that
* they come _before_ possible custom html head elements
*/
if (app.env === 'development') {
d.transform(prependToHead, `
`)
} else {
const script = app.context.assets.get('bundle.js')
const styles = app.context.assets.get('bundle.css')
const features = process.env.POLYFILL_FEATURES
if (!caniuse.isSupported('link-rel-preload', app.browsers.join(','))) {
d.transform(prependToHead, `