lib/signature.js
function parse (strip, associate) {
  var signature = strip.split('->')
  if (signature.length !== 2) return null

  // Param types:
  var params = signature[0].split(',')
  for (var i = params.length; i--;) {
    var p = params[i].trim()
    if (p === '*') params[i] = null
    else params[i] = p
  }

  // Return type:
  var returns = signature[1].trim()
  if (returns === '*') returns = null

  return associate
    ? [params, returns, associate]
    : [params, returns]
}
function parse (strip, associate) {
  var signature = strip.split('->')
  if (signature.length !== 2) return null

  // Param types:
  var params = signature[0].split(',')
  for (var i = params.length; i--;) {
    var p = params[i].trim()
    if (p === '*') params[i] = null
    else params[i] = p
  }

  // Return type:
  var returns = signature[1].trim()
  if (returns === '*') returns = null

  return associate
    ? [params, returns, associate]
    : [params, returns]
}
function parse ( strip , associate ) { var signature = strip . split ( '->' ) if ( signature . length !== 2 ) return null // Param types: var params = signature [ 0 ] . split ( ',' ) for ( var i = params . length ; i -- ; ) { var p = params [ i ] . trim ( ) if ( p === '*' ) params [ i ] = null else params [ i ] = p } // Return type: var returns = signature [ 1 ] . trim ( ) if ( returns === '*' ) returns = null return associate ? [ params , returns , associate ] : [ params , returns ] }
exports.parse = parse exports.generate = generate Parse a signature strip into a signature object
exports . parse = parse exports . generate = generate Parse a signature strip into a signature object