Skip to content

Commit 09c6157

Browse files
feat(api): api update (#497)
1 parent 119c3df commit 09c6157

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

CONTRIBUTING.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Other package managers may work but are not officially supported for development
55

66
To set up the repository, run:
77

8-
```bash
9-
yarn
10-
yarn build
8+
```sh
9+
$ yarn
10+
$ yarn build
1111
```
1212

1313
This will install all the required dependencies and build output files to `dist/`.
@@ -22,7 +22,7 @@ modify the contents of the `src/lib/` and `examples/` directories.
2222

2323
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
2424

25-
```bash
25+
```ts
2626
// add an example to examples/<your-example>.ts
2727

2828
#!/usr/bin/env -S npm run tsn -T
@@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g
4141

4242
To install via git:
4343

44-
```bash
45-
npm install git+ssh://[email protected]:muxinc/mux-node-sdk.git
44+
```sh
45+
$ npm install git+ssh://[email protected]:muxinc/mux-node-sdk.git
4646
```
4747

4848
Alternatively, to link a local copy of the repo:
4949

50-
```bash
50+
```sh
5151
# Clone
52-
git clone https://www.github.com/muxinc/mux-node-sdk
53-
cd mux-node-sdk
52+
$ git clone https://www.github.com/muxinc/mux-node-sdk
53+
$ cd mux-node-sdk
5454

5555
# With yarn
56-
yarn link
57-
cd ../my-package
58-
yarn link @mux/mux-node
56+
$ yarn link
57+
$ cd ../my-package
58+
$ yarn link @mux/mux-node
5959

6060
# With pnpm
61-
pnpm link --global
62-
cd ../my-package
63-
pnpm link -—global @mux/mux-node
61+
$ pnpm link --global
62+
$ cd ../my-package
63+
$ pnpm link -—global @mux/mux-node
6464
```
6565

6666
## Running tests
6767

6868
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
6969

70-
```bash
71-
npx prism mock path/to/your/openapi.yml
70+
```sh
71+
$ npx prism mock path/to/your/openapi.yml
7272
```
7373

74-
```bash
75-
yarn run test
74+
```sh
75+
$ yarn run test
7676
```
7777

7878
## Linting and formatting
@@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and
8282

8383
To lint:
8484

85-
```bash
86-
yarn lint
85+
```sh
86+
$ yarn lint
8787
```
8888

8989
To format and fix all lint issues automatically:
9090

91-
```bash
92-
yarn fix
91+
```sh
92+
$ yarn fix
9393
```
9494

9595
## Publishing and releases

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,7 @@ The following runtimes are supported:
322322
Note that React Native is not supported at this time.
323323

324324
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
325+
326+
## Contributing
327+
328+
See [the contributing documentation](./CONTRIBUTING.md).

src/core.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ export class APIPromise<T> extends Promise<T> {
8484
});
8585
}
8686

87-
_thenUnwrap<U>(transform: (data: T) => U): APIPromise<U> {
88-
return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props)));
87+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
88+
return new APIPromise(this.responsePromise, async (props) =>
89+
transform(await this.parseResponse(props), props),
90+
);
8991
}
9092

9193
/**

0 commit comments

Comments
 (0)