configcat-js-ssr
Advanced tools
Comparing version 8.0.0 to 8.1.0
@@ -5,3 +5,5 @@ import type { IConfigCatCache } from "configcat-common"; | ||
get(key: string): string | undefined; | ||
private b64EncodeUnicode; | ||
private b64DecodeUnicode; | ||
} | ||
//# sourceMappingURL=Cache.d.ts.map |
@@ -9,3 +9,3 @@ "use strict"; | ||
try { | ||
localStorage.setItem(key, btoa(value)); | ||
localStorage.setItem(key, this.b64EncodeUnicode(value)); | ||
} | ||
@@ -20,3 +20,3 @@ catch (ex) { | ||
if (configString) { | ||
return atob(configString); | ||
return this.b64DecodeUnicode(configString); | ||
} | ||
@@ -27,5 +27,16 @@ } | ||
} | ||
return void 0; | ||
}; | ||
LocalStorageCache.prototype.b64EncodeUnicode = function (str) { | ||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (_, p1) { | ||
return String.fromCharCode(parseInt(p1, 16)); | ||
})); | ||
}; | ||
LocalStorageCache.prototype.b64DecodeUnicode = function (str) { | ||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) { | ||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | ||
}).join('')); | ||
}; | ||
return LocalStorageCache; | ||
}()); | ||
exports.LocalStorageCache = LocalStorageCache; |
@@ -6,3 +6,3 @@ var LocalStorageCache = /** @class */ (function () { | ||
try { | ||
localStorage.setItem(key, btoa(value)); | ||
localStorage.setItem(key, this.b64EncodeUnicode(value)); | ||
} | ||
@@ -17,3 +17,3 @@ catch (ex) { | ||
if (configString) { | ||
return atob(configString); | ||
return this.b64DecodeUnicode(configString); | ||
} | ||
@@ -24,5 +24,16 @@ } | ||
} | ||
return void 0; | ||
}; | ||
LocalStorageCache.prototype.b64EncodeUnicode = function (str) { | ||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (_, p1) { | ||
return String.fromCharCode(parseInt(p1, 16)); | ||
})); | ||
}; | ||
LocalStorageCache.prototype.b64DecodeUnicode = function (str) { | ||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) { | ||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | ||
}).join('')); | ||
}; | ||
return LocalStorageCache; | ||
}()); | ||
export { LocalStorageCache }; |
@@ -1,1 +0,1 @@ | ||
export default "8.0.0"; | ||
export default "8.1.0"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "8.0.0"; | ||
exports.default = "8.1.0"; |
{ | ||
"name": "configcat-js-ssr", | ||
"version": "8.0.0", | ||
"version": "8.1.0", | ||
"description": "ConfigCat Feature Flags for Server Side Rendered apps like NuxtJS. Official ConfigCat SDK for Server Side Rendered to easily access feature flags.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
190148
439