mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Changing to file level use strict statement
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
|
||||
function encode(val) {
|
||||
'use strict';
|
||||
return encodeURIComponent(val).
|
||||
replace(/%40/gi, '@').
|
||||
replace(/%3A/gi, ':').
|
||||
@@ -18,7 +19,6 @@ function encode(val) {
|
||||
* @returns {string} The formatted url
|
||||
*/
|
||||
module.exports = function buildUrl(url, params) {
|
||||
'use strict';
|
||||
if (!params) {
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
|
||||
module.exports = {
|
||||
write: function write(name, value, expires, path, domain, secure) {
|
||||
'use strict';
|
||||
var cookie = [];
|
||||
cookie.push(name + '=' + encodeURIComponent(value));
|
||||
|
||||
@@ -26,13 +27,11 @@ module.exports = {
|
||||
},
|
||||
|
||||
read: function read(name) {
|
||||
'use strict';
|
||||
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
||||
return (match ? decodeURIComponent(match[3]) : null);
|
||||
},
|
||||
|
||||
remove: function remove(name) {
|
||||
'use strict';
|
||||
this.write(name, '', Date.now() - 86400000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Supply a warning to the developer that a method they are using
|
||||
* has been deprecated.
|
||||
@@ -7,9 +9,6 @@
|
||||
* @param {string} [docs] The documentation URL to get further details
|
||||
*/
|
||||
module.exports = function deprecatedMethod(method, instead, docs) {
|
||||
/*eslint-env node*/
|
||||
'use strict';
|
||||
|
||||
try {
|
||||
console.warn(
|
||||
'DEPRECATED method `' + method + '`.' +
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
|
||||
/**
|
||||
@@ -14,7 +16,6 @@ var utils = require('./../utils');
|
||||
* @returns {Object} Headers parsed into an object
|
||||
*/
|
||||
module.exports = function parseHeaders(headers) {
|
||||
'use strict';
|
||||
var parsed = {}, key, val, i;
|
||||
|
||||
if (!headers) { return parsed; }
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Syntactic sugar for invoking a function and expanding an array for arguments.
|
||||
*
|
||||
@@ -19,7 +21,6 @@
|
||||
* @returns {Function}
|
||||
*/
|
||||
module.exports = function spread(callback) {
|
||||
'use strict';
|
||||
return function (arr) {
|
||||
callback.apply(null, arr);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
|
||||
/**
|
||||
@@ -9,7 +11,6 @@ var utils = require('./../utils');
|
||||
* @returns {*} The resulting transformed data
|
||||
*/
|
||||
module.exports = function transformData(data, headers, fns) {
|
||||
'use strict';
|
||||
utils.forEach(fns, function (fn) {
|
||||
data = fn(data, headers);
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./../utils');
|
||||
var msie = /(msie|trident)/i.test(navigator.userAgent);
|
||||
var urlParsingNode = document.createElement('a');
|
||||
@@ -10,7 +12,6 @@ var originUrl;
|
||||
* @returns {Object}
|
||||
*/
|
||||
function urlResolve(url) {
|
||||
'use strict';
|
||||
var href = url;
|
||||
|
||||
if (msie) {
|
||||
@@ -45,7 +46,6 @@ originUrl = urlResolve(window.location.href);
|
||||
* @returns {boolean} True if URL shares the same origin, otherwise false
|
||||
*/
|
||||
module.exports = function urlIsSameOrigin(requestUrl) {
|
||||
'use strict';
|
||||
var parsed = (utils.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
|
||||
return (parsed.protocol === originUrl.protocol &&
|
||||
parsed.host === originUrl.host);
|
||||
|
||||
Reference in New Issue
Block a user