Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ark7/model-mongoose

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ark7/model-mongoose - npm Package Compare versions

Comparing version 1.0.20 to 1.0.21

12

mongoose-manager.d.ts

@@ -27,3 +27,3 @@ import * as mongoose from 'mongoose';

getMongooseOptions(model: string | ModelClass<any>): MongooseOptions;
mapPropertyType(type: runtime.Type): any;
mapPropertyType(type: runtime.Type): MongooseType;
}

@@ -45,2 +45,10 @@ export declare const mongooseManager: MongooseManager;

}
export interface MongooseType {
type: any;
default?: any;
trim?: boolean;
of?: any;
ref?: any;
enum?: (number | string)[];
}
/**

@@ -56,3 +64,3 @@ * Mongoose options for current model.

};
mongooseSchema?: mongoose.Schema | object;
mongooseSchema?: mongoose.Schema | MongooseType;
pres: Pre[];

@@ -59,0 +67,0 @@ posts: Post[];

16

mongoose-manager.js

@@ -355,10 +355,10 @@ "use strict";

const type = manager.mapPropertyType(field.prop.type);
underscore_1.default.defaults(target, options.schema[prop.name], underscore_1.default.isObject(type) && !underscore_1.default.isFunction(type) && type.type != null
? underscore_1.default.extend(type, {
required: !prop.optional,
})
: {
type,
required: !prop.optional,
});
if (type.type instanceof mongoose.Schema &&
!field.prop.optional &&
type.default == null) {
type.default = () => ({});
}
underscore_1.default.defaults(target, options.schema[prop.name], underscore_1.default.extend(type, {
required: !prop.optional,
}));
}

@@ -365,0 +365,0 @@ }

{
"name": "@ark7/model-mongoose",
"version": "1.0.20",
"version": "1.0.21",
"description": "Type-script friendly, object-oriented, database modeling framework",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc