MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / getMessageString

Function getMessageString

ses.cjs:1545–1560  ·  view source on GitHub ↗
({ template, args})

Source from the content-addressed store, hash-verified

1543 * @returns {string}
1544 */
1545const getMessageString= ({ template, args})=> {
1546 const parts= [template[0]];
1547 for( let i= 0; i< args.length; i+= 1) {
1548 const arg= args[i];
1549 let argStr;
1550 if( weakmapHas(declassifiers, arg)) {
1551 argStr= `${arg}`;
1552 }else if( isError(arg)) {
1553 argStr= `(${an(arg.name)})`;
1554 }else {
1555 argStr= `(${an(typeof arg)})`;
1556 }
1557 arrayPush(parts, argStr, template[i+ 1]);
1558 }
1559 return arrayJoin(parts, '');
1560 };
1561
1562/**
1563 * Give detailsTokens a toString behavior. To minimize the overhead of

Callers 2

toStringFunction · 0.85
makeErrorFunction · 0.85

Calls 2

isErrorFunction · 0.85
anFunction · 0.85

Tested by

no test coverage detected