- var l;
-
- // Allow calling with a url or single dependency as a string
- if ( typeof modules === 'string' ) {
- // "https://example.org/x.js", "http://example.org/x.js", "//example.org/x.js", "/x.js"
- if ( /^(https?:)?\/?\//.test( modules ) ) {
- if ( type === 'text/css' ) {
- l = document.createElement( 'link' );
- l.rel = 'stylesheet';
- l.href = modules;
- document.head.appendChild( l );
- return;
- }
- if ( type === 'text/javascript' || type === undefined ) {
- addScript( modules );
- return;
- }
+ if ( typeof modules === 'string' && /^(https?:)?\/?\//.test( modules ) ) {
+ // Called with a url like so:
+ // - "https://example.org/x.js"
+ // - "http://example.org/x.js"
+ // - "//example.org/x.js"
+ // - "/x.js"
+ if ( type === 'text/css' ) {
+ addLink( modules );
+ } else if ( type === 'text/javascript' || type === undefined ) {
+ addScript( modules );
+ } else {