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

Function asStringPropertyName

ses.cjs:3976–3997  ·  view source on GitHub ↗

* asStringPropertyName() * * @param {string} path * @param {string | symbol} prop

(path, prop)

Source from the content-addressed store, hash-verified

3974 * @param {string | symbol} prop
3975 */
3976 function asStringPropertyName(path, prop) {
3977 if( typeof prop=== 'string') {
3978 return prop;
3979 }
3980
3981 const wellKnownSymbol= mapGet(wellKnownSymbolNames, prop);
3982
3983 if( typeof prop=== 'symbol') {
3984 if( wellKnownSymbol) {
3985 return wellKnownSymbol;
3986 }else {
3987 const registeredKey= symbolKeyFor(prop);
3988 if( registeredKey!== undefined) {
3989 return `RegisteredSymbol(${registeredKey})`;
3990 }else {
3991 return `Unique${String(prop)}`;
3992 }
3993 }
3994 }
3995
3996 throw TypeError( `Unexpected property name type ${path} ${prop}`);
3997 }
3998
3999 /*
4000 * visitPrototype()

Callers 1

visitPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected