How to use the caniuse-api.setBrowserScope function in caniuse-api

To help you get started, we’ve selected a few caniuse-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github agauniyal / vscode-caniuse / src / method.js View on Github external
vscode.window.showInputBox().then(userInput => {
    if (userInput === undefined) {
      return;
    } else if (userInput === 'CONFIG') {
      browserScope = vscode.workspace.getConfiguration('caniuse').browser_scope;
      userInput = (browserScope !== null) ? browserScope : '> 5%, last 2 versions';
    }
    try {
      api.setBrowserScope(userInput);
    } catch (e) {
      vscode.window.showErrorMessage(e.message);
      return;
    }
    vscode.window.setStatusBarMessage(`BrowserScope updated $(check)`, 3000);
  });
}

caniuse-api

request the caniuse data to check browsers compatibilities

MIT
Latest version published 6 years ago

Package Health Score

70 / 100
Full package analysis