Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

polyfills-db

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polyfills-db - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

lib/agents.js

30

lib/feature.js
var agents = require('./agents')
module.exports = Feature

@@ -17,3 +19,3 @@

if (options.filter) this.filter = options.filter
else if (options.browsers) this.filter = buildFilter(options.browsers)
else if (options.browsers) this.filter = agents.compile(options.browsers)
}

@@ -36,26 +38,4 @@

// build a filter function from an object of browsers
// order matters!
var families = {
ie: /\bie\b/i,
ff: /\bfirefox\b/i,
chrome: /\bchrome\b/i,
ios: /\bmobile safari\b/i, // needs to be before safari
safari: /\bsafari\b/i,
android: /\bandroid\b/i,
opera: /\bopera\b/i,
ffm: /\bfirefox mobile\b/i,
iep: /\bie phone\b/i,
Feature.prototype.id = function () {
return this.shortName
}
function buildFilter(browsers) {
var str = 'var family = agent.family\n'
Object.keys(families).forEach(function (name) {
if (name in browsers) {
str += 'if (families.' + name + '.test(family)) '
+ 'return agent.satisfies("< ' + browsers[name] + '")\n'
}
})
str += 'return ' + String(browsers.default !== false)
return eval('(function filter(agent) {\n' + str + '\n})')
}
exports.agents = require('./agents')
exports.recast = require('./recast')
exports.postcss = require('./postcss')
exports.polyfills = require('./polyfills')
{
"name": "polyfills-db",
"description": "browser feature database",
"version": "0.1.0",
"version": "0.2.0",
"author": {

@@ -13,6 +13,8 @@ "name": "Jonathan Ong",

"repository": "polyfills/db",
"dependencies": {},
"devDependencies": {
"dependencies": {
"semver": "3",
"useragent": "2",
"flatten": "0"
},
"devDependencies": {
"mocha": "1",

@@ -22,3 +24,3 @@ "istanbul": "0"

"scripts": {
"test": "mocha --reporter spec",
"test": "mocha --reporter spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",

@@ -35,3 +37,5 @@ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"

"main": "lib",
"files": "lib"
"files": [
"lib"
]
}

@@ -20,4 +20,4 @@

[npm-image]: https://img.shields.io/npm/v/db.svg?style=flat
[npm-url]: https://npmjs.org/package/db
[npm-image]: https://img.shields.io/npm/v/polyfills-db.svg?style=flat
[npm-url]: https://npmjs.org/package/polyfills-db
[travis-image]: https://img.shields.io/travis/polyfills/db.svg?style=flat

@@ -24,0 +24,0 @@ [travis-url]: https://travis-ci.org/polyfills/db

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc