How to use the caniuse-lite/dist/unpacker/feature.default function in caniuse-lite

To help you get started, we’ve selected a few caniuse-lite 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 alan-ai / alan-sdk-reactnative / testtools / node_modules / browserslist / node.js View on Github external
loadFeature: function loadFeature (features, name) {
    name = name.replace(/[^\w-]/g, '')
    if (features[name]) return

    // eslint-disable-next-line security/detect-non-literal-require
    var compressed = require('caniuse-lite/data/features/' + name + '.js')
    var stats = feature(compressed).stats
    features[name] = { }
    for (var i in stats) {
      for (var j in stats[i]) {
        features[name][i + ' ' + j] = stats[i][j]
      }
    }
  },
github abhaynikam / boring_generators / tmp / templates / app_template / node_modules / browserslist / node.js View on Github external
loadFeature: function loadFeature (features, name) {
    name = name.replace(/[^\w-]/g, '')
    if (features[name]) return

    // eslint-disable-next-line security/detect-non-literal-require
    var compressed = require('caniuse-lite/data/features/' + name + '.js')
    var stats = feature(compressed).stats
    features[name] = { }
    for (var i in stats) {
      for (var j in stats[i]) {
        features[name][i + ' ' + j] = stats[i][j]
      }
    }
  },

caniuse-lite

A smaller version of caniuse-db, with only the essentials!

CC-BY-4.0
Latest version published 1 day ago

Package Health Score

89 / 100
Full package analysis