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

autopolyfiller

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autopolyfiller - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

35

index.js

@@ -1,9 +0,10 @@

var acorn = require('acorn'),
assert = require('assert'),
scan = require('./lib/polyfill-scan'),
reduce = require('./lib/polyfill-reduce'),
wrap = require('./lib/polyfill-wrap'),
code = require('./lib/polyfill-code');
var acorn = require('acorn');
var assert = require('assert');
var scan = require('./lib/polyfill-scan');
var reduce = require('./lib/polyfill-reduce');
var wrap = require('./lib/polyfill-wrap');
var minimatch = require('minimatch');
var code = require('./lib/polyfill-code');
var stablePolyfills = require('autopolyfiller-stable');
var polyfillNames = Object.keys(stablePolyfills.polyfill);

@@ -85,4 +86,4 @@ /**

add: function (code) {
var polyfills = this._scan(code),
polyfillsOfPolyfills = this._scanForPolyfillsOfPolyfills(polyfills);
var polyfills = this._scan(code);
var polyfillsOfPolyfills = this._scanForPolyfillsOfPolyfills(polyfills);

@@ -126,2 +127,16 @@ this.include(polyfills.concat(polyfillsOfPolyfills));

// If any of the patterns contain '*', add all of the matching
// polyfills
.reduce(function (polyfills, polyfill) {
if (polyfill.indexOf('*') > -1) {
var matches = polyfillNames.filter(function (name) {
return minimatch(name, polyfill);
});
return polyfills.concat(matches);
}
polyfills.push(polyfill);
return polyfills;
}, [])
// Filter ignored polyfills

@@ -189,3 +204,3 @@ .filter(this._isPolyfillIncluded.bind(this))

function create() {
var browsers = 1 <= arguments.length ? [].slice.call(arguments, 0) : [];
var browsers = arguments.length >= 1 ? [].slice.call(arguments, 0) : [];

@@ -192,0 +207,0 @@ if (browsers.length === 1 && browsers[0] instanceof Array) {

@@ -1,8 +0,8 @@

var Command = require('commander').Command,
fs = require('fs'),
mkdirp = require('mkdirp').sync,
format = require('util').format,
path = require('path'),
globule = require('globule'),
autopolyfiller = require('..');
var Command = require('commander').Command;
var fs = require('fs');
var mkdirp = require('mkdirp').sync;
var format = require('util').format;
var path = require('path');
var globule = require('globule');
var autopolyfiller = require('..');

@@ -66,5 +66,5 @@ var noop = function () {};

createPolyFiller: function () {
var browsers = this.program.browsers,
excludedPolyfills = this.program.exclude,
includedPolyfills = this.program.include;
var browsers = this.program.browsers;
var excludedPolyfills = this.program.exclude;
var includedPolyfills = this.program.include;

@@ -101,3 +101,8 @@ this.log((function () {

.option('-p, --parser <parser>', 'specifies JavaScript parser (node module)', require, null)
.option('-P, --parser-options <parser-options>', 'custom parser options (valid json object)', JSON.parse.bind(JSON), void 0)
.option(
'-P, --parser-options <parser-options>',
'custom parser options (valid json object)',
JSON.parse.bind(JSON),
void 0
)
.option('-v, --verbose', 'verbose output')

@@ -154,4 +159,4 @@ .on('--help', function () {

writePolyFills: function () {
var output = this.program.output,
polyfills = this.polyfiller.polyfills;
var output = this.program.output;
var polyfills = this.polyfiller.polyfills;

@@ -158,0 +163,0 @@ this.log((function () {

@@ -1,3 +0,3 @@

var extend = require('node.extend'),
debug = require('debug')('polyfill:code');
var extend = require('node.extend');
var debug = require('debug')('polyfill:code');

@@ -4,0 +4,0 @@ var polyfillsCode = {};

@@ -1,4 +0,4 @@

var browserslist = require('browserslist'),
debug = require('debug')('polyfill:reduce'),
semver = require('semver');
var browserslist = require('browserslist');
var debug = require('debug')('polyfill:reduce');
var semver = require('semver');

@@ -9,9 +9,9 @@ var polyFillSets = {};

var browserMap = {
'ie': 'Internet Explorer',
'firefox': 'Firefox',
'chrome': 'Chrome',
'safari': 'Safari',
'opera': 'Opera',
'ios_saf': 'Safari iOS',
'android': 'Android'
ie: 'Internet Explorer',
firefox: 'Firefox',
chrome: 'Chrome',
safari: 'Safari',
opera: 'Opera',
ios_saf: 'Safari iOS',
android: 'Android'
/*,'ie_mob': ''*/

@@ -18,0 +18,0 @@ };

/*!
* polyfill-scan
*/
var acorn = require('acorn'),
debug = require('debug')('polyfill:scan');
var acorn = require('acorn');
var debug = require('debug')('polyfill:scan');

@@ -7,0 +7,0 @@ var matchers = [];

@@ -1,3 +0,3 @@

var extend = require('node.extend'),
debug = require('debug')('polyfill:wrap');
var extend = require('node.extend');
var debug = require('debug')('polyfill:wrap');

