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);
}
supportCall() {
return caniuse.getSupport(this.name);
}
export default function generateDynamicPrefixMap(browserList: Object): Object {
const prefixMap = {}
for (let i = 0, len = browsers.length; i < len; ++i) {
const browser = browsers[i]
if (!prefixMap.hasOwnProperty(browser)) {
prefixMap[browser] = {}
}
for (const keyword in propertyMap) {
const keywordProperties = [].concat(propertyMap[keyword])
const versions = getSupport(keyword)
for (let j = 0, kLen = keywordProperties.length; j < kLen; ++j) {
if (versions[browser].x >= browserList[browser]) {
prefixMap[browser][keywordProperties[j]] = versions[browser].x
}
}
}
}
prefixMap.ie = {
...prefixMap.ie,
...prefixMap.ie_mob,
}
delete prefixMap.ie_mob
function gatherInformation() {
let prefixProperties = {
ie: {},
firefox: {},
safari: {},
chrome: {},
opera : {}
};
let search;
for (search in searchMap) {
let properties = searchMap[search];
let versions = caniuse.getSupport(search, true);
if (properties instanceof Array !== true) {
properties = [properties];
}
properties.forEach(prop => {
let prefix;
for (prefix in prefixProperties) {
prefixProperties[prefix][prop] = versions[prefix].x
}
});
}
return 'var prefixes = ' + JSON.stringify(prefixProperties) + '; module.exports = prefixes';
}
function gatherInformation() {
const prefixProperties = { }
browsers.forEach(function(browser) {
prefixProperties[browser] = { }
})
for (const search in searchMap) {
let properties = searchMap[search]
const versions = caniuse.getSupport(search, true)
if (properties instanceof Array !== true) {
properties = [ properties ]
}
properties.forEach(function(prop) {
for (const prefix in prefixProperties) {
if (versions[prefix].x >= config[prefix]) {
prefixProperties[prefix][prop] = versions[prefix].x
}
}
})
}
prefixProperties.ie = assign({ }, prefixProperties.ie, prefixProperties.ie_mob)
delete prefixProperties.ie_mob
flexPropsIE.forEach(function(prop) {
delete prefixProperties.ie[prop]
preciseQuery(input){
let response = CanIUse.getSupport(input);
let FormattedResult = this.FormatResults(response);
return {
title: input,
subtitle: FormattedResult,
arg: input
}
}
.then(pickedItem => {
try {
result = api.getSupport(pickedItem);
} catch (e) {
return reject(e.message);
}
const showAll = vscode.workspace.getConfiguration('caniuse').show_all;
const stringToRet = statusBuilder(result, !showAll);
resolve(stringToRet);
});
});