@cloudbase/utilities
Advanced tools
Comparing version 0.1.0-beta.2 to 0.1.0-beta.3
@@ -82,9 +82,15 @@ "use strict"; | ||
case 'local': | ||
util_1.printWarn(constants_1.ERRORS.INVALID_PARAMS, 'localStorage is not supported on current platform'); | ||
return adapter.localStorage || new TcbCacheObject(adapter.root); | ||
if (!adapter.localStorage) { | ||
util_1.printWarn(constants_1.ERRORS.INVALID_PARAMS, 'localStorage is not supported on current platform'); | ||
return new TcbCacheObject(adapter.root); | ||
} | ||
return adapter.localStorage; | ||
case 'none': | ||
return new TcbCacheObject(adapter.root); | ||
default: | ||
util_1.printWarn(constants_1.ERRORS.INVALID_PARAMS, 'sessionStorage is not supported on current platform'); | ||
return adapter.sessionStorage || new TcbCacheObject(adapter.root); | ||
if (!adapter.sessionStorage) { | ||
util_1.printWarn(constants_1.ERRORS.INVALID_PARAMS, 'sessionStorage is not supported on current platform'); | ||
return new TcbCacheObject(adapter.root); | ||
} | ||
return adapter.sessionStorage; | ||
} | ||
@@ -91,0 +97,0 @@ } |
@@ -168,3 +168,6 @@ "use strict"; | ||
function printError(error, msg) { | ||
console.error("[" + constants_1.SDK_NAME + "][" + error + "]:" + msg); | ||
console.error({ | ||
code: error, | ||
msg: "[" + constants_1.SDK_NAME + "][" + error + "]:" + msg | ||
}); | ||
} | ||
@@ -177,4 +180,7 @@ exports.printError = printError; | ||
function throwError(error, msg) { | ||
throw new Error("[" + constants_1.SDK_NAME + "][" + error + "]:" + msg); | ||
throw new Error(JSON.stringify({ | ||
code: error, | ||
msg: "[" + constants_1.SDK_NAME + "][" + error + "]:" + msg | ||
})); | ||
} | ||
exports.throwError = throwError; |
{ | ||
"name": "@cloudbase/utilities", | ||
"version": "0.1.0-beta.2", | ||
"version": "0.1.0-beta.3", | ||
"description": "cloudbase javascript sdk utilities", | ||
@@ -36,3 +36,3 @@ "main": "dist/index.js", | ||
"@cloudbase/adapter-interface": "^0.4.0", | ||
"@cloudbase/types": "^0.1.0-beta.5", | ||
"@cloudbase/types": "^0.1.0-beta.6", | ||
"crypto-js": "^4.0.0" | ||
@@ -39,0 +39,0 @@ }, |
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
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
41982
997