typeorm-extensions 2.2.0-rc.0 → 2.2.0-rc.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.
|
@@ -130,10 +130,11 @@ async function readWithTotals(builder, paginationFilter, options, read) {
|
|
|
130
130
|
*/
|
|
131
131
|
async function bothOrFirstError(first, second) {
|
|
132
132
|
const [a, b] = await Promise.all([settle(first), settle(second)]);
|
|
133
|
-
|
|
133
|
+
// `=== false`: without strictNullChecks `!fulfilled` doesn't narrow the union
|
|
134
|
+
if (a.fulfilled === false) {
|
|
134
135
|
throw a.reason;
|
|
135
136
|
}
|
|
136
|
-
if (
|
|
137
|
+
if (b.fulfilled === false) {
|
|
137
138
|
throw b.reason;
|
|
138
139
|
}
|
|
139
140
|
return [a.value, b.value];
|
|
@@ -8,6 +8,10 @@ declare class TypedRootMark<Root> {
|
|
|
8
8
|
* with an optional symbol method that only types carry. Entities loaded with it are plain entities.
|
|
9
9
|
*/
|
|
10
10
|
export type WithTypedRoot<Entity, Root extends ObjectLiteral> = Entity & TypedRootMark<Root>;
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The root of a builder's typed callbacks: the one set with `typed<Root>()`, or else its entity. The key check
|
|
13
|
+
* comes first: without `strictNullChecks` an entity with an index signature (`ObjectLiteral`) matches the
|
|
14
|
+
* optional mark too, and its root would be inferred as `unknown`.
|
|
15
|
+
*/
|
|
16
|
+
export type TypedRoot<Entity> = typeof typedRoot extends keyof Entity ? Entity extends TypedRootMark<infer Root> ? Root extends ObjectLiteral ? Root : Entity : Entity : Entity;
|
|
13
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typeorm-extensions",
|
|
3
|
-
"version": "2.2.0-rc.
|
|
3
|
+
"version": "2.2.0-rc.1",
|
|
4
4
|
"description": "typeorm commonly used extensions",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc -p .",
|
|
16
16
|
"lint": "eslint . --ext .ts",
|
|
17
|
-
"test:types": "tsc -p test/types"
|
|
17
|
+
"test:types": "tsc -p test/types && tsc -p test/types/tsconfig.loose.json"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"typeorm",
|