Skip to content

Commit e8d9ae0

Browse files
author
Ivan Mirić
committed
Bring back Array type docs for FileData, rename bytes for open()
There's no `bytes` type in JS and in TS it's represented as `number[]`, so it's best to use `Array` here instead.
1 parent a30aafb commit e8d9ae0

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/data/markdown/docs/02 javascript api/01 Init context/open.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ See example further down on this page. For more in-depth description see [Runnin
2626

2727
### Returns
2828

29-
| Type | Description |
30-
| -------------- | ---------------------------------------------------------------------------------------- |
31-
| string / bytes | The contents of the file, read as text or bytes (if `b` has been specified as the mode). |
29+
| Type | Description |
30+
| -------------- | ---------------------------------------------------------------------------------------------------- |
31+
| string / Array | The contents of the file, returned as string or array of numbers (if `b` was specified as the mode). |
3232

3333
<CodeGroup labels={["users.json"]}>
3434

src/data/markdown/docs/02 javascript api/07 k6-http/10-file- data- -filename-- -contentType- -.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ description: 'Create a file object that is used for building multi-part requests
55

66
Create a file object that is used for building [Multipart requests (file uploads)](/examples/data-uploads#multipart-request-uploading-a-file).
77

8-
| Parameter | Type | Description |
9-
| ----------- | -------------------- | -------------------------------------------------------------------------------- |
10-
| data | string / ArrayBuffer | File data as string or an `ArrayBuffer` object. |
11-
| filename | string | The filename to specify for this field (or "part") of the multipart request. |
12-
| contentType | string | The content type to specify for this field (or "part") of the multipart request. |
8+
| Parameter | Type | Description |
9+
| ----------- | ---------------------------- | -------------------------------------------------------------------------------- |
10+
| data | string / Array / ArrayBuffer | File data as string, array of numbers, or an `ArrayBuffer` object. |
11+
| filename | string | The filename to specify for this field (or "part") of the multipart request. |
12+
| contentType | string | The content type to specify for this field (or "part") of the multipart request. |
1313

1414
### Returns
1515

src/data/markdown/docs/02 javascript api/07 k6-http/60-FileData.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ _FileData_ is an object for wrapping data representing a file when doing
77
[multipart requests (file uploads)](/examples/data-uploads#multipart-request-uploading-a-file).
88
You create it by calling [http.file( data, [filename], [contentType] )](/javascript-api/k6-http/file-data-filename-contenttype).
99

10-
| Name | Type | Description |
11-
| --------------------- | -------------------- | ------------------------------------------------------------------------ |
12-
| FileData.data | string / ArrayBuffer | File data as string or an `ArrayBuffer` object. |
13-
| FileData.content_type | string | The content type that will be specified in the multipart request. |
14-
| FileData.filename | string | The filename that will be specified in the multipart request. |
10+
| Name | Type | Description |
11+
| --------------------- | ---------------------------- | ------------------------------------------------------------------------ |
12+
| FileData.data | string / Array / ArrayBuffer | File data as string, array of numbers, or an `ArrayBuffer` object. |
13+
| FileData.content_type | string | The content type that will be specified in the multipart request. |
14+
| FileData.filename | string | The filename that will be specified in the multipart request. |
1515

1616
### Example
1717

0 commit comments

Comments
 (0)