Skip to content

Commit 9911044

Browse files
author
Dmitry Dutikov
committed
Mime type added
1 parent ea93a10 commit 9911044

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ console.log(typeof value.amount); // => bigint
3636
console.log(typeof value.debt, isNaN(value.debt)); // => number true
3737
```
3838
## Motivation
39-
JSON format is good enough for everyday usage. There is some libraries trying to introduce syntax to make JSON closer
40-
to modern JavaScript, some libraries trying to introduce functions serialization. All that is not important and do not
41-
required for everyday usage. However, there is one thing annoing me always - date values.
39+
JSON format is good enough for everyday usage. There are some libraries trying to introduce syntax to make JSON closer
40+
to modern JavaScript, some libraries trying to introduce functions serialization. All that is not important and is not
41+
required for everyday usage. However, there is one thing annoying me always - date values.
4242

4343
We are serializing dates a lot and each time we parse it back we are getting a string. As a result we have to deal with
4444
the Date constructor manually each time. Even if we are no need date as an object, date formatter will have to make date
45-
object in order to make user friendly text representation. Otherwords we are forced to care about dates additionally.
45+
object in order to make user-friendly text representation. Otherwords we are forced to care about dates additionally.
4646
It produces bulky solutions or tons of inline type conversions.
4747

4848
But I'm lazy developer, I'll do everything to get rid of any additional careness.
@@ -70,7 +70,7 @@ interface Json22StringifyOptions {
7070

7171
### Numbers
7272

73-
With JSON22 you can use `NaN`, `Infinity`, `-Infinity` values. It mean also this values will be stringified well
73+
With JSON22 you can use `NaN`, `Infinity`, `-Infinity` values. It means also this values will be stringified well
7474
in case it nested at an array or an object.
7575
```javascript
7676
JSON.stringify([42, NaN, Infinity, -Infinity]); // => [42, null, null, null]

index.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ const State = {
8585

8686
class JSON22 {
8787

88+
static mimeType = 'application/x.json22';
89+
8890
static #Stack = class {
8991
#array;
9092
#crCheck = false;

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ const State = {
8585

8686
export class JSON22 {
8787

88+
static mimeType = 'application/x.json22';
89+
8890
static #Stack = class {
8991
#array;
9092
#crCheck = false;

0 commit comments

Comments
 (0)