got 12.2.0 → 12.3.0

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.
@@ -128,6 +128,10 @@ export default function asPromise(firstRequest) {
128
128
  emitter.on(event, fn);
129
129
  return promise;
130
130
  };
131
+ promise.off = (event, fn) => {
132
+ emitter.off(event, fn);
133
+ return promise;
134
+ };
131
135
  const shortcut = (responseType) => {
132
136
  const newPromise = (async () => {
133
137
  // Wait until downloading has ended
@@ -87,6 +87,7 @@ See `got.options.retry` for more information.
87
87
  export interface RequestEvents<T> {
88
88
  on: GotEventFunction<T>;
89
89
  once: GotEventFunction<T>;
90
+ off: GotEventFunction<T>;
90
91
  }
91
92
  export declare type CacheableRequestFunction = (options: string | URL | NativeRequestOptions, cb?: (response: ServerResponse | ResponseLike) => void) => CacheableRequest.Emitter;
92
93
  declare type UrlType = ConstructorParameters<typeof Options>[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "got",
3
- "version": "12.2.0",
3
+ "version": "12.3.0",
4
4
  "description": "Human-friendly and powerful HTTP request library for Node.js",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/got",
package/readme.md CHANGED
@@ -46,41 +46,6 @@
46
46
  <br>
47
47
  <br>
48
48
  <br>
49
- <a href="https://neverinstall.com/spaces/devtools?utm_source=github&utm_medium=sponsor&utm_campaign=sindre#gh-light-mode-only">
50
- <div>
51
- <img src="https://sindresorhus.com/assets/thanks/neverinstall-logo-light.svg" width="200" alt="neverinstall">
52
- </div>
53
- <br>
54
- <b>All your favourite IDE's now available on the cloud</b>
55
- <div>
56
- <sub>
57
- Neverinstall gives you an uninterrupted development experience and improved accessibility,
58
- <br>
59
- allowing you to code faster, better and on-the-go on your favourite IDEs like
60
- <br>
61
- Android Studio, VS Code, Jupyter and PyCharm using your browser.
62
- </sub>
63
- </div>
64
- </a>
65
- <a href="https://neverinstall.com/spaces/devtools?utm_source=github&utm_medium=sponsor&utm_campaign=sindre#gh-dark-mode-only">
66
- <div>
67
- <img src="https://sindresorhus.com/assets/thanks/neverinstall-logo-dark.svg" width="200" alt="neverinstall">
68
- </div>
69
- <br>
70
- <b>All your favourite IDE's now available on the cloud</b>
71
- <div>
72
- <sub>
73
- Neverinstall gives you an uninterrupted development experience and improved accessibility,
74
- <br>
75
- allowing you to code faster, better and on-the-go on your favourite IDEs like
76
- <br>
77
- Android Studio, VS Code, Jupyter and PyCharm using your browser.
78
- </sub>
79
- </div>
80
- </a>
81
- <br>
82
- <br>
83
- <br>
84
49
  <a href="https://www.useanvil.com/?utm_source=sindresorhus#gh-light-mode-only">
85
50
  <div>
86
51
  <img src="https://sindresorhus.com/assets/thanks/anvil-logo-light.svg" width="200" alt="Anvil">