@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
|
@@ -3386,21 +3386,23 @@ let Cookie$1 = class Cookie {
|
|
|
3386
3386
|
/**
|
|
3387
3387
|
* @method fromString - a static method for creating an instance of `Cookie` from a string
|
|
3388
3388
|
* @param {string} cookieString - a string containing a list of cookies
|
|
3389
|
-
* @throws {KameleoonError} throws an error if the string is not valid cookie
|
|
3390
3389
|
* @returns {Cookie} an instance of `Cookie`
|
|
3391
3390
|
* */
|
|
3392
3391
|
static fromString(cookieString) {
|
|
3393
3392
|
if (!cookieString) {
|
|
3394
|
-
|
|
3393
|
+
return new Cookie([]);
|
|
3395
3394
|
}
|
|
3396
3395
|
const pairs = cookieString.split(';');
|
|
3397
|
-
const cookie = pairs
|
|
3396
|
+
const cookie = pairs
|
|
3397
|
+
.map((item) => {
|
|
3398
3398
|
const [key, value] = item.trim().split('=');
|
|
3399
|
-
if (!key
|
|
3400
|
-
|
|
3399
|
+
if (!key) {
|
|
3400
|
+
KameleoonLogger.warning `Cookie string has an empty key: ${cookieString}`;
|
|
3401
|
+
return null;
|
|
3401
3402
|
}
|
|
3402
3403
|
return { key, value };
|
|
3403
|
-
})
|
|
3404
|
+
})
|
|
3405
|
+
.filter((item) => item !== null);
|
|
3404
3406
|
return new Cookie(cookie);
|
|
3405
3407
|
}
|
|
3406
3408
|
get url() {
|
|
@@ -4399,6 +4401,9 @@ class SdkLanguage {
|
|
|
4399
4401
|
if (!this.versionMatchType) {
|
|
4400
4402
|
return buildExports.Ok(false);
|
|
4401
4403
|
}
|
|
4404
|
+
if (sdkType !== this.sdkLanguage) {
|
|
4405
|
+
return buildExports.Ok(false);
|
|
4406
|
+
}
|
|
4402
4407
|
const result = Utilities.compareSemVer({
|
|
4403
4408
|
version,
|
|
4404
4409
|
compareVersion: this.conditionValue,
|
|
@@ -4407,7 +4412,7 @@ class SdkLanguage {
|
|
|
4407
4412
|
if (!result.ok) {
|
|
4408
4413
|
return buildExports.Err(result.error);
|
|
4409
4414
|
}
|
|
4410
|
-
return buildExports.Ok(
|
|
4415
|
+
return buildExports.Ok(result.data);
|
|
4411
4416
|
}
|
|
4412
4417
|
}
|
|
4413
4418
|
|