Skip to content

Commit b18dc7d

Browse files
committed
docs: Add Date and Temporal to examples
1 parent 950d7f2 commit b18dc7d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ which encodes most non-alphanumeric characters.
2626
e.g., `{ foo: true, bar: false }` serializes to `foo=true&bar=false`.
2727
- The primitive `null` and `undefined` values are removed,
2828
e.g., `{ foo: null, bar: undefined, baz: 1 }` serializes to `baz=1`.
29-
- `Date` objects are detected and serialized using `Date.toISOString()`.
29+
- `Date` objects are detected and serialized using `Date.toISOString()`,
30+
e.g., `{ foo: new Date(0) }` serializes to `foo=1970-01-01T00%3A00%3A00.000Z`.
3031
- `Temporal.Instant` objects are detected and serialized by first converting them to `Date`
3132
and then serializing the `Date` as above.
3233
- Arrays are serialized using

examples/axios.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Temporal } from '@js-temporal/polyfill'
12
import axios from 'axios'
23
import type { Builder, Command, Describe, Handler } from 'landlubber'
34

@@ -22,6 +23,8 @@ export const handler: Handler<Options> = async ({ logger }) => {
2223
d: null,
2324
e: ['a', 2],
2425
f: [],
26+
g: new Date(),
27+
h: Temporal.Now.instant(),
2528
},
2629
})
2730
logger.info({ data }, 'Response')

0 commit comments

Comments
 (0)