ropegeo-common 1.2.8 → 1.2.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/types/cursors/cursor.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;CACjC;AA4BD;;;GAGG;AACH,8BAAsB,MAAM;IACxB,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEzC,0EAA0E;IAC1E,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEvD,YAAY,IAAI,MAAM;IAMtB;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAkB7F;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI;CAUV"}
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/types/cursors/cursor.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAClB,MAAM,WAAW;IACjB,cAAc,oBAAoB;IAClC,YAAY,kBAAkB;CACjC;AAuBD;;;GAGG;AACH,8BAAsB,MAAM;IACxB,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEzC,0EAA0E;IAC1E,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEvD,YAAY,IAAI,MAAM;IAMtB;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAkB7F;;;OAGG;IACH,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,MAAM,GACnB,IAAI;CAUV"}
@@ -8,13 +8,11 @@ var CursorType;
8
8
  CursorType["RegionImages"] = "region_images";
9
9
  })(CursorType || (exports.CursorType = CursorType = {}));
10
10
  /**
11
- * Base64url encode/decode that works in Node (Buffer) and in React Native/browser (atob/btoa + TextEncoder/TextDecoder).
12
- * Avoids relying on Node's Buffer so cursor parsing works in RN.
11
+ * Base64url encode/decode using only atob/btoa and TextEncoder/TextDecoder so it works in
12
+ * Node, React Native (Hermes), and browser without ever referencing Buffer (which is not
13
+ * available in RN and can cause "Property 'Buffer' doesn't exist" when bundlers inline code).
13
14
  */
14
15
  function base64UrlEncode(utf8) {
15
- if (typeof Buffer !== 'undefined') {
16
- return Buffer.from(utf8, 'utf8').toString('base64url');
17
- }
18
16
  const bytes = new TextEncoder().encode(utf8);
19
17
  let binary = '';
20
18
  for (let i = 0; i < bytes.length; i++) {
@@ -25,9 +23,6 @@ function base64UrlEncode(utf8) {
25
23
  }
26
24
  function base64UrlDecode(encoded) {
27
25
  const base64 = encoded.replace(/-/g, '+').replace(/_/g, '/') + '='.repeat((4 - (encoded.length % 4)) % 4);
28
- if (typeof Buffer !== 'undefined') {
29
- return Buffer.from(base64, 'base64').toString('utf8');
30
- }
31
26
  const binary = atob(base64);
32
27
  return new TextDecoder().decode(Uint8Array.from(binary, (c) => c.charCodeAt(0)));
33
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropegeo-common",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "Shared types and utilities for RopeGeo and WebScraper",
5
5
  "license": "ISC",
6
6
  "repository": {