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

@oridune/epic-odm

Package Overview
Dependencies
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oridune/epic-odm - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18

2

package.json
{
"name": "@oridune/epic-odm",
"version": "1.0.17",
"version": "1.0.18",
"description": "Install 1 ODM and code once with any database driver.",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -64,16 +64,16 @@ "use strict";

async _create(connection, command, options) {
// Create insert function
const InsertItems = async (payload) => {
// Insertables
const Insertables = payload.filter((_) => !_._id);
// Create items function
const CreateItems = async (payload) => {
// Collect Insertables
// Validate Insertables before create
const Insertables = await options.database["validateSchema"](command.model, payload.filter((_) => !_._id), {
fieldsList: options.project.getFieldsList(),
mode: "create",
});
return (Insertables.length
? await options.database["resolveSchema"](command.model, await this.create(connection, command.model, payload))
? await options.database["resolveSchema"](command.model, await this.create(connection, command.model, Insertables))
: await options.database["resolveSchema"](command.model, payload)).map((item) => command.model.new(item));
};
// Validate payload before insert
// Insert Items
const Items = await InsertItems(await options.database["validateSchema"](command.model, command.payload, {
fieldsList: options.project.getFieldsList(),
mode: "create",
}));
// Create Items
const Items = await CreateItems(command.payload);
// Get Model Options

@@ -80,0 +80,0 @@ const ModelOptions = (0, model_1.getModelOptions)(command.model);

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