index.js
function lookup(locale, format, obj) {
  if (!locale) throw new Error('missing required "locale" parameter');
  locale = locale.toLowerCase().replace('-', '_');
  format = format || 'cardinal';
  var p = obj[format];
  if (!p) throw new Error('unsupported format "' + format + '"');
  var fn = p[locale] || p[locale.split('_')[0]];
  if (fn) return fn;

  throw new Error('unsupported locale "' + locale + '"');
}
function lookup(locale, format, obj) {
  if (!locale) throw new Error('missing required "locale" parameter');
  locale = locale.toLowerCase().replace('-', '_');
  format = format || 'cardinal';
  var p = obj[format];
  if (!p) throw new Error('unsupported format "' + format + '"');
  var fn = p[locale] || p[locale.split('_')[0]];
  if (fn) return fn;

  throw new Error('unsupported locale "' + locale + '"');
}
function lookup ( locale , format , obj ) { if ( ! locale ) throw new Error ( 'missing required "locale" parameter' ) ; locale = locale . toLowerCase ( ) . replace ( '-' , '_' ) ; format = format || 'cardinal' ; var p = obj [ format ] ; if ( ! p ) throw new Error ( 'unsupported format "' + format + '"' ) ; var fn = p [ locale ] || p [ locale . split ( '_' ) [ 0 ] ] ; if ( fn ) return fn ; throw new Error ( 'unsupported locale "' + locale + '"' ) ; }
Lookup the plural function given a locale

@param {String} locale
@param {String} format
@return {Function}
Lookup the plural function given a locale