@contentrain/wp-import 0.9.0 → 0.9.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.mjs +10 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1060,6 +1060,15 @@ const valid = (f) => ({
|
|
|
1060
1060
|
...typeof f?.flag_case === "boolean" ? { flag_case: f.flag_case } : {},
|
|
1061
1061
|
...typeof f?.flag_trailing === "boolean" ? { flag_trailing: f.flag_trailing } : {}
|
|
1062
1062
|
});
|
|
1063
|
+
/** A login rule's two addresses, and nothing else its data may hold. */
|
|
1064
|
+
const loginCondition = (data) => {
|
|
1065
|
+
if (!data || typeof data !== "object") return null;
|
|
1066
|
+
const d = data;
|
|
1067
|
+
return {
|
|
1068
|
+
logged_in: typeof d.logged_in === "string" ? d.logged_in : "",
|
|
1069
|
+
logged_out: typeof d.logged_out === "string" ? d.logged_out : ""
|
|
1070
|
+
};
|
|
1071
|
+
};
|
|
1063
1072
|
/** By id as bytes, as the Bridge sorts (`strcmp`). */
|
|
1064
1073
|
const order = (a, b) => (a.id ?? "") < (b.id ?? "") ? -1 : (a.id ?? "") > (b.id ?? "") ? 1 : 0;
|
|
1065
1074
|
const on = (x) => x.enabled ?? (x.status === void 0 || x.status === "enabled");
|
|
@@ -1130,7 +1139,7 @@ function redirectionRules(items, groups, origin, options) {
|
|
|
1130
1139
|
...rule,
|
|
1131
1140
|
match: matchType,
|
|
1132
1141
|
status: code,
|
|
1133
|
-
...matchType === "login" ? { condition: data
|
|
1142
|
+
...matchType === "login" ? { condition: loginCondition(data) } : {},
|
|
1134
1143
|
reason: `conditional-match:${matchType}`
|
|
1135
1144
|
});
|
|
1136
1145
|
else {
|