🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@rollup/pluginutils

Package Overview
Dependencies
Maintainers
4
Versions
31
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
5.3.0
to
5.4.0
+19
-4
./dist/cjs/index.js

@@ -306,2 +306,6 @@ 'use strict';

}
// Matches the ECMAScript `IdentifierName` grammar, which (unlike a binding
// identifier) also accepts reserved words such as `switch`/`await`. Such names
// can be re-exported with the `export { _x as switch }` form, valid since ES2015.
const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
const dataToEsm = function dataToEsm(data, options = {}) {

@@ -344,6 +348,17 @@ var _a, _b;

defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
if (options.includeArbitraryNames && isWellFormedString(key)) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
// A `default` key is exposed only through the default export object: a
// `... as default` re-export would clash with the trailing `export default`
// and produce a duplicate default export (a SyntaxError).
if (key !== 'default') {
// A valid `IdentifierName` that is not a legal binding identifier (a
// reserved word or global, e.g. `switch`, `await`) is re-exported with the
// unquoted `export { _x as switch }` form, valid since ES2015. Any other
// key needs the quoted arbitrary-namespace form (ES2022+), which remains
// opt-in via `includeArbitraryNames`.
const isIdentifierName = identifierNameRE.test(key);
if (isIdentifierName || (options.includeArbitraryNames && isWellFormedString(key))) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
}
}

@@ -350,0 +365,0 @@ }

@@ -306,2 +306,6 @@ 'use strict';

}
// Matches the ECMAScript `IdentifierName` grammar, which (unlike a binding
// identifier) also accepts reserved words such as `switch`/`await`. Such names
// can be re-exported with the `export { _x as switch }` form, valid since ES2015.
const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
const dataToEsm = function dataToEsm(data, options = {}) {

@@ -344,6 +348,17 @@ var _a, _b;

defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
if (options.includeArbitraryNames && isWellFormedString(key)) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
// A `default` key is exposed only through the default export object: a
// `... as default` re-export would clash with the trailing `export default`
// and produce a duplicate default export (a SyntaxError).
if (key !== 'default') {
// A valid `IdentifierName` that is not a legal binding identifier (a
// reserved word or global, e.g. `switch`, `await`) is re-exported with the
// unquoted `export { _x as switch }` form, valid since ES2015. Any other
// key needs the quoted arbitrary-namespace form (ES2022+), which remains
// opt-in via `includeArbitraryNames`.
const isIdentifierName = identifierNameRE.test(key);
if (isIdentifierName || (options.includeArbitraryNames && isWellFormedString(key))) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
}
}

@@ -350,0 +365,0 @@ }

@@ -302,2 +302,6 @@ import { extname, win32, posix, isAbsolute, resolve } from 'path';

}
// Matches the ECMAScript `IdentifierName` grammar, which (unlike a binding
// identifier) also accepts reserved words such as `switch`/`await`. Such names
// can be re-exported with the `export { _x as switch }` form, valid since ES2015.
const identifierNameRE = /^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u;
const dataToEsm = function dataToEsm(data, options = {}) {

@@ -340,6 +344,17 @@ var _a, _b;

defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
if (options.includeArbitraryNames && isWellFormedString(key)) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`);
// A `default` key is exposed only through the default export object: a
// `... as default` re-export would clash with the trailing `export default`
// and produce a duplicate default export (a SyntaxError).
if (key !== 'default') {
// A valid `IdentifierName` that is not a legal binding identifier (a
// reserved word or global, e.g. `switch`, `await`) is re-exported with the
// unquoted `export { _x as switch }` form, valid since ES2015. Any other
// key needs the quoted arbitrary-namespace form (ES2022+), which remains
// opt-in via `includeArbitraryNames`.
const isIdentifierName = identifierNameRE.test(key);
if (isIdentifierName || (options.includeArbitraryNames && isWellFormedString(key))) {
const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`;
namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
arbitraryNameExportRows.push(`${variableName} as ${isIdentifierName ? key : JSON.stringify(key)}`);
}
}

@@ -346,0 +361,0 @@ }

+3
-18
{
"name": "@rollup/pluginutils",
"version": "5.3.0",
"version": "5.4.0",
"publishConfig": {

@@ -65,17 +65,2 @@ "access": "public"

"types": "./types/index.d.ts",
"ava": {
"extensions": [
"ts"
],
"require": [
"ts-node/register"
],
"workerThreads": false,
"files": [
"!**/fixtures/**",
"!**/helpers/**",
"!**/recipes/**",
"!**/types.ts"
]
},
"nyc": {

@@ -92,3 +77,3 @@ "extension": [

"ci:lint:commits": "commitlint --from=${CIRCLE_BRANCH} --to=${CIRCLE_SHA1}",
"ci:test": "pnpm test -- --verbose",
"ci:test": "pnpm test -- --reporter=verbose",
"prebuild": "del-cli dist",

@@ -98,5 +83,5 @@ "prerelease": "pnpm build",

"release": "pnpm --workspace-root package:release $(pwd)",
"test": "ava",
"test": "vitest --config ../../.config/vitest.config.mts run",
"test:ts": "tsc --noEmit"
}
}