Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

skava / chain-able-lego   js

Repository URL to install this package:

Version: 6.0.4 

/ src / getAtSymbol.ts

// aka invoke
function getAtSymbol<Value extends {} = any>(
  symbolToGet: symbol,
  value: Value
) {
  let atSymbol = value[symbolToGet]

  // @NOTE not sure if we really need this
  if (typeof atSymbol === 'function') {
    atSymbol = atSymbol()
  }
  if (typeof atSymbol === 'string') {
    return atSymbol
  }

  return undefined
}

export { getAtSymbol }
export default getAtSymbol