Skip to content

Commit

Permalink
Merge pull request #45 from ivandevp/fix/docs
Browse files Browse the repository at this point in the history
fix(docs): method name and minor typos
  • Loading branch information
lxsmnsyc authored Oct 7, 2024
2 parents 822af20 + 3788f21 commit 6da4dad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ console.log(crossSerialize(nodeA, { refs })); // ($R[0]={next:$R[1]={}},$R[1].pr
console.log(crossSerialize(nodeB, { refs })); // $R[1]
```

Take note that cross-reference scripts relies on the global array variable `$R`, which you can declare either manually, or a script via `getLocalHeaderScript`
Take note that cross-reference scripts relies on the global array variable `$R`, which you can declare either manually, or a script via `getCrossReferenceHeader`

```js
import { getCrossReferenceHeader } from 'seroval';
Expand Down Expand Up @@ -174,7 +174,7 @@ Streaming serialization allows pushing values through `Promise` instances. Howev

`ReadableStream` is capable of doing so, however it's not a JS standard (`seroval` supports it through plugins). `Observable` could have been nice however [it's not a JS standard yet](https://github.com/tc39/proposal-observable)

With two of the optinos not available, `seroval` provides a streaming primitive called `createStream` which is capable of buffering streaming data as well as emitting pushed data.
With two of the options not available, `seroval` provides a streaming primitive called `createStream` which is capable of buffering streaming data as well as emitting pushed data.

```js
import { createStream } from 'seroval';
Expand Down Expand Up @@ -229,7 +229,7 @@ $R[0].return("baz")

## JSON serialization

The mentioned serialization metohds are ideal for server-to-client communication, however, client-to-server communication requires a sanitized data, because the medium is prone to [RCE](https://huntr.dev/bounties/63f1ff91-48f3-4886-a179-103f1ddd8ff8). `seroval` offers JSON modes as an alternative.
The mentioned serialization methods are ideal for server-to-client communication, however, client-to-server communication requires a sanitized data, because the medium is prone to [RCE](https://huntr.dev/bounties/63f1ff91-48f3-4886-a179-103f1ddd8ff8). `seroval` offers JSON modes as an alternative.

| modes | JS | JSON |
| --- | --- | --- |
Expand Down

0 comments on commit 6da4dad

Please sign in to comment.