MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / maskToken

Function maskToken

wxapp/aima.js:37–41  ·  view source on GitHub ↗
(token = "")

Source from the content-addressed store, hash-verified

35}
36
37function maskToken(token = "") {
38 if (!token) return "";
39 if (token.length <= 12) return `${token.slice(0, 3)}***`;
40 return `${token.slice(0, 6)}***${token.slice(-6)}`;
41}
42
43function isToken(value = "") {
44 return /^eyJ/.test(value.trim()) || value.length > 120;

Callers 2

loginByCodeFunction · 0.70
getAccessTokenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected