@intlayer/editor 7.0.2-canary.0 → 7.0.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.
@@ -26,7 +26,10 @@ const compareUrls = (url1, url2) => {
26
26
  if (path1 !== "" && path2 !== "" && path1 !== path2) return false;
27
27
  return true;
28
28
  } catch (error) {
29
- console.error("Invalid URL(s)", error);
29
+ console.error("Invalid URL(s)", error, {
30
+ url1,
31
+ url2
32
+ });
30
33
  return false;
31
34
  }
32
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"compareUrls.cjs","names":[],"sources":["../../src/compareUrls.ts"],"sourcesContent":["/**\n * Compare two URLs for equality.\n * This function is used to determine if a message originates from the same origin.\n *\n * ```js\n * // Example usage\n * console.log(compareUrls(\"http://localhost:5173/\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5173\", \"http://localhost:5173?myParam=true\")); // true\n * console.log(compareUrls(\"http://localhost:5173/subpath\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5172\", \"http://localhost:5173\")); // false\n * ```\n *\n * @param url1 - The first URL to compare.\n * @param url2 - The second URL to compare.\n * @returns Whether the two URLs are equal.\n */\nexport const compareUrls = (url1: string, url2: string): boolean => {\n try {\n const parsedUrl1 = new URL(url1);\n const parsedUrl2 = new URL(url2);\n\n // Compare protocol, hostname, and port\n if (\n parsedUrl1.protocol !== parsedUrl2.protocol ||\n parsedUrl1.hostname !== parsedUrl2.hostname ||\n parsedUrl1.port !== parsedUrl2.port\n ) {\n return false;\n }\n\n // One URL should not have a subpath while the other does\n const path1 = parsedUrl1.pathname.replace(/\\/$/, ''); // Remove trailing slash\n const path2 = parsedUrl2.pathname.replace(/\\/$/, '');\n\n if (path1 !== '' && path2 !== '' && path1 !== path2) {\n return false;\n }\n\n return true;\n } catch (error) {\n console.error('Invalid URL(s)', error);\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,MAAc,SAA0B;AAClE,KAAI;EACF,MAAM,aAAa,IAAI,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,IAAI,KAAK;AAGhC,MACE,WAAW,aAAa,WAAW,YACnC,WAAW,aAAa,WAAW,YACnC,WAAW,SAAS,WAAW,KAE/B,QAAO;EAIT,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;AAEpD,MAAI,UAAU,MAAM,UAAU,MAAM,UAAU,MAC5C,QAAO;AAGT,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,kBAAkB,MAAM;AACtC,SAAO"}
1
+ {"version":3,"file":"compareUrls.cjs","names":[],"sources":["../../src/compareUrls.ts"],"sourcesContent":["/**\n * Compare two URLs for equality.\n * This function is used to determine if a message originates from the same origin.\n *\n * ```js\n * // Example usage\n * console.log(compareUrls(\"http://localhost:5173/\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5173\", \"http://localhost:5173?myParam=true\")); // true\n * console.log(compareUrls(\"http://localhost:5173/subpath\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5172\", \"http://localhost:5173\")); // false\n * ```\n *\n * @param url1 - The first URL to compare.\n * @param url2 - The second URL to compare.\n * @returns Whether the two URLs are equal.\n */\nexport const compareUrls = (url1: string, url2: string): boolean => {\n try {\n const parsedUrl1 = new URL(url1);\n const parsedUrl2 = new URL(url2);\n\n // Compare protocol, hostname, and port\n if (\n parsedUrl1.protocol !== parsedUrl2.protocol ||\n parsedUrl1.hostname !== parsedUrl2.hostname ||\n parsedUrl1.port !== parsedUrl2.port\n ) {\n return false;\n }\n\n // One URL should not have a subpath while the other does\n const path1 = parsedUrl1.pathname.replace(/\\/$/, ''); // Remove trailing slash\n const path2 = parsedUrl2.pathname.replace(/\\/$/, '');\n\n if (path1 !== '' && path2 !== '' && path1 !== path2) {\n return false;\n }\n\n return true;\n } catch (error) {\n console.error('Invalid URL(s)', error, { url1, url2 });\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,MAAc,SAA0B;AAClE,KAAI;EACF,MAAM,aAAa,IAAI,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,IAAI,KAAK;AAGhC,MACE,WAAW,aAAa,WAAW,YACnC,WAAW,aAAa,WAAW,YACnC,WAAW,SAAS,WAAW,KAE/B,QAAO;EAIT,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;AAEpD,MAAI,UAAU,MAAM,UAAU,MAAM,UAAU,MAC5C,QAAO;AAGT,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,kBAAkB,OAAO;GAAE;GAAM;GAAM,CAAC;AACtD,SAAO"}
@@ -25,7 +25,10 @@ const compareUrls = (url1, url2) => {
25
25
  if (path1 !== "" && path2 !== "" && path1 !== path2) return false;
26
26
  return true;
27
27
  } catch (error) {
28
- console.error("Invalid URL(s)", error);
28
+ console.error("Invalid URL(s)", error, {
29
+ url1,
30
+ url2
31
+ });
29
32
  return false;
30
33
  }
31
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"compareUrls.mjs","names":[],"sources":["../../src/compareUrls.ts"],"sourcesContent":["/**\n * Compare two URLs for equality.\n * This function is used to determine if a message originates from the same origin.\n *\n * ```js\n * // Example usage\n * console.log(compareUrls(\"http://localhost:5173/\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5173\", \"http://localhost:5173?myParam=true\")); // true\n * console.log(compareUrls(\"http://localhost:5173/subpath\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5172\", \"http://localhost:5173\")); // false\n * ```\n *\n * @param url1 - The first URL to compare.\n * @param url2 - The second URL to compare.\n * @returns Whether the two URLs are equal.\n */\nexport const compareUrls = (url1: string, url2: string): boolean => {\n try {\n const parsedUrl1 = new URL(url1);\n const parsedUrl2 = new URL(url2);\n\n // Compare protocol, hostname, and port\n if (\n parsedUrl1.protocol !== parsedUrl2.protocol ||\n parsedUrl1.hostname !== parsedUrl2.hostname ||\n parsedUrl1.port !== parsedUrl2.port\n ) {\n return false;\n }\n\n // One URL should not have a subpath while the other does\n const path1 = parsedUrl1.pathname.replace(/\\/$/, ''); // Remove trailing slash\n const path2 = parsedUrl2.pathname.replace(/\\/$/, '');\n\n if (path1 !== '' && path2 !== '' && path1 !== path2) {\n return false;\n }\n\n return true;\n } catch (error) {\n console.error('Invalid URL(s)', error);\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,MAAc,SAA0B;AAClE,KAAI;EACF,MAAM,aAAa,IAAI,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,IAAI,KAAK;AAGhC,MACE,WAAW,aAAa,WAAW,YACnC,WAAW,aAAa,WAAW,YACnC,WAAW,SAAS,WAAW,KAE/B,QAAO;EAIT,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;AAEpD,MAAI,UAAU,MAAM,UAAU,MAAM,UAAU,MAC5C,QAAO;AAGT,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,kBAAkB,MAAM;AACtC,SAAO"}
1
+ {"version":3,"file":"compareUrls.mjs","names":[],"sources":["../../src/compareUrls.ts"],"sourcesContent":["/**\n * Compare two URLs for equality.\n * This function is used to determine if a message originates from the same origin.\n *\n * ```js\n * // Example usage\n * console.log(compareUrls(\"http://localhost:5173/\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5173\", \"http://localhost:5173?myParam=true\")); // true\n * console.log(compareUrls(\"http://localhost:5173/subpath\", \"http://localhost:5173\")); // true\n * console.log(compareUrls(\"http://localhost:5172\", \"http://localhost:5173\")); // false\n * ```\n *\n * @param url1 - The first URL to compare.\n * @param url2 - The second URL to compare.\n * @returns Whether the two URLs are equal.\n */\nexport const compareUrls = (url1: string, url2: string): boolean => {\n try {\n const parsedUrl1 = new URL(url1);\n const parsedUrl2 = new URL(url2);\n\n // Compare protocol, hostname, and port\n if (\n parsedUrl1.protocol !== parsedUrl2.protocol ||\n parsedUrl1.hostname !== parsedUrl2.hostname ||\n parsedUrl1.port !== parsedUrl2.port\n ) {\n return false;\n }\n\n // One URL should not have a subpath while the other does\n const path1 = parsedUrl1.pathname.replace(/\\/$/, ''); // Remove trailing slash\n const path2 = parsedUrl2.pathname.replace(/\\/$/, '');\n\n if (path1 !== '' && path2 !== '' && path1 !== path2) {\n return false;\n }\n\n return true;\n } catch (error) {\n console.error('Invalid URL(s)', error, { url1, url2 });\n return false;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAa,eAAe,MAAc,SAA0B;AAClE,KAAI;EACF,MAAM,aAAa,IAAI,IAAI,KAAK;EAChC,MAAM,aAAa,IAAI,IAAI,KAAK;AAGhC,MACE,WAAW,aAAa,WAAW,YACnC,WAAW,aAAa,WAAW,YACnC,WAAW,SAAS,WAAW,KAE/B,QAAO;EAIT,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;EACpD,MAAM,QAAQ,WAAW,SAAS,QAAQ,OAAO,GAAG;AAEpD,MAAI,UAAU,MAAM,UAAU,MAAM,UAAU,MAC5C,QAAO;AAGT,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,kBAAkB,OAAO;GAAE;GAAM;GAAM,CAAC;AACtD,SAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/editor",
3
- "version": "7.0.2-canary.0",
3
+ "version": "7.0.2",
4
4
  "private": false,
5
5
  "description": "Provides the utilities to interface the application with the Intlayer editor and manipulate dictionaries",
6
6
  "keywords": [
@@ -68,9 +68,9 @@
68
68
  },
69
69
  "devDependencies": {
70
70
  "@types/node": "24.9.1",
71
- "@utils/ts-config": "7.0.2-canary.0",
72
- "@utils/ts-config-types": "7.0.2-canary.0",
73
- "@utils/tsdown-config": "7.0.2-canary.0",
71
+ "@utils/ts-config": "7.0.2",
72
+ "@utils/ts-config-types": "7.0.2",
73
+ "@utils/tsdown-config": "7.0.2",
74
74
  "rimraf": "6.0.1",
75
75
  "tsdown": "0.15.9",
76
76
  "typescript": "5.9.3",