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

rollup-pluginutils

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-pluginutils - npm Package Compare versions

Comparing version 2.4.1 to 2.5.0

31

CHANGELOG.md
# rollup-pluginutils changelog
## 2.5.0
*2019-03-18*
* Generalize dataToEsm type ([#55](https://github.com/rollup/rollup-pluginutils/issues/55))
* Handle empty keys in dataToEsm ([#56](https://github.com/rollup/rollup-pluginutils/issues/56))
## 2.4.1
*2019-02-16*
* Remove unnecessary dependency
## 2.4.0
*2019-02-16*
Update dependencies to solve micromatch vulnerability ([#53](https://github.com/rollup/rollup-pluginutils/issues/53))
## 2.3.3
*2017-09-19*
*2018-09-19*
* Revert micromatch update ([#43](https://github.com/rollup/rollup-pluginutils/issues/43))
## 2.3.2
*2017-09-18*
*2018-09-18*
* Bumb micromatch dependency ([#36](https://github.com/rollup/rollup-pluginutils/issues/36))

@@ -14,19 +27,23 @@ * Bumb dependencies ([#41](https://github.com/rollup/rollup-pluginutils/issues/41))

## 2.3.1
*2017-08-06*
*2018-08-06*
* Fixed ObjectPattern scope in attachScopes to recognise { ...rest } syntax ([#37](https://github.com/rollup/rollup-pluginutils/issues/37))
## 2.3.0
*2017-05-21*
*2018-05-21*
* Add option to not generate named exports ([#32](https://github.com/rollup/rollup-pluginutils/issues/32))
## 2.2.1
*2017-05-21*
*2018-05-21*
* Support `null` serialization ([#34](https://github.com/rollup/rollup-pluginutils/issues/34))
## 2.2.0
*2017-05-11*
*2018-05-11*
* Improve white-space handling in `dataToEsm` and add `prepare` script ([#31](https://github.com/rollup/rollup-pluginutils/issues/31))
## 2.1.1
*2018-05-09*
* Update dependencies
## 2.1.0
*2017-05-07*
*2018-05-08*
* Add `dataToEsm` helper to create named exports from objects ([#29](https://github.com/rollup/rollup-pluginutils/issues/29))

@@ -33,0 +50,0 @@ * Support literal keys in object patterns ([#27](https://github.com/rollup/rollup-pluginutils/issues/27))

@@ -194,10 +194,11 @@ 'use strict';

var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
var blacklisted = Object.create(null);
reservedWords.concat(builtins).forEach(function (word) { return (blacklisted[word] = true); });
var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
var forbiddenIdentifiers = new Set((reservedWords + " " + builtins).split(' '));
forbiddenIdentifiers.add('');
function makeLegalIdentifier(str) {
str = str.replace(/-(\w)/g, function (_, letter) { return letter.toUpperCase(); }).replace(/[^$_a-zA-Z0-9]/g, '_');
if (/\d/.test(str[0]) || blacklisted[str])
if (/\d/.test(str[0]) || forbiddenIdentifiers.has(str)) {
str = "_" + str;
}
return str;

@@ -204,0 +205,0 @@ }

@@ -174,9 +174,9 @@ import { extname, sep, resolve } from 'path';

for (var i = 0; i < excludeMatchers.length; ++i) {
var matcher$$1 = excludeMatchers[i];
if (matcher$$1.test(id))
var matcher = excludeMatchers[i];
if (matcher.test(id))
return false;
}
for (var i = 0; i < includeMatchers.length; ++i) {
var matcher$$1 = includeMatchers[i];
if (matcher$$1.test(id))
var matcher = includeMatchers[i];
if (matcher.test(id))
return true;

@@ -191,10 +191,11 @@ }

var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
var blacklisted = Object.create(null);
reservedWords.concat(builtins).forEach(function (word) { return (blacklisted[word] = true); });
var reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
var builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
var forbiddenIdentifiers = new Set((reservedWords + " " + builtins).split(' '));
forbiddenIdentifiers.add('');
function makeLegalIdentifier(str) {
str = str.replace(/-(\w)/g, function (_, letter) { return letter.toUpperCase(); }).replace(/[^$_a-zA-Z0-9]/g, '_');
if (/\d/.test(str[0]) || blacklisted[str])
if (/\d/.test(str[0]) || forbiddenIdentifiers.has(str)) {
str = "_" + str;
}
return str;

@@ -201,0 +202,0 @@ }

{
"name": "rollup-pluginutils",
"description": "Functionality commonly needed by Rollup plugins",
"version": "2.4.1",
"version": "2.5.0",
"main": "dist/pluginutils.cjs.js",

@@ -16,14 +16,14 @@ "module": "dist/pluginutils.es.js",

"@types/estree": "0.0.39",
"@types/jest": "^24.0.5",
"@types/jest": "^24.0.11",
"@types/micromatch": "^3.1.0",
"@types/node": "^11.9.4",
"@types/node": "^11.11.3",
"husky": "^1.3.1",
"jest": "^24.1.0",
"lint-staged": "^8.1.4",
"jest": "^24.5.0",
"lint-staged": "^8.1.5",
"prettier": "^1.16.4",
"rollup": "^1.1.2",
"rollup": "^1.6.0",
"rollup-plugin-typescript": "^1.0.0",
"ts-jest": "^23.10.5",
"tslint": "^5.12.1",
"typescript": "^3.3.3",
"ts-jest": "^24.0.0",
"tslint": "^5.14.0",
"typescript": "^3.3.3333",
"typescript-eslint-parser": "^22.0.0"

@@ -30,0 +30,0 @@ },

@@ -51,6 +51,3 @@ import makeLegalIdentifier from './makeLegalIdentifier';

// convert data object into separate named exports (and default)
export default function dataToNamedExports<T extends { [key: string]: any }>(
data: T | Array<T>,
options: Options = {}
): string {
export default function dataToNamedExports(data: any, options: Options = {}): string {
const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';

@@ -57,0 +54,0 @@ const _ = options.compact ? '' : ' ';

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

const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(
' '
);
const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(
' '
);
const reservedWords =
'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
const builtins =
'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
const blacklisted: { [key: string]: boolean } = Object.create(null);
reservedWords.concat(builtins).forEach(word => (blacklisted[word] = true));
const forbiddenIdentifiers = new Set<string>(`${reservedWords} ${builtins}`.split(' '));
forbiddenIdentifiers.add('');

@@ -14,5 +12,7 @@ export default function makeLegalIdentifier(str: string): string {

if (/\d/.test(str[0]) || blacklisted[str]) str = `_${str}`;
if (/\d/.test(str[0]) || forbiddenIdentifiers.has(str)) {
str = `_${str}`;
}
return str;
}
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