You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@rolldown/pluginutils

Package Overview
Dependencies
Maintainers
3
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rolldown/pluginutils - npm Package Compare versions

Comparing version
1.0.0-beta.8-commit.985af6d
to
1.0.0-beta.8-commit.bf53a10
+12
-10
dist/index.cjs

@@ -8,2 +8,9 @@ "use strict";

}
function extractQueryWithoutFragment(url) {
const questionMarkIndex = url.indexOf("?");
if (questionMarkIndex === -1) return "";
const fragmentIndex = url.indexOf("#", questionMarkIndex);
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
else return url.substring(questionMarkIndex, fragmentIndex);
}

@@ -124,9 +131,4 @@ //#endregion

* @returns a `And` FilterExpression
*
* There are three kinds of conditions are supported:
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
* 2. `string`: the key must exist and be equal to the value.
* 3. `RegExp`: the key must exist and match the value.
*/
function queryObjectToFilterExpr(queryFilter) {
function queries(queryFilter) {
let arr = Object.entries(queryFilter).map(([key, value]) => {

@@ -179,3 +181,3 @@ return new Query(key, value);

if (!ctx.urlSearchParamsCache) {
let [_, queryString = ""] = id$1.split("?", 2);
let queryString = extractQueryWithoutFragment(id$1);
ctx.urlSearchParamsCache = new URLSearchParams(queryString);

@@ -189,3 +191,3 @@ }

}
default: throw new Error(`Expression kind ${expr} is not expected.`);
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
}

@@ -257,3 +259,3 @@ }

exports.prefixRegex = prefixRegex
exports.query = query
exports.queryObjectToFilterExpr = queryObjectToFilterExpr
exports.queries = queries
exports.query = query

@@ -76,9 +76,4 @@ //#region src/composable-filters.d.ts

* @returns a `And` FilterExpression
*
* There are three kinds of conditions are supported:
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
* 2. `string`: the key must exist and be equal to the value.
* 3. `RegExp`: the key must exist and match the value.
*/
declare function queryObjectToFilterExpr(queryFilter: QueryFilterObject): And;
declare function queries(queryFilter: QueryFilterObject): And;
declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType): boolean;

@@ -122,2 +117,2 @@ interface InterpreterCtx {

//#endregion
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, query, queryObjectToFilterExpr };
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };

@@ -76,9 +76,4 @@ //#region src/composable-filters.d.ts

* @returns a `And` FilterExpression
*
* There are three kinds of conditions are supported:
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
* 2. `string`: the key must exist and be equal to the value.
* 3. `RegExp`: the key must exist and match the value.
*/
declare function queryObjectToFilterExpr(queryFilter: QueryFilterObject): And;
declare function queries(queryFilter: QueryFilterObject): And;
declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType): boolean;

@@ -122,2 +117,2 @@ interface InterpreterCtx {

//#endregion
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, query, queryObjectToFilterExpr };
export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };

@@ -6,2 +6,9 @@ //#region src/utils.ts

}
function extractQueryWithoutFragment(url) {
const questionMarkIndex = url.indexOf("?");
if (questionMarkIndex === -1) return "";
const fragmentIndex = url.indexOf("#", questionMarkIndex);
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
else return url.substring(questionMarkIndex, fragmentIndex);
}

@@ -122,9 +129,4 @@ //#endregion

* @returns a `And` FilterExpression
*
* There are three kinds of conditions are supported:
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
* 2. `string`: the key must exist and be equal to the value.
* 3. `RegExp`: the key must exist and match the value.
*/
function queryObjectToFilterExpr(queryFilter) {
function queries(queryFilter) {
let arr = Object.entries(queryFilter).map(([key, value]) => {

@@ -177,3 +179,3 @@ return new Query(key, value);

if (!ctx.urlSearchParamsCache) {
let [_, queryString = ""] = id$1.split("?", 2);
let queryString = extractQueryWithoutFragment(id$1);
ctx.urlSearchParamsCache = new URLSearchParams(queryString);

@@ -187,3 +189,3 @@ }

}
default: throw new Error(`Expression kind ${expr} is not expected.`);
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
}

@@ -241,2 +243,2 @@ }

//#endregion
export { and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, query, queryObjectToFilterExpr };
export { and, code, exactRegex, exclude, exprInterpreter, id, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
{
"name": "@rolldown/pluginutils",
"version": "1.0.0-beta.8-commit.985af6d",
"version": "1.0.0-beta.8-commit.bf53a10",
"license": "MIT",

@@ -5,0 +5,0 @@ "type": "module",