@takeshape/schema 8.276.0 → 8.278.3
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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ProjectSchema, PropertySchema, Query, Shape } from '../project-schema';
|
|
2
|
-
export declare function getReturnShape(projectSchema: ProjectSchema, propOrQuery: PropertySchema | Query): Shape;
|
|
2
|
+
export declare function getReturnShape(projectSchema: ProjectSchema, propOrQuery: PropertySchema | Query): Shape | undefined;
|
|
3
3
|
//# sourceMappingURL=get-return-shape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-return-shape.d.ts","sourceRoot":"","sources":["../../../src/util/get-return-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-return-shape.d.ts","sourceRoot":"","sources":["../../../src/util/get-return-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAuB9E,wBAAgB,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAQnH"}
|
|
@@ -27,10 +27,6 @@ function getReturnShapeHelper(projectSchema, propOrQuery) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
if (!shape) {
|
|
31
|
-
throw new Error(`Unable to find return shape for ${JSON.stringify(propOrQuery)}`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
30
|
return shape;
|
|
35
31
|
}
|
|
36
32
|
|
|
@@ -39,10 +35,10 @@ const cache = new WeakMap();
|
|
|
39
35
|
function getReturnShape(projectSchema, propOrQuery) {
|
|
40
36
|
let result = cache.get(propOrQuery);
|
|
41
37
|
|
|
42
|
-
if (
|
|
38
|
+
if (result === undefined) {
|
|
43
39
|
result = getReturnShapeHelper(projectSchema, propOrQuery);
|
|
44
|
-
cache.set(propOrQuery, result);
|
|
40
|
+
cache.set(propOrQuery, result ?? null);
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
return result;
|
|
43
|
+
return result ?? undefined;
|
|
48
44
|
}
|
|
@@ -20,10 +20,6 @@ function getReturnShapeHelper(projectSchema, propOrQuery) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (!shape) {
|
|
24
|
-
throw new Error(`Unable to find return shape for ${JSON.stringify(propOrQuery)}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
23
|
return shape;
|
|
28
24
|
}
|
|
29
25
|
|
|
@@ -31,10 +27,10 @@ const cache = new WeakMap();
|
|
|
31
27
|
export function getReturnShape(projectSchema, propOrQuery) {
|
|
32
28
|
let result = cache.get(propOrQuery);
|
|
33
29
|
|
|
34
|
-
if (
|
|
30
|
+
if (result === undefined) {
|
|
35
31
|
result = getReturnShapeHelper(projectSchema, propOrQuery);
|
|
36
|
-
cache.set(propOrQuery, result);
|
|
32
|
+
cache.set(propOrQuery, result ?? null);
|
|
37
33
|
}
|
|
38
34
|
|
|
39
|
-
return result;
|
|
35
|
+
return result ?? undefined;
|
|
40
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.278.3",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"p-reduce": "^2.1.0",
|
|
31
31
|
"semver": "^7.3.2",
|
|
32
32
|
"tiny-invariant": "^1.2.0",
|
|
33
|
-
"@takeshape/errors": "8.
|
|
34
|
-
"@takeshape/util": "8.
|
|
35
|
-
"@takeshape/json-schema": "8.
|
|
33
|
+
"@takeshape/errors": "8.278.3",
|
|
34
|
+
"@takeshape/util": "8.278.3",
|
|
35
|
+
"@takeshape/json-schema": "8.278.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@takeshape/json-schema-to-typescript": "^11.0.0",
|