@medusajs/utils 2.21.1 → 2.21.2-snapshot-20260925150426
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/build-regexp-if-valid.d.ts.map +1 -1
- package/dist/common/build-regexp-if-valid.js +9 -1
- package/dist/common/build-regexp-if-valid.js.map +1 -1
- package/dist/common/get-set-difference.d.ts +2 -2
- package/dist/common/get-set-difference.d.ts.map +1 -1
- package/dist/common/get-set-difference.js +3 -3
- package/dist/common/get-set-difference.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-regexp-if-valid.d.ts","sourceRoot":"","sources":["../../src/common/build-regexp-if-valid.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"build-regexp-if-valid.d.ts","sourceRoot":"","sources":["../../src/common/build-regexp-if-valid.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAkBlE"}
|
|
@@ -5,7 +5,15 @@ function buildRegexpIfValid(str) {
|
|
|
5
5
|
try {
|
|
6
6
|
const m = str.match(/^([\/~@;%#'])(.*?)\1([gimsuy]*)$/);
|
|
7
7
|
if (m) {
|
|
8
|
-
|
|
8
|
+
// Validate the flags as written first, so an invalid combination
|
|
9
|
+
// (e.g. a duplicated flag) is still rejected.
|
|
10
|
+
new RegExp(m[2], m[3]);
|
|
11
|
+
// `g` and `y` make `RegExp#test` stateful (they advance `lastIndex`
|
|
12
|
+
// across calls), which corrupts repeated whole-value checks such as
|
|
13
|
+
// CORS origin matching. Neither flag adds anything for a single
|
|
14
|
+
// whole-value test, so they are stripped here.
|
|
15
|
+
const flags = m[3].replace(/[gy]/g, "");
|
|
16
|
+
return new RegExp(m[2], flags);
|
|
9
17
|
}
|
|
10
18
|
}
|
|
11
19
|
catch (e) { }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-regexp-if-valid.js","sourceRoot":"","sources":["../../src/common/build-regexp-if-valid.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"build-regexp-if-valid.js","sourceRoot":"","sources":["../../src/common/build-regexp-if-valid.ts"],"names":[],"mappings":";;AAAA,gDAkBC;AAlBD,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;QACvD,IAAI,CAAC,EAAE,CAAC;YACN,iEAAiE;YACjE,8CAA8C;YAC9C,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAEtB,oEAAoE;YACpE,oEAAoE;YACpE,gEAAgE;YAChE,+CAA+C;YAC/C,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;YACvC,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;QAChC,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IAEd,OAAM;AACR,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Get the difference between two sets. The difference is the elements that are in the original set but not in the compare set.
|
|
3
|
-
* @param
|
|
3
|
+
* @param originalSet
|
|
4
4
|
* @param compareSet
|
|
5
5
|
*/
|
|
6
|
-
export declare function getSetDifference<T>(
|
|
6
|
+
export declare function getSetDifference<T>(originalSet: Set<T>, compareSet: Set<T>): Set<T>;
|
|
7
7
|
//# sourceMappingURL=get-set-difference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-set-difference.d.ts","sourceRoot":"","sources":["../../src/common/get-set-difference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,
|
|
1
|
+
{"version":3,"file":"get-set-difference.d.ts","sourceRoot":"","sources":["../../src/common/get-set-difference.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,EACnB,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC,GACjB,GAAG,CAAC,CAAC,CAAC,CAUR"}
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getSetDifference = getSetDifference;
|
|
4
4
|
/**
|
|
5
5
|
* Get the difference between two sets. The difference is the elements that are in the original set but not in the compare set.
|
|
6
|
-
* @param
|
|
6
|
+
* @param originalSet
|
|
7
7
|
* @param compareSet
|
|
8
8
|
*/
|
|
9
|
-
function getSetDifference(
|
|
9
|
+
function getSetDifference(originalSet, compareSet) {
|
|
10
10
|
const difference = new Set();
|
|
11
|
-
|
|
11
|
+
originalSet.forEach((element) => {
|
|
12
12
|
if (!compareSet.has(element)) {
|
|
13
13
|
difference.add(element);
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-set-difference.js","sourceRoot":"","sources":["../../src/common/get-set-difference.ts"],"names":[],"mappings":";;AAKA,4CAaC;AAlBD;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,
|
|
1
|
+
{"version":3,"file":"get-set-difference.js","sourceRoot":"","sources":["../../src/common/get-set-difference.ts"],"names":[],"mappings":";;AAKA,4CAaC;AAlBD;;;;GAIG;AACH,SAAgB,gBAAgB,CAC9B,WAAmB,EACnB,UAAkB;IAElB,MAAM,UAAU,GAAG,IAAI,GAAG,EAAK,CAAA;IAE/B,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACzB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/utils",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.2-snapshot-20260925150426",
|
|
4
4
|
"description": "Medusa utilities functions shared by Medusa core and Modules",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"author": "Medusa",
|
|
30
30
|
"license": "SEE LICENSE IN LICENSE",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@medusajs/types": "2.21.
|
|
32
|
+
"@medusajs/types": "2.21.2-snapshot-20260925150426",
|
|
33
33
|
"express": "^4.21.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@graphql-codegen/typescript": "^4.0.9",
|
|
38
38
|
"@graphql-tools/merge": "^9.0.7",
|
|
39
39
|
"@graphql-tools/schema": "^10.0.6",
|
|
40
|
-
"@medusajs/deps": "2.21.
|
|
40
|
+
"@medusajs/deps": "2.21.2-snapshot-20260925150426",
|
|
41
41
|
"@types/pluralize": "^0.0.33",
|
|
42
42
|
"bignumber.js": "^9.1.2",
|
|
43
43
|
"dotenv": "^16.4.5",
|