src/index.js
function guessFontWeight(basename) {
  return basename
    .split('-')
    .slice(1)
    .map(item => item.toLowerCase())
    .reduce((prev, item) => {
      if (item === 'normal') {
        return prev
      }

      if (fontWeightNames[item]) {
        return `font-weight:${fontWeightNames[item]};`
      }

      if (fontWeightKeywords.indexOf(item) >= 0) {
        return `font-weight:${item};`
      }

      return prev
    }, '')
}
function guessFontWeight(basename) {
  return basename
    .split('-')
    .slice(1)
    .map(item => item.toLowerCase())
    .reduce((prev, item) => {
      if (item === 'normal') {
        return prev
      }

      if (fontWeightNames[item]) {
        return `font-weight:${fontWeightNames[item]};`
      }

      if (fontWeightKeywords.indexOf(item) >= 0) {
        return `font-weight:${item};`
      }

      return prev
    }, '')
}
function guessFontWeight ( basename ) { return basename . split ( '-' ) . slice ( 1 ) . map ( item => item . toLowerCase ( ) ) . reduce ( ( prev , item ) => { if ( item === 'normal' ) { return prev } if ( fontWeightNames [ item ] ) { return ` ${ fontWeightNames [ item ] } ` } if ( fontWeightKeywords . indexOf ( item ) >= 0 ) { return ` ${ item } ` } return prev } , '' ) }
Guess the `font-weight` property from the font file name.
@param  {String} basename Font base filename.
@return {String}          `font-weight` property and guessed value.
Guess the font - weight property from the font file name .