@kameleoon/javascript-sdk-core 5.14.2 → 5.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -8
- package/dist/javascript-sdk-core-browser.cjs.js +12 -7
- package/dist/javascript-sdk-core-browser.cjs.js.map +1 -1
- package/dist/javascript-sdk-core-browser.es.js +12 -7
- package/dist/javascript-sdk-core-browser.es.js.map +1 -1
- package/dist/javascript-sdk-core.cjs.js +12 -7
- package/dist/javascript-sdk-core.cjs.js.map +1 -1
- package/dist/javascript-sdk-core.es.js +12 -7
- package/dist/javascript-sdk-core.es.js.map +1 -1
- package/dist/kameleoonData/cookie.d.ts +0 -1
- package/package.json +1 -1
|
@@ -3415,21 +3415,23 @@ let Cookie$1 = class Cookie {
|
|
|
3415
3415
|
/**
|
|
3416
3416
|
* @method fromString - a static method for creating an instance of `Cookie` from a string
|
|
3417
3417
|
* @param {string} cookieString - a string containing a list of cookies
|
|
3418
|
-
* @throws {KameleoonError} throws an error if the string is not valid cookie
|
|
3419
3418
|
* @returns {Cookie} an instance of `Cookie`
|
|
3420
3419
|
* */
|
|
3421
3420
|
static fromString(cookieString) {
|
|
3422
3421
|
if (!cookieString) {
|
|
3423
|
-
|
|
3422
|
+
return new Cookie([]);
|
|
3424
3423
|
}
|
|
3425
3424
|
const pairs = cookieString.split(';');
|
|
3426
|
-
const cookie = pairs
|
|
3425
|
+
const cookie = pairs
|
|
3426
|
+
.map((item) => {
|
|
3427
3427
|
const [key, value] = item.trim().split('=');
|
|
3428
|
-
if (!key
|
|
3429
|
-
|
|
3428
|
+
if (!key) {
|
|
3429
|
+
KameleoonLogger.warning `Cookie string has an empty key: ${cookieString}`;
|
|
3430
|
+
return null;
|
|
3430
3431
|
}
|
|
3431
3432
|
return { key, value };
|
|
3432
|
-
})
|
|
3433
|
+
})
|
|
3434
|
+
.filter((item) => item !== null);
|
|
3433
3435
|
return new Cookie(cookie);
|
|
3434
3436
|
}
|
|
3435
3437
|
get url() {
|
|
@@ -4428,6 +4430,9 @@ class SdkLanguage {
|
|
|
4428
4430
|
if (!this.versionMatchType) {
|
|
4429
4431
|
return buildExports.Ok(false);
|
|
4430
4432
|
}
|
|
4433
|
+
if (sdkType !== this.sdkLanguage) {
|
|
4434
|
+
return buildExports.Ok(false);
|
|
4435
|
+
}
|
|
4431
4436
|
const result = Utilities.compareSemVer({
|
|
4432
4437
|
version,
|
|
4433
4438
|
compareVersion: this.conditionValue,
|
|
@@ -4436,7 +4441,7 @@ class SdkLanguage {
|
|
|
4436
4441
|
if (!result.ok) {
|
|
4437
4442
|
return buildExports.Err(result.error);
|
|
4438
4443
|
}
|
|
4439
|
-
return buildExports.Ok(
|
|
4444
|
+
return buildExports.Ok(result.data);
|
|
4440
4445
|
}
|
|
4441
4446
|
}
|
|
4442
4447
|
|