add sharing & copying instructions when asking contacts for help, and list all the visibleTo DIDs with an English description of their path

This commit is contained in:
2024-01-21 15:16:39 -07:00
parent dcfa8d9451
commit 1053b78ab8
6 changed files with 130 additions and 25 deletions

View File

@@ -174,21 +174,21 @@ export function isEmptyOrHiddenDid(did?: string) {
* Similar logic is found in endorser-mobile.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function testRecursivelyOnString(func: (arg0: any) => boolean, input: any) {
function testRecursivelyOnStrings(func: (arg0: any) => boolean, input: any) {
if (Object.prototype.toString.call(input) === "[object String]") {
return func(input);
} else if (input instanceof Object) {
if (!Array.isArray(input)) {
// it's an object
for (const key in input) {
if (testRecursivelyOnString(func, input[key])) {
if (testRecursivelyOnStrings(func, input[key])) {
return true;
}
}
} else {
// it's an array
for (const value of input) {
if (testRecursivelyOnString(func, value)) {
if (testRecursivelyOnStrings(func, value)) {
return true;
}
}
@@ -201,7 +201,7 @@ function testRecursivelyOnString(func: (arg0: any) => boolean, input: any) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function containsHiddenDid(obj: any) {
return testRecursivelyOnString(isHiddenDid, obj);
return testRecursivelyOnStrings(isHiddenDid, obj);
}
export function stripEndorserPrefix(claimId: string) {