vcf.js
function maybeMapOverVal(fn, val) {
  var vals = val.split(',');
  if (vals.length > 1) {
    return vals.map(function(v) { return v == '.' ? null : fn(v); });
  }
  return val == '.' ? null : fn(val);
}
function maybeMapOverVal(fn, val) {
  var vals = val.split(',');
  if (vals.length > 1) {
    return vals.map(function(v) { return v == '.' ? null : fn(v); });
  }
  return val == '.' ? null : fn(val);
}
function maybeMapOverVal ( fn , val ) { var vals = val . split ( ',' ) ; if ( vals . length > 1 ) { return vals . map ( function ( v ) { return v == '.' ? null : fn ( v ) ; } ) ; } return val == '.' ? null : fn ( val ) ; }
VCF values can be comma-separated lists, so here we want to convert them into lists of the proper type, else return the singleton value of that type. All values are also nullable, signified with a '.', we want to watch out for those as well.
VCF values can be comma - separated lists so here we want to convert them into lists of the proper type else return the singleton value of that type . All values are also nullable signified with a . we want to watch out for those as well .