MCPcopy Create free account
hub / github.com/github/docs / safeUrlDisplay

Function safeUrlDisplay

script/search/index-elasticsearch.js:197–206  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

195}
196
197function safeUrlDisplay(url) {
198 const parsed = new URL(url)
199 if (parsed.password) {
200 parsed.password = '***'
201 }
202 if (parsed.username) {
203 parsed.username = parsed.username.slice(0, 4) + '***'
204 }
205 return parsed.toString()
206}
207
208// Return '20220719012012' if the current date is
209// 2022-07-19T01:20:12.172Z. Note how the 6th month (July) becomes

Callers 2

mainFunction · 0.70
indexAllFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected