Skip to content

Commit

Permalink
Add new function parseServerTimingMetrics() for parsing a `Server-T…
Browse files Browse the repository at this point in the history
…iming` header into an array of metric objects (#82)
  • Loading branch information
mangs authored Jul 3, 2024
1 parent c6062ea commit a4596ff
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 64 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.22.0

- Add new function `parseServerTimingMetrics()` for parsing a `Server-Timing` header into an array of metric objects

## 2.21.1

- Update `fetchWithRetry()` with minor revisions
Expand Down
6 changes: 3 additions & 3 deletions documentation/buildUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| `loader?` | `object` | - | - | `BuildConfig.loader` | node\_modules/bun-types/bun.d.ts:1574 |
| `minify?` | `boolean` \| `object` | - | - | `BuildConfig.minify` | node\_modules/bun-types/bun.d.ts:1584 |
| `naming?` | `string` \| `object` | - | - | `BuildConfig.naming` | node\_modules/bun-types/bun.d.ts:1559 |
| `outdir` | `string` | Output directory. | `BuildConfig.outdir` | - | [src/buildUtils.mts:30](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/buildUtils.mts#L30) |
| `outdir` | `string` | Output directory. | `BuildConfig.outdir` | - | [src/buildUtils.mts:30](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/buildUtils.mts#L30) |
| `plugins?` | `BunPlugin`[] | - | - | `BuildConfig.plugins` | node\_modules/bun-types/bun.d.ts:1568 |
| `publicPath?` | `string` | - | - | `BuildConfig.publicPath` | node\_modules/bun-types/bun.d.ts:1571 |
| `root?` | `string` | - | - | `BuildConfig.root` | node\_modules/bun-types/bun.d.ts:1566 |
Expand Down Expand Up @@ -77,7 +77,7 @@ process.exitCode = await buildAndShowMetadata(buildConfiguration);

#### Defined in

[src/buildUtils.mts:52](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/buildUtils.mts#L52)
[src/buildUtils.mts:52](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/buildUtils.mts#L52)

***

Expand All @@ -100,4 +100,4 @@ Format and print to the command line the provided build metadata.

#### Defined in

[src/buildUtils.mts:81](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/buildUtils.mts#L81)
[src/buildUtils.mts:81](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/buildUtils.mts#L81)
22 changes: 11 additions & 11 deletions documentation/consoleUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Text formatted so it appears cyan.

#### Defined in

[src/consoleUtils.mts:17](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L17)
[src/consoleUtils.mts:17](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L17)

***

Expand All @@ -46,7 +46,7 @@ Text formatted so it appears dim.

#### Defined in

[src/consoleUtils.mts:26](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L26)
[src/consoleUtils.mts:26](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L26)

***

Expand All @@ -72,7 +72,7 @@ Localized text label showing elapsed time with units.

#### Defined in

[src/consoleUtils.mts:73](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L73)
[src/consoleUtils.mts:73](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L73)

***

Expand All @@ -96,7 +96,7 @@ Text formatted so it appears green.

#### Defined in

[src/consoleUtils.mts:35](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L35)
[src/consoleUtils.mts:35](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L35)

***

Expand All @@ -118,7 +118,7 @@ Print an error message to the console in red.

#### Defined in

[src/consoleUtils.mts:82](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L82)
[src/consoleUtils.mts:82](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L82)

***

Expand All @@ -140,7 +140,7 @@ Print an informational message to the console in cyan.

#### Defined in

[src/consoleUtils.mts:90](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L90)
[src/consoleUtils.mts:90](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L90)

***

Expand All @@ -162,7 +162,7 @@ Print a success message to the console in green.

#### Defined in

[src/consoleUtils.mts:98](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L98)
[src/consoleUtils.mts:98](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L98)

***

Expand All @@ -184,7 +184,7 @@ Print a warning message to the console in yellow.

#### Defined in

[src/consoleUtils.mts:106](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L106)
[src/consoleUtils.mts:106](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L106)

***

Expand All @@ -208,7 +208,7 @@ Text formatted so it appears red.

#### Defined in

[src/consoleUtils.mts:44](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L44)
[src/consoleUtils.mts:44](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L44)

***

Expand All @@ -232,7 +232,7 @@ Text formatted so it appears white.

#### Defined in

[src/consoleUtils.mts:53](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L53)
[src/consoleUtils.mts:53](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L53)

***

Expand All @@ -256,4 +256,4 @@ Text formatted so it appears yellow.

#### Defined in

[src/consoleUtils.mts:62](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/consoleUtils.mts#L62)
[src/consoleUtils.mts:62](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/consoleUtils.mts#L62)
18 changes: 9 additions & 9 deletions documentation/filesystemUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `path?` | `string` | Path where the temporary file should be created. | [src/filesystemUtils.mts:18](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L18) |
| `writerOptions?` | `object` | Options object defined by the first parameter accepted by `BunFile.writer()`. | [src/filesystemUtils.mts:22](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L22) |
| `path?` | `string` | Path where the temporary file should be created. | [src/filesystemUtils.mts:18](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L18) |
| `writerOptions?` | `object` | Options object defined by the first parameter accepted by `BunFile.writer()`. | [src/filesystemUtils.mts:22](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L22) |
| `writerOptions.highWaterMark?` | `number` | - | node\_modules/bun-types/bun.d.ts:1200 |

## Functions
Expand All @@ -35,7 +35,7 @@ The list of inaccessible paths, if any.

#### Defined in

[src/filesystemUtils.mts:34](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L34)
[src/filesystemUtils.mts:34](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L34)

***

Expand All @@ -60,7 +60,7 @@ A localized string representing a file size.

#### Defined in

[src/filesystemUtils.mts:76](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L76)
[src/filesystemUtils.mts:76](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L76)

***

Expand All @@ -86,7 +86,7 @@ A list of paths.

#### Defined in

[src/filesystemUtils.mts:52](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L52)
[src/filesystemUtils.mts:52](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L52)

***

Expand All @@ -110,7 +110,7 @@ Boolean indicating whether or not the path is accessible.

#### Defined in

[src/filesystemUtils.mts:97](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L97)
[src/filesystemUtils.mts:97](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L97)

***

Expand Down Expand Up @@ -146,8 +146,8 @@ Temporary file instance object.

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `[asyncDispose]` | `Promise`\<`void`\> | Asynchronous automatic disposal function. | [src/filesystemUtils.mts:156](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L156) |
| `append` | `Promise`\<`void`\> | Append string contents to the target temporary file. | [src/filesystemUtils.mts:146](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L146) |
| `[asyncDispose]` | `Promise`\<`void`\> | Asynchronous automatic disposal function. | [src/filesystemUtils.mts:156](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L156) |
| `append` | `Promise`\<`void`\> | Append string contents to the target temporary file. | [src/filesystemUtils.mts:146](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L146) |

#### See

Expand All @@ -168,4 +168,4 @@ await file.append('holy data, batman\n');

#### Defined in

[src/filesystemUtils.mts:136](https://github.com/mangs/bun-utils/blob/9040048b4cb11dc405cfdda525d7c16569a4546d/src/filesystemUtils.mts#L136)
[src/filesystemUtils.mts:136](https://github.com/mangs/bun-utils/blob/b2483cf53a52ce0acdae9b1dc610b41280c5d867/src/filesystemUtils.mts#L136)
Loading

0 comments on commit a4596ff

Please sign in to comment.