deduplicate task parsing and masking helpers
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
import { resolveCloudtentaclesConfig } from "../../platforms/cloudtentacles/shared.js";
|
||||
import {
|
||||
maskCode as maskCodeValue,
|
||||
maskPhone as maskPhoneValue,
|
||||
} from "../../../utils/masking.js";
|
||||
|
||||
export const KUAISHOU_CLOUD_FIXED_VN_KEY = "1";
|
||||
|
||||
@@ -154,29 +158,11 @@ export function normalizeKuaishouCloudRoleInfo(value) {
|
||||
}
|
||||
|
||||
export function maskPhone(value) {
|
||||
const text = String(value || "").trim();
|
||||
if (!text) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (text.length <= 7) {
|
||||
return `${text.slice(0, 2)}***${text.slice(-2)}`;
|
||||
}
|
||||
|
||||
return `${text.slice(0, 3)}****${text.slice(-4)}`;
|
||||
return maskPhoneValue(value);
|
||||
}
|
||||
|
||||
export function maskCode(value) {
|
||||
const text = String(value || "").trim();
|
||||
if (!text) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (text.length <= 8) {
|
||||
return `${text.slice(0, 2)}***${text.slice(-2)}`;
|
||||
}
|
||||
|
||||
return `${text.slice(0, 4)}****${text.slice(-4)}`;
|
||||
return maskCodeValue(value);
|
||||
}
|
||||
|
||||
export function resolveKuaishouCloudBindUrlExpiresAt(preparedAt) {
|
||||
|
||||
Reference in New Issue
Block a user