tasks/jsonld/js/jsonld.js
function _expandLanguageMap(languageMap) {
  var rval = [];
  var keys = Object.keys(languageMap).sort();
  for(var ki = 0; ki < keys.length; ++ki) {
    var key = keys[ki];
    var val = languageMap[key];
    if(!_isArray(val)) {
      val = [val];
    }
    for(var vi = 0; vi < val.length; ++vi) {
      var item = val[vi];
      if(!_isString(item)) {
        throw new JsonLdError(
          'Invalid JSON-LD syntax; language map values must be strings.',
          'jsonld.SyntaxError', {languageMap: languageMap});
      }
      rval.push({
        '@value': item,
        '@language': key.toLowerCase()
      });
    }
  }
  return rval;
}
function _expandLanguageMap(languageMap) {
  var rval = [];
  var keys = Object.keys(languageMap).sort();
  for(var ki = 0; ki < keys.length; ++ki) {
    var key = keys[ki];
    var val = languageMap[key];
    if(!_isArray(val)) {
      val = [val];
    }
    for(var vi = 0; vi < val.length; ++vi) {
      var item = val[vi];
      if(!_isString(item)) {
        throw new JsonLdError(
          'Invalid JSON-LD syntax; language map values must be strings.',
          'jsonld.SyntaxError', {languageMap: languageMap});
      }
      rval.push({
        '@value': item,
        '@language': key.toLowerCase()
      });
    }
  }
  return rval;
}
function _expandLanguageMap ( languageMap ) { var rval = [ ] ; var keys = Object . keys ( languageMap ) . sort ( ) ; for ( var ki = 0 ; ki < keys . length ; ++ ki ) { var key = keys [ ki ] ; var val = languageMap [ key ] ; if ( ! _isArray ( val ) ) { val = [ val ] ; } for ( var vi = 0 ; vi < val . length ; ++ vi ) { var item = val [ vi ] ; if ( ! _isString ( item ) ) { throw new JsonLdError ( 'Invalid JSON-LD syntax; language map values must be strings.' , 'jsonld.SyntaxError' , { languageMap : languageMap } ) ; } rval . push ( { '@value' : item , '@language' : key . toLowerCase ( ) } ) ; } } return rval ; }
Expands a language map.

@param languageMap the language map to expand.

@return the expanded language map.
Expands a language map .