@@ -15,4 +15,4 @@ var polyfillsWrappers = {};

debug('wrapping code of `%s` using default wrapper', polyfillName);
var parts = polyfillName.split('.'),
expression = 'true';
var parts = polyfillName.split('.');
var expression = 'true';

@@ -19,0 +19,0 @@ if (parts.length === 1) {

@@ -13,3 +13,3 @@ {

],
"version": "1.6.0",
"version": "1.6.1",
"author": "Mikhail Davydov <i@azproduction.ru>",

@@ -31,10 +31,11 @@ "contributors": [

"acorn": "~0.11.0",
"autopolyfiller-stable": "~1.0.2",
"browserslist": "~0.1.0",
"commander": "~2.1.0",
"debug": "~0.7.4",
"node.extend": "~1.0.9",
"commander": "~2.1.0",
"globule": "0.2.0",
"minimatch": "^2.0.7",
"mkdirp": "~0.3.5",
"semver": "~2.2.1",
"autopolyfiller-stable": "~1.0.2"
"node.extend": "~1.0.9",
"semver": "~2.2.1"
},

@@ -44,15 +45,15 @@ "devDependencies": {

"browserify": "*",
"chai": "*",
"codeclimate-test-reporter": "~0.0.3",
"coveralls": "*",
"glob": "~3.2.9",
"grasp-equery": "~0.2.0",
"husky": "~0.5.1",
"istanbul": "~0.2.11",
"jscs": "^1.13.1",
"jshint": "^2.7.0",
"mocha": "~2.2.4",
"mocha-istanbul": "*",
"mock-utf8-stream": "*",
"uglify-js": "*",
"jshint": "2.1.3",
"mocha": "~1.11.0",
"jscs": "~1.4.5",
"istanbul": "~0.2.11",
"codeclimate-test-reporter": "~0.0.3",
"chai": "*",
"coveralls": "*",
"husky": "~0.5.1"
"uglify-js": "*"
},

@@ -62,10 +63,15 @@ "bin": {

},
"files": [
"bin/",
"lib/",
"index.js"
],
"scripts": {
"test": "jshint . && jscs . && mocha -R spec",
"test": "npm run lint && mocha -R spec",
"lint": "jshint . && jscs . ",
"coverage": "istanbul cover node_modules/.bin/_mocha --report html -- -R spec",
"coverage_push": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && cat ./coverage/lcov.info | codeclimate || true",
"precommit": "npm test",
"prepush": "npm test",
"benchmark": "node ./benchmark/scan"
}
}
# Autopolyfiller — Precise polyfills
[![NPM Version](https://badge.fury.io/js/autopolyfiller.png)](https://npmjs.org/package/autopolyfiller) [![Build Status](https://travis-ci.org/azproduction/autopolyfiller.png?branch=master)](https://travis-ci.org/azproduction/autopolyfiller) [![Coverage Status](https://coveralls.io/repos/azproduction/autopolyfiller/badge.png?branch=master&)](https://coveralls.io/r/azproduction/autopolyfiller) [![Code Climate](https://codeclimate.com/github/azproduction/autopolyfiller.png)](https://codeclimate.com/github/azproduction/autopolyfiller) [![Dependency Status](https://gemnasium.com/azproduction/autopolyfiller.png)](https://gemnasium.com/azproduction/autopolyfiller)
[![NPM Version](https://img.shields.io/npm/v/autopolyfiller.svg)](https://npmjs.org/package/autopolyfiller) [![Build Status](https://img.shields.io/travis/azproduction/autopolyfiller.svg)](https://travis-ci.org/azproduction/autopolyfiller) [![Coverage Status](https://img.shields.io/coveralls/azproduction/autopolyfiller.svg)](https://coveralls.io/r/azproduction/autopolyfiller) [![Code Climate](https://img.shields.io/codeclimate/github/azproduction/autopolyfiller.svg)](https://codeclimate.com/github/azproduction/autopolyfiller) [![Dependency Status](https://img.shields.io/gemnasium/azproduction/autopolyfiller.svg)](https://gemnasium.com/azproduction/autopolyfiller)

@@ -25,3 +25,3 @@ This is like [Autoprefixer](https://github.com/ai/autoprefixer), but for JavaScript polyfills. It scans your code and applies only required polyfills. [Live&nbsp;example](http://azproduction.github.io/autopolyfiller).

## Installation
## Installation

@@ -96,2 +96,4 @@ `autopolyfiller` can be installed using `npm`:

.include(['String.prototype.trim'])
// All Array polyfills
.include(['Array.*'])
.add('new My.Promise();')

@@ -126,3 +128,3 @@ .polyfills;

},
// Your polyfills code

@@ -132,3 +134,3 @@ polyfill: {

},
// This list means "apply this feature to the <list of browsers>"

@@ -143,3 +145,3 @@ // For more examples see https://github.com/jonathantneal/polyfill/blob/master/agent.js.json

},
// This is optional. By default autopolyfiller will use

@@ -146,0 +148,0 @@ // polyfill's name to generate condition's code:

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