@posthog/browser-common 0.6.1 → 0.6.2

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/dist/config.js CHANGED
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  default: ()=>__WEBPACK_DEFAULT_EXPORT__
28
28
  });
29
- const packageVersion = "0.6.1";
29
+ const packageVersion = "0.6.2";
30
30
  const Config = {
31
31
  DEBUG: false,
32
32
  LIB_VERSION: packageVersion,
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const packageVersion = "0.6.1";
1
+ const packageVersion = "0.6.2";
2
2
  const Config = {
3
3
  DEBUG: false,
4
4
  LIB_VERSION: packageVersion,
@@ -427,6 +427,9 @@ function getElementsChainString(elements) {
427
427
  function escapeQuotes(input) {
428
428
  return input.replace(/"|\\"/g, '\\"');
429
429
  }
430
+ function lexicalCompare(a, b) {
431
+ return a < b ? -1 : a > b ? 1 : 0;
432
+ }
430
433
  function elementsToString(elements) {
431
434
  const ret = elements.map((element)=>{
432
435
  let el_string = '';
@@ -450,7 +453,7 @@ function elementsToString(elements) {
450
453
  ...element.attributes
451
454
  };
452
455
  const sortedAttributes = {};
453
- (0, external_general_utils_js_namespaceObject.entries)(attributes).sort(([a], [b])=>a.localeCompare(b)).forEach(([key, value])=>sortedAttributes[escapeQuotes(key.toString())] = escapeQuotes(value.toString()));
456
+ (0, external_general_utils_js_namespaceObject.entries)(attributes).sort(([a], [b])=>lexicalCompare(a, b)).forEach(([key, value])=>sortedAttributes[escapeQuotes(key.toString())] = escapeQuotes(value.toString()));
454
457
  el_string += ':';
455
458
  el_string += (0, external_general_utils_js_namespaceObject.entries)(sortedAttributes).map(([key, value])=>`${key}="${value}"`).join('');
456
459
  return el_string;
@@ -379,6 +379,9 @@ function getElementsChainString(elements) {
379
379
  function escapeQuotes(input) {
380
380
  return input.replace(/"|\\"/g, '\\"');
381
381
  }
382
+ function lexicalCompare(a, b) {
383
+ return a < b ? -1 : a > b ? 1 : 0;
384
+ }
382
385
  function elementsToString(elements) {
383
386
  const ret = elements.map((element)=>{
384
387
  let el_string = '';
@@ -402,7 +405,7 @@ function elementsToString(elements) {
402
405
  ...element.attributes
403
406
  };
404
407
  const sortedAttributes = {};
405
- entries(attributes).sort(([a], [b])=>a.localeCompare(b)).forEach(([key, value])=>sortedAttributes[escapeQuotes(key.toString())] = escapeQuotes(value.toString()));
408
+ entries(attributes).sort(([a], [b])=>lexicalCompare(a, b)).forEach(([key, value])=>sortedAttributes[escapeQuotes(key.toString())] = escapeQuotes(value.toString()));
406
409
  el_string += ':';
407
410
  el_string += entries(sortedAttributes).map(([key, value])=>`${key}="${value}"`).join('');
408
411
  return el_string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/browser-common",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -65,8 +65,8 @@
65
65
  }
66
66
  },
67
67
  "dependencies": {
68
- "@posthog/types": "^1.407.0",
69
- "@posthog/core": "^1.49.1"
68
+ "@posthog/core": "^1.49.1",
69
+ "@posthog/types": "^1.407.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@rslib/core": "0.10.6",