@orion-js/schema 3.0.36 → 3.1.6
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/LICENSE +1 -1
- package/lib/clean/index.test.js +13 -0
- package/package.json +2 -2
package/LICENSE
CHANGED
package/lib/clean/index.test.js
CHANGED
|
@@ -467,3 +467,16 @@ test('pass currentDoc cleaning complex schemas', async () => {
|
|
|
467
467
|
// @ts-ignore TODO: Check why the __clean method is being used here instead of clean
|
|
468
468
|
await (0, index_1.default)(schema, doc);
|
|
469
469
|
});
|
|
470
|
+
test('On blackbox allow use of custom clean', async () => {
|
|
471
|
+
const schema = {
|
|
472
|
+
info: {
|
|
473
|
+
type: 'blackbox',
|
|
474
|
+
optional: true,
|
|
475
|
+
async clean(info, { doc }) {
|
|
476
|
+
return { hello: 'world' };
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
const result = await (0, index_1.default)(schema, { info: { hello: 'night' } });
|
|
481
|
+
expect(result).toEqual({ info: { hello: 'world' } });
|
|
482
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/schema",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "cb180a6a89ee2042f9d3dc80725f3aa05705a963"
|
|
40
40
|
}
|