function transform (opts) {
  var contents = opts.contents;
  var index = opts.index;

  var $ = cheerio.load(contents);
  $('link[href]').each(function () {
    var el$ = $(this);
    var href = el$.attr('href');
    var newHref = index.resolveLocalUrl(href);
    if (href && href !== newHref) {
      el$.attr({
        'data-appcache-href': href,
        href: newHref
      });
    }
  });
  return $.html();
}
function transform (opts) {
  var contents = opts.contents;
  var index = opts.index;

  var $ = cheerio.load(contents);
  $('link[href]').each(function () {
    var el$ = $(this);
    var href = el$.attr('href');
    var newHref = index.resolveLocalUrl(href);
    if (href && href !== newHref) {
      el$.attr({
        'data-appcache-href': href,
        href: newHref
      });
    }
  });
  return $.html();
}
function transform ( opts ) { var contents = opts . contents ; var index = opts . index ; var $ = cheerio . load ( contents ) ; $ ( 'link[href]' ) . each ( function ( ) { var el$ = $ ( this ) ; var href = el$ . attr ( 'href' ) ; var newHref = index . resolveLocalUrl ( href ) ; if ( href && href !== newHref ) { el$ . attr ( { 'data-appcache-href' : href , href : newHref } ) ; } } ) ; return $ . html ( ) ; }
/*
interface StringTransformOptions {
contents: String,
fetcher: Fetcher,
filePath: String,
index: FetcherIndex
}
 transform (opts: StringTransformOptions) => String
/ * interface StringTransformOptions { contents : String fetcher : Fetcher filePath : String index : FetcherIndex } transform ( opts : StringTransformOptions ) = > String