Socket
Socket
Sign inDemoInstall

@orion-js/models

Package Overview
Dependencies
19
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.17 to 3.0.20

lib/createModel/modelToSchema.test.d.ts

10

lib/createModel/index.js

@@ -21,2 +21,11 @@ "use strict";

const schema = (0, resolveParam_1.default)(modelOptions.schema);
resolvedSchema = (0, modelToSchema_1.default)(schema, model);
return resolvedSchema;
};
const getCleanSchema = () => {
if (!modelOptions.schema)
return {};
if (resolvedSchema)
return resolvedSchema;
const schema = (0, resolveParam_1.default)(modelOptions.schema);
resolvedSchema = (0, modelToSchema_1.default)(schema);

@@ -42,2 +51,3 @@ return resolvedSchema;

getSchema,
getCleanSchema,
getResolvers,

@@ -44,0 +54,0 @@ initItem: modelInitItem,

3

lib/createModel/modelToSchema.d.ts

@@ -1,1 +0,2 @@

export default function (schema: any): any;
import { Model } from '..';
export default function (schema: any, model?: Model): any;

@@ -8,3 +8,3 @@ "use strict";

const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
function default_1(schema) {
function default_1(schema, model) {
schema = (0, cloneDeep_1.default)(schema);

@@ -22,4 +22,9 @@ const keys = Object.keys(schema);

}
return schema;
if (!model)
return schema;
return {
...schema,
__model: model
};
}
exports.default = default_1;

@@ -52,4 +52,10 @@ import { GlobalResolverResolve, ModelResolverResolve, Resolver } from '@orion-js/resolvers';

*/
getSchema: () => Schema;
getSchema: () => Schema & {
__model: Model;
};
/**
* Returns the schema without adding __model to the schema
*/
getCleanSchema: () => Schema;
/**
* Returns the model resolvers

@@ -56,0 +62,0 @@ */

{
"name": "@orion-js/models",
"version": "3.0.17",
"version": "3.0.20",
"main": "lib/index.js",

@@ -39,3 +39,3 @@ "types": "lib/index.d.ts",

},
"gitHead": "55e56828a55b355ec68f91c11d942676bbeb241b"
"gitHead": "ed37da2a1a61a9a4c0b9935d77e29d83a423e199"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc