File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,13 @@ export class JsonParseNode implements ParseNode {
51
51
/**
52
52
* Node.js Buffer objects created via Buffer.from() use a shared memory pool
53
53
* and may be subject to reuse/recycling, which can lead to unexpected behavior.
54
- *
54
+ *
55
55
* For consistent behavior across environments:
56
56
* - In Node: We convert the base64 string to a Buffer first, then create a new
57
57
* Uint8Array from it to ensure we have a stable, independent copy
58
58
* - In browsers: We convert the string directly using TextEncoder
59
- *
60
- * TODO: Consider standardizing on a cross-platform UInt8Array.fromBase64 (after the API is stabilized across browsers)
59
+ *
60
+ * TODO: Consider standardizing on a cross-platform UInt8Array.fromBase64 (after the API is stabilized across browsers)
61
61
* in the future instead of the current environment-specific approach
62
62
*/
63
63
return inNodeEnv ( ) ? new Uint8Array ( Buffer . from ( strValue , "base64" ) ) . buffer : new TextEncoder ( ) . encode ( strValue ) ;
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ export class TextParseNode implements ParseNode {
23
23
/**
24
24
* Node.js Buffer objects created via Buffer.from() use a shared memory pool
25
25
* and may be subject to reuse/recycling, which can lead to unexpected behavior.
26
- *
26
+ *
27
27
* For consistent behavior across environments:
28
28
* - In Node: We convert the base64 string to a Buffer first, then create a new
29
29
* Uint8Array from it to ensure we have a stable, independent copy
30
30
* - In browsers: We convert the string directly using TextEncoder
31
- *
32
- * TODO: Consider standardizing on a cross-platform UInt8Array.fromBase64 (after the API is stabilized across browsers)
31
+ *
32
+ * TODO: Consider standardizing on a cross-platform UInt8Array.fromBase64 (after the API is stabilized across browsers)
33
33
* in the future instead of the current environment-specific approach
34
34
*/
35
35
return inNodeEnv ( ) ? new Uint8Array ( Buffer . from ( strValue , "base64" ) ) . buffer : new TextEncoder ( ) . encode ( strValue ) ;
You can’t perform that action at this time.
0 commit comments