@scayle/storefront-core 7.42.1 → 7.43.0
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/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.stripShopLocaleFromPath = exports.purifySensitiveData = void 0;
|
|
6
|
+
exports.stripShopLocaleFromPath = exports.purifySensitiveData = exports.createAndPurifyHeaders = void 0;
|
|
7
7
|
var _radash = require("radash");
|
|
8
8
|
const SANITIZATION_MASK = "********";
|
|
9
9
|
const stripShopLocaleFromPath = (locale, path, splitter = "/") => path.split(splitter).filter(segment => segment.toLowerCase() !== locale.toLowerCase()).join("/");
|
|
@@ -19,4 +19,9 @@ const purifySensitiveData = (data = {}, blacklistedKeys = ["password"]) => {
|
|
|
19
19
|
return purifiedPayload;
|
|
20
20
|
}, {});
|
|
21
21
|
};
|
|
22
|
-
exports.purifySensitiveData = purifySensitiveData;
|
|
22
|
+
exports.purifySensitiveData = purifySensitiveData;
|
|
23
|
+
const createAndPurifyHeaders = headers => {
|
|
24
|
+
const sanitizedHeaders = (0, _radash.shake)(headers);
|
|
25
|
+
return new Headers(sanitizedHeaders);
|
|
26
|
+
};
|
|
27
|
+
exports.createAndPurifyHeaders = createAndPurifyHeaders;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const stripShopLocaleFromPath: (locale: string, path: string, splitter?: string) => string;
|
|
2
2
|
export declare const purifySensitiveData: (data?: Record<string, any>, blacklistedKeys?: string[]) => Record<string, any>;
|
|
3
|
+
export declare const createAndPurifyHeaders: (headers: Partial<Record<string, string | undefined>>) => Headers;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isObject } from "radash";
|
|
1
|
+
import { isObject, shake } from "radash";
|
|
2
2
|
const SANITIZATION_MASK = "********";
|
|
3
3
|
export const stripShopLocaleFromPath = (locale, path, splitter = "/") => path.split(splitter).filter((segment) => segment.toLowerCase() !== locale.toLowerCase()).join("/");
|
|
4
4
|
export const purifySensitiveData = (data = {}, blacklistedKeys = ["password"]) => {
|
|
@@ -17,3 +17,7 @@ export const purifySensitiveData = (data = {}, blacklistedKeys = ["password"]) =
|
|
|
17
17
|
{}
|
|
18
18
|
);
|
|
19
19
|
};
|
|
20
|
+
export const createAndPurifyHeaders = (headers) => {
|
|
21
|
+
const sanitizedHeaders = shake(headers);
|
|
22
|
+
return new Headers(sanitizedHeaders);
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.43.0",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@aboutyou/backbone": "16.1.2",
|
|
63
63
|
"crypto-js": "4.2.0",
|
|
64
64
|
"jose": "5.2.2",
|
|
65
|
-
"radash": "
|
|
65
|
+
"radash": "12.0.0",
|
|
66
66
|
"slugify": "1.6.6",
|
|
67
67
|
"ufo": "1.4.0",
|
|
68
68
|
"uncrypto": "0.1.3",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "3.2.6",
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
|
-
"@types/node": "20.11.
|
|
74
|
+
"@types/node": "20.11.20",
|
|
75
75
|
"@types/webpack-env": "1.18.4",
|
|
76
|
-
"@vitest/coverage-v8": "1.3.
|
|
76
|
+
"@vitest/coverage-v8": "1.3.1",
|
|
77
77
|
"dprint": "0.45.0",
|
|
78
|
-
"eslint": "8.
|
|
78
|
+
"eslint": "8.57.0",
|
|
79
79
|
"eslint-formatter-gitlab": "5.1.0",
|
|
80
80
|
"publint": "0.2.7",
|
|
81
81
|
"rimraf": "5.0.5",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"typescript": "5.3.3",
|
|
84
84
|
"unbuild": "2.0.0",
|
|
85
85
|
"unstorage": "1.10.1",
|
|
86
|
-
"vitest": "1.3.
|
|
86
|
+
"vitest": "1.3.1"
|
|
87
87
|
},
|
|
88
88
|
"optionalDependencies": {
|
|
89
89
|
"redis": "4"
|