Sha256: 6c62eb14bb8653e3a80fb0aea9d38462f68b0711346a3fd92eee7e9edff069fe

Contents?: true

Size: 1.41 KB

Versions: 69

Compression:

Stored size: 1.41 KB

Contents

'use strict'

const browsers = require('./browsers').browsers
const versions = require('./browserVersions').browserVersions
const agentsData = require('../../data/agents')

function unpackBrowserVersions(versionsData) {
  return Object.keys(versionsData).reduce((usage, version) => {
    usage[versions[version]] = versionsData[version]
    return usage
  }, {})
}

module.exports.agents = Object.keys(agentsData).reduce((map, key) => {
  let versionsData = agentsData[key]
  map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => {
    if (entry === 'A') {
      data.usage_global = unpackBrowserVersions(versionsData[entry])
    } else if (entry === 'C') {
      data.versions = versionsData[entry].reduce((list, version) => {
        if (version === '') {
          list.push(null)
        } else {
          list.push(versions[version])
        }
        return list
      }, [])
    } else if (entry === 'D') {
      data.prefix_exceptions = unpackBrowserVersions(versionsData[entry])
    } else if (entry === 'E') {
      data.browser = versionsData[entry]
    } else if (entry === 'F') {
      data.release_date = Object.keys(versionsData[entry]).reduce(
        (map2, key2) => {
          map2[versions[key2]] = versionsData[entry][key2]
          return map2
        },
        {}
      )
    } else {
      // entry is B
      data.prefix = versionsData[entry]
    }
    return data
  }, {})
  return map
}, {})

Version data entries

69 entries across 23 versions & 4 rubygems

Version Path
trusty-cms-6.3.1 node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/jscodeshift/node_modules/@babel/core/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/core-js-compat/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-object-rest-spread/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.51 node_modules/@babel/helper-define-polyfill-provider/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/@babel/plugin-transform-object-rest-spread/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/jscodeshift/node_modules/@babel/core/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/@babel/helper-define-polyfill-provider/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.50 node_modules/core-js-compat/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.49 node_modules/@babel/plugin-transform-object-rest-spread/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.49 node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.49 node_modules/core-js-compat/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.49 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js
immosquare-cleaner-0.1.49 node_modules/jscodeshift/node_modules/@babel/core/node_modules/@babel/helper-compilation-targets/node_modules/browserslist/node_modules/caniuse-lite/dist/unpacker/agents.js