Skip to content

Commit

Permalink
chore: Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Mar 3, 2024
1 parent d17a615 commit 738883f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 58 deletions.
58 changes: 29 additions & 29 deletions stdlib/json.gr
Expand Up @@ -76,22 +76,22 @@ provide enum rec Json {
*/
provide enum JsonToStringError {
/**
* The `Json` data structure contains a number value of `NaN`, `Infinity`, or `-Infinity`
* The `Json` data structure contains a number value of `NaN`, `Infinity`, or `-Infinity`.
*/
InvalidNumber(String),
}

/**
* Controls how indentation is outputted in custom formatting.
* Controls how indentation is output in custom formatting.
*/
provide enum IndentationFormat {
/**
* No indentation is emitted.
*
* ```json
* {
* "currency":·"€",
* "price":·99.9
* "currency": "€",
* "price": 99.9
* }
* ```
*/
Expand All @@ -101,8 +101,8 @@ provide enum IndentationFormat {
*
* ```json
* {
* "currency":·"€",
* "price":·99.9
* "currency": "€",
* "price": 99.9
* }
* ```
*/
Expand All @@ -113,24 +113,24 @@ provide enum IndentationFormat {
* `IndentWithSpaces(2)`
* ```json
* {
* ··"currency":·"€",
* ··"price":·99.9
* "currency": "€",
* "price": 99.9
* }
* ```
*
* `IndentWithSpaces(4)`
* ```json
* {
* ····"currency":·"€",
* ····"price":·99.9
* "currency": "€",
* "price": 99.9
* }
* ```
*/
IndentWithSpaces(Number),
}

/**
* Controls how arrays are outputted in custom formatting.
* Controls how arrays are output in custom formatting.
*/
provide enum ArrayFormat {
/**
Expand Down Expand Up @@ -174,23 +174,23 @@ provide enum ArrayFormat {
*
* ```json
* [
* ··1
* 1
* ]
* ```
*
* ```json
* [
* ··1,
* ··2,
* ··3
* 1,
* 2,
* 3
* ]
* ```
*/
OneArrayEntryPerLine,
}

/**
* Controls how objects are outputted in custom formatting.
* Controls how objects are output in custom formatting.
*/
provide enum ObjectFormat {
/**
Expand Down Expand Up @@ -234,23 +234,23 @@ provide enum ObjectFormat {
*
* ```
* {
* ··"a":·1
* "a": 1
* }
* ```
*
* ```
* {
* ··"a":·1,
* ··"b":·2,
* ··"c":·3
* "a": 1,
* "b": 2,
* "c": 3
* }
* ```
*/
OneObjectEntryPerLine,
}

/**
* Controls how line endings are outputted in custom formatting.
* Controls how line endings are output in custom formatting.
*/
provide enum LineEnding {
/**
Expand All @@ -262,11 +262,11 @@ provide enum LineEnding {
*/
LineFeed,
/**
* A `\r\n` will be emitted at the end of each line
* A `\r\n` will be emitted at the end of each line.
*/
CarriageReturnLineFeed,
/**
* A `\r` will be emitted at the end of each line
* A `\r` will be emitted at the end of each line.
*/
CarriageReturn,
}
Expand Down Expand Up @@ -312,9 +312,9 @@ provide enum FormattingChoices {
*
* ```json
* {
* ··"currency":·"€",
* ··"price":·99.9,
* ··"currencyDescription":·"EURO\u007f",
* "currency": "€",
* "price": 99.9,
* "currencyDescription": "EURO\u007f",
* }
* ```
*/
Expand Down Expand Up @@ -369,9 +369,9 @@ provide enum FormattingChoices {
*
* ```json
* {
* ··"currency":·"\u20ac",
* ··"price":·99.9,
* ··"currencyDescription":·"EURO\u007f",
* "currency": "\u20ac",
* "price": 99.9,
* "currencyDescription": "EURO\u007f",
* }
* ```
*/
Expand Down
58 changes: 29 additions & 29 deletions stdlib/json.md
Expand Up @@ -73,7 +73,7 @@ Variants:
InvalidNumber(String)
```

The `Json` data structure contains a number value of `NaN`, `Infinity`, or `-Infinity`
The `Json` data structure contains a number value of `NaN`, `Infinity`, or `-Infinity`.

### Json.**IndentationFormat**

Expand All @@ -85,7 +85,7 @@ enum IndentationFormat {
}
```

Controls how indentation is outputted in custom formatting.
Controls how indentation is output in custom formatting.

Variants:

Expand All @@ -97,8 +97,8 @@ No indentation is emitted.

```json
{
"currency":·"€",
"price":·99.9
"currency": "",
"price": 99.9
}
```

Expand All @@ -110,8 +110,8 @@ Tabs are emitted.

```json
{
"currency":·"€",
"price":·99.9
"currency": "",
"price": 99.9
}
```

Expand All @@ -124,16 +124,16 @@ The desired number of spaces are emitted.
`IndentWithSpaces(2)`
```json
{
··"currency":·"€",
··"price":·99.9
"currency": "",
"price": 99.9
}
```

`IndentWithSpaces(4)`
```json
{
····"currency":·"€",
····"price":·99.9
"currency": "",
"price": 99.9
}
```

Expand All @@ -147,7 +147,7 @@ enum ArrayFormat {
}
```

Controls how arrays are outputted in custom formatting.
Controls how arrays are output in custom formatting.

Variants:

Expand Down Expand Up @@ -199,15 +199,15 @@ Arrays are emitted with newlines and indentation between each element.

```json
[
··1
1
]
```

```json
[
··1,
··2,
··3
1,
2,
3
]
```

Expand All @@ -221,7 +221,7 @@ enum ObjectFormat {
}
```

Controls how objects are outputted in custom formatting.
Controls how objects are output in custom formatting.

Variants:

Expand Down Expand Up @@ -273,15 +273,15 @@ Objects are emitted with each entry on a new line.

```
{
··"a":·1
"a": 1
}
```

```
{
··"a":·1,
··"b":·2,
··"c":·3
"a": 1,
"b": 2,
"c": 3
}
```

Expand All @@ -296,7 +296,7 @@ enum LineEnding {
}
```

Controls how line endings are outputted in custom formatting.
Controls how line endings are output in custom formatting.

Variants:

Expand All @@ -316,13 +316,13 @@ A `\n` will be emitted at the end of each line.
CarriageReturnLineFeed
```

A `\r\n` will be emitted at the end of each line
A `\r\n` will be emitted at the end of each line.

```grain
CarriageReturn
```

A `\r` will be emitted at the end of each line
A `\r` will be emitted at the end of each line.

### Json.**FormattingChoices**

Expand Down Expand Up @@ -375,9 +375,9 @@ Custom{

```json
{
··"currency":·"€",
··"price":·99.9,
··"currencyDescription":·"EURO\u007f",
"currency": "",
"price": 99.9,
"currencyDescription": "EURO\u007f",
}
```

Expand Down Expand Up @@ -436,9 +436,9 @@ Custom{

```json
{
··"currency":·"\u20ac",
··"price":·99.9,
··"currencyDescription":·"EURO\u007f",
"currency": "\u20ac",
"price": 99.9,
"currencyDescription": "EURO\u007f",
}
```

Expand Down

0 comments on commit 738883f

Please sign in to comment.