CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
getValueBySymbol.ts20 linesDownload Raw Back to utils
1/**2 * Returns the value behind the symbol with the given name.3 */4export function getValueBySymbol<T>(5  symbolName: string,6  source: object7): T | undefined {8  const ownSymbols = Object.getOwnPropertySymbols(source)9 10  const symbol = ownSymbols.find((symbol) => {11    return symbol.description === symbolName12  })13 14  if (symbol) {15    return Reflect.get(source, symbol)16  }17 18  return19}20 
basant307/AI_Governance_Project · CoolFace