@orion-js/models 3.0.20 → 3.0.24
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.
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const index_1 = __importDefault(require("./index"));
|
|
7
|
+
const resolvers_1 = require("@orion-js/resolvers");
|
|
7
8
|
it('should validate a schema', async () => {
|
|
8
9
|
const model = (0, index_1.default)({
|
|
9
10
|
name: 'AModel',
|
|
@@ -44,3 +45,28 @@ it('should allow deep model validation', async () => {
|
|
|
44
45
|
expect(error.code).toBe('validationError');
|
|
45
46
|
}
|
|
46
47
|
});
|
|
48
|
+
it('[regression test]: should allow correct doc cleaning for resolver params', async () => {
|
|
49
|
+
const Point = (0, index_1.default)({
|
|
50
|
+
name: 'Point',
|
|
51
|
+
schema: {
|
|
52
|
+
latitude: {
|
|
53
|
+
type: Number
|
|
54
|
+
},
|
|
55
|
+
longitude: {
|
|
56
|
+
type: Number
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const resolver1 = (0, resolvers_1.resolver)({
|
|
61
|
+
params: {
|
|
62
|
+
point: {
|
|
63
|
+
type: Point
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
async resolve({ point }) {
|
|
67
|
+
return point;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const doc = await resolver1.resolve({ point: { latitude: '11', longitude: '12' } });
|
|
71
|
+
expect(doc).toEqual({ latitude: 11, longitude: 12 });
|
|
72
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/models",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.24",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@orion-js/helpers": "^3.0.17",
|
|
21
|
-
"@orion-js/resolvers": "^3.0.
|
|
21
|
+
"@orion-js/resolvers": "^3.0.24",
|
|
22
22
|
"@orion-js/schema": "^3.0.17"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5ac1c68e72af3dbeaf8eb5c2a04d5325da2a7e3f"
|
|
40
40
|
}
|