@scalar/nextjs-api-reference 0.8.18 → 0.8.20
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 +13 -0
- package/dist/index.cjs +6 -0
- package/dist/index.js +6 -0
- package/dist/index.umd.cjs +8 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -50,6 +50,9 @@ const getHtmlDocument = (givenConfiguration, customTheme2 = "") => {
|
|
|
50
50
|
</html>`;
|
|
51
51
|
return content;
|
|
52
52
|
};
|
|
53
|
+
const serializeArrayWithFunctions = (arr) => {
|
|
54
|
+
return `[${arr.map((item) => typeof item === "function" ? item.toString() : JSON.stringify(item)).join(", ")}]`;
|
|
55
|
+
};
|
|
53
56
|
function getScriptTags(configuration, cdn) {
|
|
54
57
|
const restConfig = { ...configuration };
|
|
55
58
|
const functionProps = [];
|
|
@@ -57,6 +60,9 @@ function getScriptTags(configuration, cdn) {
|
|
|
57
60
|
if (typeof value === "function") {
|
|
58
61
|
functionProps.push(`"${key}": ${value.toString()}`);
|
|
59
62
|
delete restConfig[key];
|
|
63
|
+
} else if (Array.isArray(value) && value.some((item) => typeof item === "function")) {
|
|
64
|
+
functionProps.push(`"${key}": ${serializeArrayWithFunctions(value)}`);
|
|
65
|
+
delete restConfig[key];
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
const configString = JSON.stringify(restConfig, null, 2).split("\n").map((line, index) => index === 0 ? line : " " + line).join("\n").replace(/\s*}$/, "");
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,9 @@ const getHtmlDocument = (givenConfiguration, customTheme2 = "") => {
|
|
|
48
48
|
</html>`;
|
|
49
49
|
return content;
|
|
50
50
|
};
|
|
51
|
+
const serializeArrayWithFunctions = (arr) => {
|
|
52
|
+
return `[${arr.map((item) => typeof item === "function" ? item.toString() : JSON.stringify(item)).join(", ")}]`;
|
|
53
|
+
};
|
|
51
54
|
function getScriptTags(configuration, cdn) {
|
|
52
55
|
const restConfig = { ...configuration };
|
|
53
56
|
const functionProps = [];
|
|
@@ -55,6 +58,9 @@ function getScriptTags(configuration, cdn) {
|
|
|
55
58
|
if (typeof value === "function") {
|
|
56
59
|
functionProps.push(`"${key}": ${value.toString()}`);
|
|
57
60
|
delete restConfig[key];
|
|
61
|
+
} else if (Array.isArray(value) && value.some((item) => typeof item === "function")) {
|
|
62
|
+
functionProps.push(`"${key}": ${serializeArrayWithFunctions(value)}`);
|
|
63
|
+
delete restConfig[key];
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
const configString = JSON.stringify(restConfig, null, 2).split("\n").map((line, index) => index === 0 ? line : " " + line).join("\n").replace(/\s*}$/, "");
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@scalar/nextjs-api-reference"] = {}));
|
|
3
|
-
})(this, function(exports2) {
|
|
3
|
+
})(this, (function(exports2) {
|
|
4
4
|
"use strict";
|
|
5
5
|
const addIndent = (str, spaces = 2, initialIndent = false) => {
|
|
6
6
|
const indent = " ".repeat(spaces);
|
|
@@ -52,6 +52,9 @@
|
|
|
52
52
|
</html>`;
|
|
53
53
|
return content;
|
|
54
54
|
};
|
|
55
|
+
const serializeArrayWithFunctions = (arr) => {
|
|
56
|
+
return `[${arr.map((item) => typeof item === "function" ? item.toString() : JSON.stringify(item)).join(", ")}]`;
|
|
57
|
+
};
|
|
55
58
|
function getScriptTags(configuration, cdn) {
|
|
56
59
|
const restConfig = { ...configuration };
|
|
57
60
|
const functionProps = [];
|
|
@@ -59,6 +62,9 @@
|
|
|
59
62
|
if (typeof value === "function") {
|
|
60
63
|
functionProps.push(`"${key}": ${value.toString()}`);
|
|
61
64
|
delete restConfig[key];
|
|
65
|
+
} else if (Array.isArray(value) && value.some((item) => typeof item === "function")) {
|
|
66
|
+
functionProps.push(`"${key}": ${serializeArrayWithFunctions(value)}`);
|
|
67
|
+
delete restConfig[key];
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
70
|
const configString = JSON.stringify(restConfig, null, 2).split("\n").map((line, index) => index === 0 ? line : " " + line).join("\n").replace(/\s*}$/, "");
|
|
@@ -227,4 +233,4 @@
|
|
|
227
233
|
};
|
|
228
234
|
exports2.ApiReference = ApiReference;
|
|
229
235
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
230
|
-
});
|
|
236
|
+
}));
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"openapi",
|
|
19
19
|
"swagger"
|
|
20
20
|
],
|
|
21
|
-
"version": "0.8.
|
|
21
|
+
"version": "0.8.20",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"module": "./dist/index.js",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@scalar/core": "0.3.
|
|
38
|
+
"@scalar/core": "0.3.17"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^22.9.0",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"next": "^15.4.7",
|
|
46
46
|
"react": "^19.1.0",
|
|
47
47
|
"react-dom": "^19.1.0",
|
|
48
|
-
"vite": "
|
|
48
|
+
"vite": "7.1.5",
|
|
49
49
|
"vite-plugin-dts": "^4.3.0",
|
|
50
|
-
"@scalar/api-reference": "1.35.
|
|
50
|
+
"@scalar/api-reference": "1.35.7"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"next": "^15.0.0",
|