@verdaccio/core 8.1.4 → 8.2.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/build/_virtual/_rolldown/runtime.js +33 -0
- package/build/_virtual/_rolldown/runtime.mjs +13 -0
- package/build/auth-utils.d.ts +0 -1
- package/build/auth-utils.js +23 -25
- package/build/auth-utils.js.map +1 -1
- package/build/auth-utils.mjs +32 -0
- package/build/auth-utils.mjs.map +1 -0
- package/build/constants.js +201 -157
- package/build/constants.js.map +1 -1
- package/build/constants.mjs +185 -0
- package/build/constants.mjs.map +1 -0
- package/build/crypto-utils.d.ts +0 -2
- package/build/crypto-utils.js +33 -29
- package/build/crypto-utils.js.map +1 -1
- package/build/crypto-utils.mjs +40 -0
- package/build/crypto-utils.mjs.map +1 -0
- package/build/error-utils.js +92 -80
- package/build/error-utils.js.map +1 -1
- package/build/error-utils.mjs +107 -0
- package/build/error-utils.mjs.map +1 -0
- package/build/file-utils.js +35 -31
- package/build/file-utils.js.map +1 -1
- package/build/file-utils.mjs +35 -0
- package/build/file-utils.mjs.map +1 -0
- package/build/index.d.ts +2 -1
- package/build/index.js +125 -185
- package/build/index.mjs +15 -0
- package/build/ip-utils.js +52 -69
- package/build/ip-utils.js.map +1 -1
- package/build/ip-utils.mjs +60 -0
- package/build/ip-utils.mjs.map +1 -0
- package/build/pkg-utils.js +60 -76
- package/build/pkg-utils.js.map +1 -1
- package/build/pkg-utils.mjs +69 -0
- package/build/pkg-utils.mjs.map +1 -0
- package/build/plugin-utils.d.ts +0 -1
- package/build/plugin-utils.js +27 -78
- package/build/plugin-utils.js.map +1 -1
- package/build/plugin-utils.mjs +26 -0
- package/build/plugin-utils.mjs.map +1 -0
- package/build/schemes/publish-manifest.js +33 -43
- package/build/schemes/publish-manifest.js.map +1 -1
- package/build/schemes/publish-manifest.mjs +36 -0
- package/build/schemes/publish-manifest.mjs.map +1 -0
- package/build/schemes/unpublish-manifest.js +51 -72
- package/build/schemes/unpublish-manifest.js.map +1 -1
- package/build/schemes/unpublish-manifest.mjs +54 -0
- package/build/schemes/unpublish-manifest.mjs.map +1 -0
- package/build/search-utils.js +9 -9
- package/build/search-utils.js.map +1 -1
- package/build/search-utils.mjs +8 -0
- package/build/search-utils.mjs.map +1 -0
- package/build/stream-utils.d.ts +0 -1
- package/build/stream-utils.js +29 -28
- package/build/stream-utils.js.map +1 -1
- package/build/stream-utils.mjs +30 -0
- package/build/stream-utils.mjs.map +1 -0
- package/build/string-utils.js +31 -34
- package/build/string-utils.js.map +1 -1
- package/build/string-utils.mjs +31 -0
- package/build/string-utils.mjs.map +1 -0
- package/build/tarball-utils.js +40 -39
- package/build/tarball-utils.js.map +1 -1
- package/build/tarball-utils.mjs +46 -0
- package/build/tarball-utils.mjs.map +1 -0
- package/build/validation-utils.js +78 -112
- package/build/validation-utils.js.map +1 -1
- package/build/validation-utils.mjs +91 -0
- package/build/validation-utils.mjs.map +1 -0
- package/build/warning-utils.d.ts +1 -0
- package/build/warning-utils.js +38 -33
- package/build/warning-utils.js.map +1 -1
- package/build/warning-utils.mjs +40 -0
- package/build/warning-utils.mjs.map +1 -0
- package/package.json +19 -6
- package/build/index.js.map +0 -1
- package/build/path-utils.js +0 -2
- package/build/path-utils.js.map +0 -1
package/build/string-utils.js
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getByQualityPriorityValue = getByQualityPriorityValue;
|
|
1
|
+
//#region src/string-utils.ts
|
|
2
|
+
var string_utils_exports = /* @__PURE__ */ require("./_virtual/_rolldown/runtime.js").__exportAll({ getByQualityPriorityValue: () => getByQualityPriorityValue });
|
|
7
3
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
* Quality values, or q-values and q-factors, are used to describe the order
|
|
5
|
+
* of priority of values in a comma-separated list.
|
|
6
|
+
* It is a special syntax allowed in some HTTP headers and in HTML.
|
|
7
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Quality_values
|
|
8
|
+
* @param headerValue
|
|
9
|
+
*/
|
|
14
10
|
function getByQualityPriorityValue(headerValue) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
acc.push([qList[0], 0]);
|
|
31
|
-
}
|
|
32
|
-
return acc;
|
|
33
|
-
}, []).sort(function (a, b) {
|
|
34
|
-
return b[1] - a[1];
|
|
35
|
-
});
|
|
36
|
-
return header[0];
|
|
11
|
+
if (typeof headerValue !== "string") return "";
|
|
12
|
+
const split = headerValue.split(",");
|
|
13
|
+
if (split.length <= 1) return split[0].split(";")[0];
|
|
14
|
+
const [header] = split.reduce((acc, item) => {
|
|
15
|
+
const qList = item.split(";");
|
|
16
|
+
if (qList.length > 1) {
|
|
17
|
+
const [accept, q] = qList;
|
|
18
|
+
const [, query] = q.split("=");
|
|
19
|
+
acc.push([accept.trim(), query ? query : 0]);
|
|
20
|
+
} else acc.push([qList[0], 0]);
|
|
21
|
+
return acc;
|
|
22
|
+
}, []).sort(function(a, b) {
|
|
23
|
+
return b[1] - a[1];
|
|
24
|
+
});
|
|
25
|
+
return header[0];
|
|
37
26
|
}
|
|
27
|
+
//#endregion
|
|
28
|
+
Object.defineProperty(exports, "string_utils_exports", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function() {
|
|
31
|
+
return string_utils_exports;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
38
35
|
//# sourceMappingURL=string-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.js","names":[
|
|
1
|
+
{"version":3,"file":"string-utils.js","names":[],"sources":["../src/string-utils.ts"],"sourcesContent":["/**\n * Quality values, or q-values and q-factors, are used to describe the order\n * of priority of values in a comma-separated list.\n * It is a special syntax allowed in some HTTP headers and in HTML.\n * https://developer.mozilla.org/en-US/docs/Glossary/Quality_values\n * @param headerValue\n */\nexport function getByQualityPriorityValue(headerValue: string | undefined | null): string {\n if (typeof headerValue !== 'string') {\n return '';\n }\n\n const split = headerValue.split(',');\n\n if (split.length <= 1) {\n const qList = split[0].split(';');\n return qList[0];\n }\n\n const [header] = split\n .reduce((acc, item: string) => {\n const qList = item.split(';');\n if (qList.length > 1) {\n const [accept, q] = qList;\n const [, query] = q.split('=');\n acc.push([accept.trim(), query ? query : 0]);\n } else {\n acc.push([qList[0], 0]);\n }\n return acc;\n }, [] as any)\n .sort(function (a: number[], b: number[]) {\n return b[1] - a[1];\n });\n return header[0];\n}\n"],"mappings":";;;;;;;;;AAOA,SAAgB,0BAA0B,aAAgD;CACxF,IAAI,OAAO,gBAAgB,UACzB,OAAO;CAGT,MAAM,QAAQ,YAAY,MAAM,GAAG;CAEnC,IAAI,MAAM,UAAU,GAElB,OADc,MAAM,GAAG,MAAM,GACtB,EAAM;CAGf,MAAM,CAAC,UAAU,MACd,QAAQ,KAAK,SAAiB;EAC7B,MAAM,QAAQ,KAAK,MAAM,GAAG;EAC5B,IAAI,MAAM,SAAS,GAAG;GACpB,MAAM,CAAC,QAAQ,KAAK;GACpB,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG;GAC7B,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG,QAAQ,QAAQ,CAAC,CAAC;EAC7C,OACE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;EAExB,OAAO;CACT,GAAG,CAAC,CAAQ,EACX,KAAK,SAAU,GAAa,GAAa;EACxC,OAAO,EAAE,KAAK,EAAE;CAClB,CAAC;CACH,OAAO,OAAO;AAChB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
//#region src/string-utils.ts
|
|
3
|
+
var string_utils_exports = /* @__PURE__ */ __exportAll({ getByQualityPriorityValue: () => getByQualityPriorityValue });
|
|
4
|
+
/**
|
|
5
|
+
* Quality values, or q-values and q-factors, are used to describe the order
|
|
6
|
+
* of priority of values in a comma-separated list.
|
|
7
|
+
* It is a special syntax allowed in some HTTP headers and in HTML.
|
|
8
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Quality_values
|
|
9
|
+
* @param headerValue
|
|
10
|
+
*/
|
|
11
|
+
function getByQualityPriorityValue(headerValue) {
|
|
12
|
+
if (typeof headerValue !== "string") return "";
|
|
13
|
+
const split = headerValue.split(",");
|
|
14
|
+
if (split.length <= 1) return split[0].split(";")[0];
|
|
15
|
+
const [header] = split.reduce((acc, item) => {
|
|
16
|
+
const qList = item.split(";");
|
|
17
|
+
if (qList.length > 1) {
|
|
18
|
+
const [accept, q] = qList;
|
|
19
|
+
const [, query] = q.split("=");
|
|
20
|
+
acc.push([accept.trim(), query ? query : 0]);
|
|
21
|
+
} else acc.push([qList[0], 0]);
|
|
22
|
+
return acc;
|
|
23
|
+
}, []).sort(function(a, b) {
|
|
24
|
+
return b[1] - a[1];
|
|
25
|
+
});
|
|
26
|
+
return header[0];
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { string_utils_exports };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=string-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-utils.mjs","names":[],"sources":["../src/string-utils.ts"],"sourcesContent":["/**\n * Quality values, or q-values and q-factors, are used to describe the order\n * of priority of values in a comma-separated list.\n * It is a special syntax allowed in some HTTP headers and in HTML.\n * https://developer.mozilla.org/en-US/docs/Glossary/Quality_values\n * @param headerValue\n */\nexport function getByQualityPriorityValue(headerValue: string | undefined | null): string {\n if (typeof headerValue !== 'string') {\n return '';\n }\n\n const split = headerValue.split(',');\n\n if (split.length <= 1) {\n const qList = split[0].split(';');\n return qList[0];\n }\n\n const [header] = split\n .reduce((acc, item: string) => {\n const qList = item.split(';');\n if (qList.length > 1) {\n const [accept, q] = qList;\n const [, query] = q.split('=');\n acc.push([accept.trim(), query ? query : 0]);\n } else {\n acc.push([qList[0], 0]);\n }\n return acc;\n }, [] as any)\n .sort(function (a: number[], b: number[]) {\n return b[1] - a[1];\n });\n return header[0];\n}\n"],"mappings":";;;;;;;;;;AAOA,SAAgB,0BAA0B,aAAgD;CACxF,IAAI,OAAO,gBAAgB,UACzB,OAAO;CAGT,MAAM,QAAQ,YAAY,MAAM,GAAG;CAEnC,IAAI,MAAM,UAAU,GAElB,OADc,MAAM,GAAG,MAAM,GACtB,EAAM;CAGf,MAAM,CAAC,UAAU,MACd,QAAQ,KAAK,SAAiB;EAC7B,MAAM,QAAQ,KAAK,MAAM,GAAG;EAC5B,IAAI,MAAM,SAAS,GAAG;GACpB,MAAM,CAAC,QAAQ,KAAK;GACpB,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG;GAC7B,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG,QAAQ,QAAQ,CAAC,CAAC;EAC7C,OACE,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;EAExB,OAAO;CACT,GAAG,CAAC,CAAQ,EACX,KAAK,SAAU,GAAa,GAAa;EACxC,OAAO,EAAE,KAAK,EAAE;CAClB,CAAC;CACH,OAAO,OAAO;AAChB"}
|
package/build/tarball-utils.js
CHANGED
|
@@ -1,50 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.js");
|
|
2
|
+
let node_url = require("node:url");
|
|
3
|
+
//#region src/tarball-utils.ts
|
|
4
|
+
var tarball_utils_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
5
|
+
composeTarballFromPackage: () => composeTarballFromPackage,
|
|
6
|
+
extractTarballFromUrl: () => extractTarballFromUrl,
|
|
7
|
+
getVersionFromTarball: () => getVersionFromTarball
|
|
5
8
|
});
|
|
6
|
-
exports.composeTarballFromPackage = composeTarballFromPackage;
|
|
7
|
-
exports.extractTarballFromUrl = extractTarballFromUrl;
|
|
8
|
-
exports.getVersionFromTarball = getVersionFromTarball;
|
|
9
|
-
var _nodeUrl = require("node:url");
|
|
10
9
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
* Return package version from tarball name
|
|
11
|
+
*
|
|
12
|
+
* test-1.2.4.tgz -> 1.2.4
|
|
13
|
+
* @param {String} fileName
|
|
14
|
+
* @returns {String}
|
|
15
|
+
*/
|
|
17
16
|
function getVersionFromTarball(fileName) {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const groups = fileName.replace(/\.tgz$/, "").match(/^[^/]+-(\d+\.\d+\.\d+.*)/);
|
|
18
|
+
return groups !== null ? groups[1] : void 0;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
* Extract the tarball name from a registry dist url
|
|
22
|
+
*
|
|
23
|
+
* https://registry.npmjs.org/test/-/test-0.0.2.tgz -> test-0.0.2.tgz
|
|
24
|
+
* @param tarball tarball url
|
|
25
|
+
* @returns tarball filename
|
|
26
|
+
*/
|
|
29
27
|
function extractTarballFromUrl(url) {
|
|
30
|
-
|
|
31
|
-
return urlObject.pathname.replace(/^.*\//, '');
|
|
28
|
+
return new node_url.URL(url).pathname.replace(/^.*\//, "");
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
* Build the tarball filename from paackage name and version
|
|
32
|
+
*
|
|
33
|
+
* test, 1.2.4 -> test-1.2.4.tgz
|
|
34
|
+
* @scope/name, 1.2.4 -> name-1.2.4.tgz
|
|
35
|
+
* @param name package name
|
|
36
|
+
* @param version package version
|
|
37
|
+
* @returns tarball filename
|
|
38
|
+
*/
|
|
43
39
|
function composeTarballFromPackage(name, version) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} else {
|
|
47
|
-
return `${name}-${version}.tgz`;
|
|
48
|
-
}
|
|
40
|
+
if (name.includes("/")) return `${name.split("/")[1]}-${version}.tgz`;
|
|
41
|
+
else return `${name}-${version}.tgz`;
|
|
49
42
|
}
|
|
43
|
+
//#endregion
|
|
44
|
+
Object.defineProperty(exports, "tarball_utils_exports", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function() {
|
|
47
|
+
return tarball_utils_exports;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
50
51
|
//# sourceMappingURL=tarball-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tarball-utils.js","names":[
|
|
1
|
+
{"version":3,"file":"tarball-utils.js","names":[],"sources":["../src/tarball-utils.ts"],"sourcesContent":["import { URL } from 'node:url';\n\n/**\n * Return package version from tarball name\n *\n * test-1.2.4.tgz -> 1.2.4\n * @param {String} fileName\n * @returns {String}\n */\nexport function getVersionFromTarball(fileName: string): string | void {\n const groups = fileName.replace(/\\.tgz$/, '').match(/^[^/]+-(\\d+\\.\\d+\\.\\d+.*)/);\n\n return groups !== null ? groups[1] : undefined;\n}\n\n/**\n * Extract the tarball name from a registry dist url\n *\n * https://registry.npmjs.org/test/-/test-0.0.2.tgz -> test-0.0.2.tgz\n * @param tarball tarball url\n * @returns tarball filename\n */\nexport function extractTarballFromUrl(url: string): string {\n const urlObject = new URL(url);\n return urlObject.pathname.replace(/^.*\\//, '');\n}\n\n/**\n * Build the tarball filename from paackage name and version\n *\n * test, 1.2.4 -> test-1.2.4.tgz\n * @scope/name, 1.2.4 -> name-1.2.4.tgz\n * @param name package name\n * @param version package version\n * @returns tarball filename\n */\nexport function composeTarballFromPackage(name: string, version: string): string {\n if (name.includes('/')) {\n return `${name.split('/')[1]}-${version}.tgz`;\n } else {\n return `${name}-${version}.tgz`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AASA,SAAgB,sBAAsB,UAAiC;CACrE,MAAM,SAAS,SAAS,QAAQ,UAAU,EAAE,EAAE,MAAM,0BAA0B;CAE9E,OAAO,WAAW,OAAO,OAAO,KAAK,KAAA;AACvC;;;;;;;;AASA,SAAgB,sBAAsB,KAAqB;CAEzD,OAAO,IADe,SAAA,IAAI,GACnB,EAAU,SAAS,QAAQ,SAAS,EAAE;AAC/C;;;;;;;;;;AAWA,SAAgB,0BAA0B,MAAc,SAAyB;CAC/E,IAAI,KAAK,SAAS,GAAG,GACnB,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,GAAG,GAAG,QAAQ;MAExC,OAAO,GAAG,KAAK,GAAG,QAAQ;AAE9B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { URL } from "node:url";
|
|
3
|
+
//#region src/tarball-utils.ts
|
|
4
|
+
var tarball_utils_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
composeTarballFromPackage: () => composeTarballFromPackage,
|
|
6
|
+
extractTarballFromUrl: () => extractTarballFromUrl,
|
|
7
|
+
getVersionFromTarball: () => getVersionFromTarball
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Return package version from tarball name
|
|
11
|
+
*
|
|
12
|
+
* test-1.2.4.tgz -> 1.2.4
|
|
13
|
+
* @param {String} fileName
|
|
14
|
+
* @returns {String}
|
|
15
|
+
*/
|
|
16
|
+
function getVersionFromTarball(fileName) {
|
|
17
|
+
const groups = fileName.replace(/\.tgz$/, "").match(/^[^/]+-(\d+\.\d+\.\d+.*)/);
|
|
18
|
+
return groups !== null ? groups[1] : void 0;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extract the tarball name from a registry dist url
|
|
22
|
+
*
|
|
23
|
+
* https://registry.npmjs.org/test/-/test-0.0.2.tgz -> test-0.0.2.tgz
|
|
24
|
+
* @param tarball tarball url
|
|
25
|
+
* @returns tarball filename
|
|
26
|
+
*/
|
|
27
|
+
function extractTarballFromUrl(url) {
|
|
28
|
+
return new URL(url).pathname.replace(/^.*\//, "");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Build the tarball filename from paackage name and version
|
|
32
|
+
*
|
|
33
|
+
* test, 1.2.4 -> test-1.2.4.tgz
|
|
34
|
+
* @scope/name, 1.2.4 -> name-1.2.4.tgz
|
|
35
|
+
* @param name package name
|
|
36
|
+
* @param version package version
|
|
37
|
+
* @returns tarball filename
|
|
38
|
+
*/
|
|
39
|
+
function composeTarballFromPackage(name, version) {
|
|
40
|
+
if (name.includes("/")) return `${name.split("/")[1]}-${version}.tgz`;
|
|
41
|
+
else return `${name}-${version}.tgz`;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { tarball_utils_exports };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=tarball-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tarball-utils.mjs","names":[],"sources":["../src/tarball-utils.ts"],"sourcesContent":["import { URL } from 'node:url';\n\n/**\n * Return package version from tarball name\n *\n * test-1.2.4.tgz -> 1.2.4\n * @param {String} fileName\n * @returns {String}\n */\nexport function getVersionFromTarball(fileName: string): string | void {\n const groups = fileName.replace(/\\.tgz$/, '').match(/^[^/]+-(\\d+\\.\\d+\\.\\d+.*)/);\n\n return groups !== null ? groups[1] : undefined;\n}\n\n/**\n * Extract the tarball name from a registry dist url\n *\n * https://registry.npmjs.org/test/-/test-0.0.2.tgz -> test-0.0.2.tgz\n * @param tarball tarball url\n * @returns tarball filename\n */\nexport function extractTarballFromUrl(url: string): string {\n const urlObject = new URL(url);\n return urlObject.pathname.replace(/^.*\\//, '');\n}\n\n/**\n * Build the tarball filename from paackage name and version\n *\n * test, 1.2.4 -> test-1.2.4.tgz\n * @scope/name, 1.2.4 -> name-1.2.4.tgz\n * @param name package name\n * @param version package version\n * @returns tarball filename\n */\nexport function composeTarballFromPackage(name: string, version: string): string {\n if (name.includes('/')) {\n return `${name.split('/')[1]}-${version}.tgz`;\n } else {\n return `${name}-${version}.tgz`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AASA,SAAgB,sBAAsB,UAAiC;CACrE,MAAM,SAAS,SAAS,QAAQ,UAAU,EAAE,EAAE,MAAM,0BAA0B;CAE9E,OAAO,WAAW,OAAO,OAAO,KAAK,KAAA;AACvC;;;;;;;;AASA,SAAgB,sBAAsB,KAAqB;CAEzD,OAAO,IADe,IAAI,GACnB,EAAU,SAAS,QAAQ,SAAS,EAAE;AAC/C;;;;;;;;;;AAWA,SAAgB,0BAA0B,MAAc,SAAyB;CAC/E,IAAI,KAAK,SAAS,GAAG,GACnB,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,GAAG,GAAG,QAAQ;MAExC,OAAO,GAAG,KAAK,GAAG,QAAQ;AAE9B"}
|
|
@@ -1,131 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, "validateUnPublishSingleVersion", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _unpublishManifest.validateUnPublishSingleVersion;
|
|
22
|
-
}
|
|
1
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_constants = require("./constants.js");
|
|
3
|
+
const require_publish_manifest = require("./schemes/publish-manifest.js");
|
|
4
|
+
const require_unpublish_manifest = require("./schemes/unpublish-manifest.js");
|
|
5
|
+
let node_assert = require("node:assert");
|
|
6
|
+
node_assert = require_runtime.__toESM(node_assert);
|
|
7
|
+
//#region src/validation-utils.ts
|
|
8
|
+
var validation_utils_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
9
|
+
isObject: () => isObject,
|
|
10
|
+
isPackageNameScoped: () => isPackageNameScoped,
|
|
11
|
+
normalizeMetadata: () => normalizeMetadata,
|
|
12
|
+
validateName: () => validateName,
|
|
13
|
+
validatePackage: () => validatePackage,
|
|
14
|
+
validatePassword: () => validatePassword,
|
|
15
|
+
validatePublishSingleVersion: () => require_publish_manifest.validatePublishSingleVersion,
|
|
16
|
+
validateUnPublishSingleVersion: () => require_unpublish_manifest.validateUnPublishSingleVersion,
|
|
17
|
+
validateUserName: () => validateUserName
|
|
23
18
|
});
|
|
24
|
-
exports.validateUserName = validateUserName;
|
|
25
|
-
var _nodeAssert = _interopRequireDefault(require("node:assert"));
|
|
26
|
-
var _constants = require("./constants");
|
|
27
|
-
var _publishManifest = require("./schemes/publish-manifest");
|
|
28
|
-
var _unpublishManifest = require("./schemes/unpublish-manifest");
|
|
29
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
19
|
function isPackageNameScoped(name) {
|
|
31
|
-
|
|
20
|
+
return name.startsWith("@");
|
|
32
21
|
}
|
|
33
|
-
|
|
34
22
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
* From normalize-package-data/lib/fixer.js
|
|
24
|
+
* @param {*} name the package name
|
|
25
|
+
* @return {Boolean} whether is valid or not
|
|
26
|
+
*/
|
|
39
27
|
function validateName(name) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return !(!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) || normalizedName.startsWith('.') ||
|
|
62
|
-
// ".bin", etc.
|
|
63
|
-
['node_modules', '__proto__', 'favicon.ico'].includes(normalizedName));
|
|
28
|
+
if (typeof name !== "string") return false;
|
|
29
|
+
let normalizedName = name.toLowerCase();
|
|
30
|
+
const isScoped = isPackageNameScoped(name);
|
|
31
|
+
const scopedName = name.split("/", 2)[1];
|
|
32
|
+
if (isScoped && typeof scopedName !== "undefined") normalizedName = scopedName.toLowerCase();
|
|
33
|
+
/**
|
|
34
|
+
* Some context about the first regex
|
|
35
|
+
* - npm used to have a different tarball naming system.
|
|
36
|
+
* eg: http://registry.npmjs.com/thirty-two
|
|
37
|
+
* https://registry.npmjs.org/thirty-two/-/thirty-two@0.0.1.tgz
|
|
38
|
+
* The file name thirty-two@0.0.1.tgz, the version and the pkg name was separated by an at (@)
|
|
39
|
+
* while nowadays the naming system is based in dashes
|
|
40
|
+
* https://registry.npmjs.org/verdaccio/-/verdaccio-1.4.0.tgz
|
|
41
|
+
*
|
|
42
|
+
* more info here: https://github.com/rlidwka/sinopia/issues/75
|
|
43
|
+
*/
|
|
44
|
+
return !(!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) || normalizedName.startsWith(".") || [
|
|
45
|
+
"node_modules",
|
|
46
|
+
"__proto__",
|
|
47
|
+
"favicon.ico"
|
|
48
|
+
].includes(normalizedName));
|
|
64
49
|
}
|
|
65
|
-
|
|
66
50
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
* Validate a package.
|
|
52
|
+
* @return {Boolean} whether the package is valid or not
|
|
53
|
+
*/
|
|
70
54
|
function validatePackage(name) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return validateName(nameList[0]);
|
|
75
|
-
}
|
|
76
|
-
// scoped package
|
|
77
|
-
return nameList[0][0] === '@' && validateName(nameList[0].slice(1)) && validateName(nameList[1]);
|
|
55
|
+
const nameList = name.split("/", 2);
|
|
56
|
+
if (nameList.length === 1) return validateName(nameList[0]);
|
|
57
|
+
return nameList[0][0] === "@" && validateName(nameList[0].slice(1)) && validateName(nameList[1]);
|
|
78
58
|
}
|
|
79
|
-
|
|
80
59
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
60
|
+
* Validate the package metadata, add additional properties whether are missing within
|
|
61
|
+
* the metadata properties.
|
|
62
|
+
* @param {*} manifest
|
|
63
|
+
* @param {*} name
|
|
64
|
+
* @return {Object} the object with additional properties as dist-tags ad versions
|
|
65
|
+
*/
|
|
87
66
|
function normalizeMetadata(manifest, name) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!Array.isArray(manifest[_constants.MAINTAINERS])) {
|
|
96
|
-
_manifest[_constants.MAINTAINERS] = [];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// This may not be needed
|
|
100
|
-
if (!isObject(manifest['versions'])) {
|
|
101
|
-
_manifest['versions'] = {};
|
|
102
|
-
}
|
|
103
|
-
if (!isObject(manifest['time'])) {
|
|
104
|
-
_manifest['time'] = {};
|
|
105
|
-
}
|
|
106
|
-
return _manifest;
|
|
67
|
+
node_assert.default.strictEqual(manifest.name, name);
|
|
68
|
+
const _manifest = { ...manifest };
|
|
69
|
+
if (!isObject(manifest["dist-tags"])) _manifest[require_constants.DIST_TAGS] = {};
|
|
70
|
+
if (!Array.isArray(manifest["maintainers"])) _manifest[require_constants.MAINTAINERS] = [];
|
|
71
|
+
if (!isObject(manifest["versions"])) _manifest["versions"] = {};
|
|
72
|
+
if (!isObject(manifest["time"])) _manifest["time"] = {};
|
|
73
|
+
return _manifest;
|
|
107
74
|
}
|
|
108
|
-
|
|
109
75
|
/**
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
76
|
+
* Check whether an element is an Object
|
|
77
|
+
* @param {*} obj the element
|
|
78
|
+
* @return {Boolean}
|
|
79
|
+
*/
|
|
114
80
|
function isObject(obj) {
|
|
115
|
-
|
|
116
|
-
// return false;
|
|
117
|
-
// }
|
|
118
|
-
|
|
119
|
-
// return (
|
|
120
|
-
// (typeof obj === 'object' || typeof obj.prototype === 'undefined') &&
|
|
121
|
-
// Array.isArray(obj) === false
|
|
122
|
-
// );
|
|
123
|
-
return Object.prototype.toString.call(obj) === '[object Object]';
|
|
81
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
124
82
|
}
|
|
125
|
-
function validatePassword(password, validation =
|
|
126
|
-
|
|
83
|
+
function validatePassword(password, validation = require_constants.DEFAULT_PASSWORD_VALIDATION) {
|
|
84
|
+
return typeof password === "string" && validation instanceof RegExp ? password.match(validation) !== null : false;
|
|
127
85
|
}
|
|
128
86
|
function validateUserName(userName, expectedName) {
|
|
129
|
-
|
|
87
|
+
return typeof userName === "string" && userName.split(":")[0] === "org.couchdb.user" && userName.split(":")[1] === expectedName;
|
|
130
88
|
}
|
|
89
|
+
//#endregion
|
|
90
|
+
Object.defineProperty(exports, "validation_utils_exports", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function() {
|
|
93
|
+
return validation_utils_exports;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
131
97
|
//# sourceMappingURL=validation-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-utils.js","names":[
|
|
1
|
+
{"version":3,"file":"validation-utils.js","names":[],"sources":["../src/validation-utils.ts"],"sourcesContent":["import assert from 'node:assert';\n\nimport type { Manifest } from '@verdaccio/types';\n\nimport { DEFAULT_PASSWORD_VALIDATION, DIST_TAGS, MAINTAINERS } from './constants';\n\nexport { validatePublishSingleVersion } from './schemes/publish-manifest';\nexport { validateUnPublishSingleVersion } from './schemes/unpublish-manifest';\n\nexport function isPackageNameScoped(name: string): boolean {\n return name.startsWith('@');\n}\n\n/**\n * From normalize-package-data/lib/fixer.js\n * @param {*} name the package name\n * @return {Boolean} whether is valid or not\n */\nexport function validateName(name: string): boolean {\n if (typeof name !== 'string') {\n return false;\n }\n\n let normalizedName: string = name.toLowerCase();\n\n const isScoped: boolean = isPackageNameScoped(name);\n const scopedName = name.split('/', 2)[1];\n\n if (isScoped && typeof scopedName !== 'undefined') {\n normalizedName = scopedName.toLowerCase();\n }\n\n /**\n * Some context about the first regex\n * - npm used to have a different tarball naming system.\n * eg: http://registry.npmjs.com/thirty-two\n * https://registry.npmjs.org/thirty-two/-/thirty-two@0.0.1.tgz\n * The file name thirty-two@0.0.1.tgz, the version and the pkg name was separated by an at (@)\n * while nowadays the naming system is based in dashes\n * https://registry.npmjs.org/verdaccio/-/verdaccio-1.4.0.tgz\n *\n * more info here: https://github.com/rlidwka/sinopia/issues/75\n */\n return !(\n !normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) ||\n normalizedName.startsWith('.') || // \".bin\", etc.\n ['node_modules', '__proto__', 'favicon.ico'].includes(normalizedName)\n );\n}\n\n/**\n * Validate a package.\n * @return {Boolean} whether the package is valid or not\n */\nexport function validatePackage(name: string): boolean {\n const nameList = name.split('/', 2);\n if (nameList.length === 1) {\n // normal package\n return validateName(nameList[0]);\n }\n // scoped package\n return nameList[0][0] === '@' && validateName(nameList[0].slice(1)) && validateName(nameList[1]);\n}\n\n/**\n * Validate the package metadata, add additional properties whether are missing within\n * the metadata properties.\n * @param {*} manifest\n * @param {*} name\n * @return {Object} the object with additional properties as dist-tags ad versions\n */\nexport function normalizeMetadata(manifest: Manifest, name: string): Manifest {\n assert.strictEqual(manifest.name, name);\n const _manifest = { ...manifest };\n\n if (!isObject(manifest[DIST_TAGS])) {\n _manifest[DIST_TAGS] = {};\n }\n\n if (!Array.isArray(manifest[MAINTAINERS])) {\n _manifest[MAINTAINERS] = [];\n }\n\n // This may not be needed\n if (!isObject(manifest['versions'])) {\n _manifest['versions'] = {};\n }\n\n if (!isObject(manifest['time'])) {\n _manifest['time'] = {};\n }\n\n return _manifest;\n}\n\n/**\n * Check whether an element is an Object\n * @param {*} obj the element\n * @return {Boolean}\n */\nexport function isObject(obj: any): boolean {\n // if (obj === null || typeof obj === 'undefined' || typeof obj === 'string') {\n // return false;\n // }\n\n // return (\n // (typeof obj === 'object' || typeof obj.prototype === 'undefined') &&\n // Array.isArray(obj) === false\n // );\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\nexport function validatePassword(\n password: string,\n validation: RegExp = DEFAULT_PASSWORD_VALIDATION\n): boolean {\n return typeof password === 'string' && validation instanceof RegExp\n ? password.match(validation) !== null\n : false;\n}\n\nexport function validateUserName(userName: any, expectedName: string): boolean {\n return (\n typeof userName === 'string' &&\n userName.split(':')[0] === 'org.couchdb.user' &&\n userName.split(':')[1] === expectedName\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AASA,SAAgB,oBAAoB,MAAuB;CACzD,OAAO,KAAK,WAAW,GAAG;AAC5B;;;;;;AAOA,SAAgB,aAAa,MAAuB;CAClD,IAAI,OAAO,SAAS,UAClB,OAAO;CAGT,IAAI,iBAAyB,KAAK,YAAY;CAE9C,MAAM,WAAoB,oBAAoB,IAAI;CAClD,MAAM,aAAa,KAAK,MAAM,KAAK,CAAC,EAAE;CAEtC,IAAI,YAAY,OAAO,eAAe,aACpC,iBAAiB,WAAW,YAAY;;;;;;;;;;;;CAc1C,OAAO,EACL,CAAC,eAAe,MAAM,0BAA0B,KAChD,eAAe,WAAW,GAAG,KAC7B;EAAC;EAAgB;EAAa;CAAa,EAAE,SAAS,cAAc;AAExE;;;;;AAMA,SAAgB,gBAAgB,MAAuB;CACrD,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;CAClC,IAAI,SAAS,WAAW,GAEtB,OAAO,aAAa,SAAS,EAAE;CAGjC,OAAO,SAAS,GAAG,OAAO,OAAO,aAAa,SAAS,GAAG,MAAM,CAAC,CAAC,KAAK,aAAa,SAAS,EAAE;AACjG;;;;;;;;AASA,SAAgB,kBAAkB,UAAoB,MAAwB;CAC5E,YAAA,QAAO,YAAY,SAAS,MAAM,IAAI;CACtC,MAAM,YAAY,EAAE,GAAG,SAAS;CAEhC,IAAI,CAAC,SAAS,SAAA,YAAmB,GAC/B,UAAU,kBAAA,aAAa,CAAC;CAG1B,IAAI,CAAC,MAAM,QAAQ,SAAA,cAAqB,GACtC,UAAU,kBAAA,eAAe,CAAC;CAI5B,IAAI,CAAC,SAAS,SAAS,WAAW,GAChC,UAAU,cAAc,CAAC;CAG3B,IAAI,CAAC,SAAS,SAAS,OAAO,GAC5B,UAAU,UAAU,CAAC;CAGvB,OAAO;AACT;;;;;;AAOA,SAAgB,SAAS,KAAmB;CAS1C,OAAO,OAAO,UAAU,SAAS,KAAK,GAAG,MAAM;AACjD;AAEA,SAAgB,iBACd,UACA,aAAqB,kBAAA,6BACZ;CACT,OAAO,OAAO,aAAa,YAAY,sBAAsB,SACzD,SAAS,MAAM,UAAU,MAAM,OAC/B;AACN;AAEA,SAAgB,iBAAiB,UAAe,cAA+B;CAC7E,OACE,OAAO,aAAa,YACpB,SAAS,MAAM,GAAG,EAAE,OAAO,sBAC3B,SAAS,MAAM,GAAG,EAAE,OAAO;AAE/B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { __exportAll } from "./_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { DEFAULT_PASSWORD_VALIDATION, DIST_TAGS, MAINTAINERS } from "./constants.mjs";
|
|
3
|
+
import { validatePublishSingleVersion } from "./schemes/publish-manifest.mjs";
|
|
4
|
+
import { validateUnPublishSingleVersion } from "./schemes/unpublish-manifest.mjs";
|
|
5
|
+
import assert from "node:assert";
|
|
6
|
+
//#region src/validation-utils.ts
|
|
7
|
+
var validation_utils_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
isObject: () => isObject,
|
|
9
|
+
isPackageNameScoped: () => isPackageNameScoped,
|
|
10
|
+
normalizeMetadata: () => normalizeMetadata,
|
|
11
|
+
validateName: () => validateName,
|
|
12
|
+
validatePackage: () => validatePackage,
|
|
13
|
+
validatePassword: () => validatePassword,
|
|
14
|
+
validatePublishSingleVersion: () => validatePublishSingleVersion,
|
|
15
|
+
validateUnPublishSingleVersion: () => validateUnPublishSingleVersion,
|
|
16
|
+
validateUserName: () => validateUserName
|
|
17
|
+
});
|
|
18
|
+
function isPackageNameScoped(name) {
|
|
19
|
+
return name.startsWith("@");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* From normalize-package-data/lib/fixer.js
|
|
23
|
+
* @param {*} name the package name
|
|
24
|
+
* @return {Boolean} whether is valid or not
|
|
25
|
+
*/
|
|
26
|
+
function validateName(name) {
|
|
27
|
+
if (typeof name !== "string") return false;
|
|
28
|
+
let normalizedName = name.toLowerCase();
|
|
29
|
+
const isScoped = isPackageNameScoped(name);
|
|
30
|
+
const scopedName = name.split("/", 2)[1];
|
|
31
|
+
if (isScoped && typeof scopedName !== "undefined") normalizedName = scopedName.toLowerCase();
|
|
32
|
+
/**
|
|
33
|
+
* Some context about the first regex
|
|
34
|
+
* - npm used to have a different tarball naming system.
|
|
35
|
+
* eg: http://registry.npmjs.com/thirty-two
|
|
36
|
+
* https://registry.npmjs.org/thirty-two/-/thirty-two@0.0.1.tgz
|
|
37
|
+
* The file name thirty-two@0.0.1.tgz, the version and the pkg name was separated by an at (@)
|
|
38
|
+
* while nowadays the naming system is based in dashes
|
|
39
|
+
* https://registry.npmjs.org/verdaccio/-/verdaccio-1.4.0.tgz
|
|
40
|
+
*
|
|
41
|
+
* more info here: https://github.com/rlidwka/sinopia/issues/75
|
|
42
|
+
*/
|
|
43
|
+
return !(!normalizedName.match(/^[-a-zA-Z0-9_.!~*'()@]+$/) || normalizedName.startsWith(".") || [
|
|
44
|
+
"node_modules",
|
|
45
|
+
"__proto__",
|
|
46
|
+
"favicon.ico"
|
|
47
|
+
].includes(normalizedName));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Validate a package.
|
|
51
|
+
* @return {Boolean} whether the package is valid or not
|
|
52
|
+
*/
|
|
53
|
+
function validatePackage(name) {
|
|
54
|
+
const nameList = name.split("/", 2);
|
|
55
|
+
if (nameList.length === 1) return validateName(nameList[0]);
|
|
56
|
+
return nameList[0][0] === "@" && validateName(nameList[0].slice(1)) && validateName(nameList[1]);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Validate the package metadata, add additional properties whether are missing within
|
|
60
|
+
* the metadata properties.
|
|
61
|
+
* @param {*} manifest
|
|
62
|
+
* @param {*} name
|
|
63
|
+
* @return {Object} the object with additional properties as dist-tags ad versions
|
|
64
|
+
*/
|
|
65
|
+
function normalizeMetadata(manifest, name) {
|
|
66
|
+
assert.strictEqual(manifest.name, name);
|
|
67
|
+
const _manifest = { ...manifest };
|
|
68
|
+
if (!isObject(manifest["dist-tags"])) _manifest[DIST_TAGS] = {};
|
|
69
|
+
if (!Array.isArray(manifest["maintainers"])) _manifest[MAINTAINERS] = [];
|
|
70
|
+
if (!isObject(manifest["versions"])) _manifest["versions"] = {};
|
|
71
|
+
if (!isObject(manifest["time"])) _manifest["time"] = {};
|
|
72
|
+
return _manifest;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check whether an element is an Object
|
|
76
|
+
* @param {*} obj the element
|
|
77
|
+
* @return {Boolean}
|
|
78
|
+
*/
|
|
79
|
+
function isObject(obj) {
|
|
80
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
81
|
+
}
|
|
82
|
+
function validatePassword(password, validation = DEFAULT_PASSWORD_VALIDATION) {
|
|
83
|
+
return typeof password === "string" && validation instanceof RegExp ? password.match(validation) !== null : false;
|
|
84
|
+
}
|
|
85
|
+
function validateUserName(userName, expectedName) {
|
|
86
|
+
return typeof userName === "string" && userName.split(":")[0] === "org.couchdb.user" && userName.split(":")[1] === expectedName;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { validation_utils_exports };
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=validation-utils.mjs.map
|