@cloudbase/utilities
Advanced tools
Comparing version 1.0.3 to 1.1.0-alpha.0
@@ -136,3 +136,3 @@ "use strict"; | ||
var url = options.url, _a = options.headers, headers = _a === void 0 ? {} : _a, data = options.data, responseType = options.responseType, withCredentials = options.withCredentials, body = options.body, onUploadProgress = options.onUploadProgress; | ||
var realUrl = util_1.formatUrl(common_1.PROTOCOL, url, method === 'get' ? data : {}); | ||
var realUrl = util_1.formatUrl(common_1.getProtocol(), url, method === 'get' ? data : {}); | ||
var ajax = new XMLHttpRequest(); | ||
@@ -139,0 +139,0 @@ ajax.open(method, realUrl); |
@@ -1,2 +0,4 @@ | ||
export declare const SDK_NAME = "@cloudbase/js-sdk"; | ||
export declare const PROTOCOL = "https:"; | ||
export declare function setSdkName(name: string): void; | ||
export declare function getSdkName(): string; | ||
export declare function setProtocol(protocol: 'http' | 'https'): void; | ||
export declare function getProtocol(): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PROTOCOL = exports.SDK_NAME = void 0; | ||
exports.SDK_NAME = '@cloudbase/js-sdk'; | ||
exports.PROTOCOL = 'https:'; | ||
exports.getProtocol = exports.setProtocol = exports.getSdkName = exports.setSdkName = void 0; | ||
var sdk_name = '@cloudbase/js-sdk'; | ||
function setSdkName(name) { | ||
sdk_name = name; | ||
} | ||
exports.setSdkName = setSdkName; | ||
function getSdkName() { | ||
return sdk_name; | ||
} | ||
exports.getSdkName = getSdkName; | ||
var PROTOCOL = typeof location !== 'undefined' && location.protocol === 'http:' | ||
? 'http:' | ||
: 'https:'; | ||
function setProtocol(protocol) { | ||
PROTOCOL = protocol; | ||
} | ||
exports.setProtocol = setProtocol; | ||
function getProtocol() { | ||
return PROTOCOL; | ||
} | ||
exports.getProtocol = getProtocol; |
@@ -165,3 +165,3 @@ "use strict"; | ||
function printWarn(error, msg) { | ||
console.warn("[" + constants_1.SDK_NAME + "][" + error + "]:" + msg); | ||
console.warn("[" + constants_1.getSdkName() + "][" + error + "]:" + msg); | ||
} | ||
@@ -172,3 +172,3 @@ exports.printWarn = printWarn; | ||
code: error, | ||
msg: "[" + constants_1.SDK_NAME + "][" + error + "]:" + msg | ||
msg: "[" + constants_1.getSdkName() + "][" + error + "]:" + msg | ||
}); | ||
@@ -178,3 +178,3 @@ } | ||
function printInfo(error, msg) { | ||
console.log("[" + constants_1.SDK_NAME + "][" + error + "]:" + msg); | ||
console.log("[" + constants_1.getSdkName() + "][" + error + "]:" + msg); | ||
} | ||
@@ -185,5 +185,5 @@ exports.printInfo = printInfo; | ||
code: error, | ||
msg: "[" + constants_1.SDK_NAME + "][" + error + "]:" + msg | ||
msg: "[" + constants_1.getSdkName() + "][" + error + "]:" + msg | ||
})); | ||
} | ||
exports.throwError = throwError; |
{ | ||
"name": "@cloudbase/utilities", | ||
"version": "1.0.3", | ||
"version": "1.1.0-alpha.0", | ||
"description": "cloudbase javascript sdk utilities", | ||
@@ -48,3 +48,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "1c1670ed2675b80d08bb1ce95e9aa167aa76126e" | ||
"gitHead": "93de6def47cf724daaefd88bcbad92e305dc9db8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45893
1071
2