Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0119c17

Browse files
lifuzuRichard Lee
authored and
Richard Lee
committed
Replace url with the uri-js to support react native.
1 parent4657f08 commit0119c17

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

‎dist/oauth-signature.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>
2828
/*! url - v1.8.6 - 2013-11-22 */window.url=function(){functiona(a){return!isNaN(parseFloat(a))&&isFinite(a)}returnfunction(b,c){vard=c||window.location.toString();if(!b)returnd;b=b.toString(),"//"===d.substring(0,2)?d="http:"+d:1===d.split("://").length&&(d="http://"+d),c=d.split("/");vare={auth:""},f=c[2].split("@");1===f.length?f=f[0].split(":"):(e.auth=f[0],f=f[1].split(":")),e.protocol=c[0],e.hostname=f[0],e.port=f[1]||("https"===e.protocol.split(":")[0].toLowerCase()?"443":"80"),e.pathname=(c.length>3?"/":"")+c.slice(3,c.length).join("/").split("?")[0].split("#")[0];varg=e.pathname;"/"===g.charAt(g.length-1)&&(g=g.substring(0,g.length-1));varh=e.hostname,i=h.split("."),j=g.split("/");if("hostname"===b)returnh;if("domain"===b)return/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(h)?h:i.slice(-2).join(".");if("sub"===b)returni.slice(0,i.length-2).join(".");if("port"===b)returne.port;if("protocol"===b)returne.protocol.split(":")[0];if("auth"===b)returne.auth;if("user"===b)returne.auth.split(":")[0];if("pass"===b)returne.auth.split(":")[1]||"";if("path"===b)returne.pathname;if("."===b.charAt(0)){if(b=b.substring(1),a(b))returnb=parseInt(b,10),i[0>b?i.length+b:b-1]||""}else{if(a(b))returnb=parseInt(b,10),j[0>b?j.length+b:b]||"";if("file"===b)returnj.slice(-1)[0];if("filename"===b)returnj.slice(-1)[0].split(".")[0];if("fileext"===b)returnj.slice(-1)[0].split(".")[1]||"";if("?"===b.charAt(0)||"#"===b.charAt(0)){vark=d,l=null;if("?"===b.charAt(0)?k=(k.split("?")[1]||"").split("#")[0]:"#"===b.charAt(0)&&(k=k.split("#")[1]||""),!b.charAt(1))returnk;b=b.substring(1),k=k.split("&");for(varm=0,n=k.length;n>m;m++)if(l=k[m].split("="),l[0]===b)returnl[1]||"";returnnull}}return""}}(),"undefined"!=typeofjQuery&&jQuery.extend({url:function(a,b){returnwindow.url(a,b)}});
2929
;(function(){
3030
'use strict';
31-
32-
//In node there is no global Window object
33-
varisNode=(typeofwindow==='undefined');
34-
31+
32+
//Check the existence of module and module.exports to detect node
33+
varisNode=(typeofmodule!='undefined'&&typeofmodule.exports!='undefined');
34+
3535
functionOAuthSignature(){
3636
}
3737

@@ -126,18 +126,18 @@ e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>
126126
};
127127
},
128128
parseInNode :function(){
129-
varurl=require('url'),
129+
varurl=require('uri-js'),
130130
parsedUri=url.parse(this._url),
131-
scheme=parsedUri.protocol;
131+
scheme=parsedUri.scheme;
132132
// strip the ':' at the end of the scheme added by the url module
133133
if(scheme.charAt(scheme.length-1)==":"){
134134
scheme=scheme.substring(0,scheme.length-1);
135135
}
136136
return{
137137
scheme :scheme,
138-
authority :parsedUri.hostname,
138+
authority :parsedUri.host,
139139
port :parsedUri.port,
140-
path :parsedUri.pathname
140+
path :parsedUri.path
141141
};
142142
}
143143
};
@@ -305,4 +305,4 @@ e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>
305305
}else{
306306
window.oauthSignature=oauthSignature;
307307
}
308-
})();
308+
})();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp