@quenty/promise 3.6.0 → 4.0.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@3.6.0...@quenty/promise@4.0.0) (2022-03-06)
7
+
8
+
9
+ ### Performance Improvements
10
+
11
+ * Return the promise transparently is we only have one promise ([f717878](https://github.com/Quenty/NevermoreEngine/commit/f7178782904ed8fc425365bb0c41f3ffd63ab013))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/promise@3.5.1...@quenty/promise@3.6.0) (2022-01-17)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/promise
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/promise",
3
- "version": "3.6.0",
3
+ "version": "4.0.0",
4
4
  "description": "Promise implementation for Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,11 +26,11 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@quenty/deferred": "^2.0.2",
29
- "@quenty/loader": "^3.4.0",
29
+ "@quenty/loader": "^4.0.0",
30
30
  "@quenty/maid": "^2.1.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "c094ba8f4e128cdff08919d89de226d3d65247ce"
35
+ "gitHead": "dd428cab58282c975a4c082957dc8f58e3186905"
36
36
  }
@@ -36,12 +36,18 @@ end
36
36
  Executes all promises. If any fails, the result will be rejected. However, it yields until
37
37
  every promise is complete.
38
38
 
39
+ :::warning
40
+ Passing in a spare array (i.e. {nil, promise}) will result in undefined behavior here.
41
+ :::
42
+
39
43
  @param promises { Promise<T> }
40
44
  @return Promise<T>
41
45
  ]=]
42
46
  function PromiseUtils.all(promises)
43
47
  if #promises == 0 then
44
48
  return Promise.resolved()
49
+ elseif #promises == 1 then
50
+ return promises[1]
45
51
  end
46
52
 
47
53
  local remainingCount = #promises