@cmssy/core 11.3.1 → 11.3.2
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/index.cjs +9 -0
- package/dist/index.js +9 -0
- package/dist/internal.cjs +9 -0
- package/dist/internal.js +9 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16,11 +16,20 @@ function parseEditorOriginEnv(raw) {
|
|
|
16
16
|
function isDevelopment() {
|
|
17
17
|
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
18
18
|
}
|
|
19
|
+
function rejectWildcardOutsideDevelopment(value) {
|
|
20
|
+
const origins = Array.isArray(value) ? value : [value];
|
|
21
|
+
if (origins.includes("*") && !isDevelopment()) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
function resolveEditorOrigin(editorOrigin) {
|
|
20
28
|
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
21
29
|
if (value === void 0) {
|
|
22
30
|
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
23
31
|
}
|
|
32
|
+
rejectWildcardOutsideDevelopment(value);
|
|
24
33
|
if (Array.isArray(value)) {
|
|
25
34
|
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
26
35
|
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
package/dist/index.js
CHANGED
|
@@ -14,11 +14,20 @@ function parseEditorOriginEnv(raw) {
|
|
|
14
14
|
function isDevelopment() {
|
|
15
15
|
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
16
16
|
}
|
|
17
|
+
function rejectWildcardOutsideDevelopment(value) {
|
|
18
|
+
const origins = Array.isArray(value) ? value : [value];
|
|
19
|
+
if (origins.includes("*") && !isDevelopment()) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
17
25
|
function resolveEditorOrigin(editorOrigin) {
|
|
18
26
|
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
19
27
|
if (value === void 0) {
|
|
20
28
|
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
21
29
|
}
|
|
30
|
+
rejectWildcardOutsideDevelopment(value);
|
|
22
31
|
if (Array.isArray(value)) {
|
|
23
32
|
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
24
33
|
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
package/dist/internal.cjs
CHANGED
|
@@ -1068,11 +1068,20 @@ function parseEditorOriginEnv(raw) {
|
|
|
1068
1068
|
function isDevelopment() {
|
|
1069
1069
|
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
1070
1070
|
}
|
|
1071
|
+
function rejectWildcardOutsideDevelopment(value) {
|
|
1072
|
+
const origins = Array.isArray(value) ? value : [value];
|
|
1073
|
+
if (origins.includes("*") && !isDevelopment()) {
|
|
1074
|
+
throw new Error(
|
|
1075
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
1076
|
+
);
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1071
1079
|
function resolveEditorOrigin(editorOrigin) {
|
|
1072
1080
|
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
1073
1081
|
if (value === void 0) {
|
|
1074
1082
|
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
1075
1083
|
}
|
|
1084
|
+
rejectWildcardOutsideDevelopment(value);
|
|
1076
1085
|
if (Array.isArray(value)) {
|
|
1077
1086
|
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
1078
1087
|
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
package/dist/internal.js
CHANGED
|
@@ -1066,11 +1066,20 @@ function parseEditorOriginEnv(raw) {
|
|
|
1066
1066
|
function isDevelopment() {
|
|
1067
1067
|
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
1068
1068
|
}
|
|
1069
|
+
function rejectWildcardOutsideDevelopment(value) {
|
|
1070
|
+
const origins = Array.isArray(value) ? value : [value];
|
|
1071
|
+
if (origins.includes("*") && !isDevelopment()) {
|
|
1072
|
+
throw new Error(
|
|
1073
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
1074
|
+
);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1069
1077
|
function resolveEditorOrigin(editorOrigin) {
|
|
1070
1078
|
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
1071
1079
|
if (value === void 0) {
|
|
1072
1080
|
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
1073
1081
|
}
|
|
1082
|
+
rejectWildcardOutsideDevelopment(value);
|
|
1074
1083
|
if (Array.isArray(value)) {
|
|
1075
1084
|
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
1076
1085
|
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|