make-service 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
[](https://www.npmjs.org/package/make-service)
|
|
2
|
+

|
|
3
|
+
[](#contributors)
|
|
4
|
+
|
|
1
5
|
# make-service
|
|
2
6
|
|
|
3
7
|
A type-safe thin wrapper around the `fetch` API to better interact with external APIs.
|
|
@@ -580,6 +584,27 @@ const url = replaceURLParams(
|
|
|
580
584
|
|
|
581
585
|
The params will be **strongly-typed** which means they will be validated against the URL structure and will not type-check if the given object does not match that structure.
|
|
582
586
|
|
|
587
|
+
# Contributors
|
|
588
|
+
|
|
589
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
590
|
+
<!-- prettier-ignore-start -->
|
|
591
|
+
<!-- markdownlint-disable -->
|
|
592
|
+
<table>
|
|
593
|
+
<tbody>
|
|
594
|
+
<tr>
|
|
595
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gustavoguichard"><img src="https://avatars.githubusercontent.com/u/566971?v=4?s=100" width="100px;" alt="Guga Guichard"/><br /><sub><b>Guga Guichard</b></sub></a><br /><a href="#code-gustavoguichard" title="Code">💻</a> <a href="#projectManagement-gustavoguichard" title="Project Management">📆</a> <a href="#promotion-gustavoguichard" title="Promotion">📣</a> <a href="#maintenance-gustavoguichard" title="Maintenance">🚧</a> <a href="#doc-gustavoguichard" title="Documentation">📖</a> <a href="#bug-gustavoguichard" title="Bug reports">🐛</a> <a href="#infra-gustavoguichard" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#question-gustavoguichard" title="Answering Questions">💬</a> <a href="#research-gustavoguichard" title="Research">🔬</a> <a href="#review-gustavoguichard" title="Reviewed Pull Requests">👀</a> <a href="#ideas-gustavoguichard" title="Ideas, Planning, & Feedback">🤔</a> <a href="#example-gustavoguichard" title="Examples">💡</a></td>
|
|
596
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/danielweinmann"><img src="https://avatars.githubusercontent.com/u/204765?v=4?s=100" width="100px;" alt="Daniel Weinmann"/><br /><sub><b>Daniel Weinmann</b></sub></a><br /><a href="#code-danielweinmann" title="Code">💻</a> <a href="#promotion-danielweinmann" title="Promotion">📣</a> <a href="#ideas-danielweinmann" title="Ideas, Planning, & Feedback">🤔</a> <a href="#doc-danielweinmann" title="Documentation">📖</a> <a href="#bug-danielweinmann" title="Bug reports">🐛</a></td>
|
|
597
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/diogob"><img src="https://avatars.githubusercontent.com/u/20662?v=4?s=100" width="100px;" alt="Diogo Biazus"/><br /><sub><b>Diogo Biazus</b></sub></a><br /><a href="#code-diogob" title="Code">💻</a></td>
|
|
598
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/garusis"><img src="https://avatars.githubusercontent.com/u/15615652?v=4?s=100" width="100px;" alt="Marcos Javier Alvarez Maestre"/><br /><sub><b>Marcos Javier Alvarez Maestre</b></sub></a><br /><a href="#code-garusis" title="Code">💻</a> <a href="#bug-garusis" title="Bug reports">🐛</a></td>
|
|
599
|
+
</tr>
|
|
600
|
+
</tbody>
|
|
601
|
+
</table>
|
|
602
|
+
|
|
603
|
+
<!-- markdownlint-restore -->
|
|
604
|
+
<!-- prettier-ignore-end -->
|
|
605
|
+
|
|
606
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
607
|
+
|
|
583
608
|
# Acknowledgements
|
|
584
609
|
This library is part of a code I've been carrying around for a while through many projects.
|
|
585
610
|
|
package/dist/index.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ declare function makeService(baseURL: string | URL, baseOptions?: BaseOptions):
|
|
|
110
110
|
* @param searchParams the query parameters
|
|
111
111
|
* @returns the url with the query parameters added with the same type as the url
|
|
112
112
|
*/
|
|
113
|
-
declare function addQueryToURL
|
|
113
|
+
declare function addQueryToURL<T extends string | URL>(url: T, searchParams?: SearchParams): T;
|
|
114
114
|
/**
|
|
115
115
|
* @param body the JSON-like body of the request
|
|
116
116
|
* @returns the body is stringified if it is not a string and it is a JSON-like object. It also accepts other types of BodyInit such as Blob, ReadableStream, etc.
|