Socket
Socket
Sign inDemoInstall

simpl-schema

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpl-schema - npm Package Compare versions

Comparing version 3.4.4 to 3.4.5

13

dist/cjs/clean/getPositionsForAutoValue.js

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

*/
function getPositionsForAutoValue({ fieldName, isModifier, mongoObject }) {
function getPositionsForAutoValue({ fieldName, isModifier, isUpsert, mongoObject }) {
// Positions for this field

@@ -109,4 +109,15 @@ const positions = mongoObject.getPositionsInfoForGenericKey(fieldName);

}
// If we made it this far, we still want to call the autoValue
// function once for the field, so we'll add a would-be position for it.
if (positions.length === 0 && isModifier === true && isUpsert !== true) {
positions.push({
key: fieldName,
// @ts-expect-error incorrect type in mongo-object package
value: undefined,
operator: '$set',
position: `$set[${fieldName}]`
});
}
return positions;
}
exports.default = getPositionsForAutoValue;

@@ -58,2 +58,3 @@ "use strict";

isModifier,
isUpsert,
mongoObject

@@ -60,0 +61,0 @@ });

3

dist/esm/clean/getPositionsForAutoValue.d.ts

@@ -5,2 +5,3 @@ import MongoObject from 'mongo-object';

isModifier?: boolean;
isUpsert?: boolean;
mongoObject: MongoObject;

@@ -38,3 +39,3 @@ }

*/
export default function getPositionsForAutoValue({ fieldName, isModifier, mongoObject }: GetPositionsForAutoValueProps): PositionInfo[];
export default function getPositionsForAutoValue({ fieldName, isModifier, isUpsert, mongoObject }: GetPositionsForAutoValueProps): PositionInfo[];
export {};

@@ -28,3 +28,3 @@ import MongoObject from 'mongo-object';

*/
export default function getPositionsForAutoValue({ fieldName, isModifier, mongoObject }) {
export default function getPositionsForAutoValue({ fieldName, isModifier, isUpsert, mongoObject }) {
// Positions for this field

@@ -104,3 +104,14 @@ const positions = mongoObject.getPositionsInfoForGenericKey(fieldName);

}
// If we made it this far, we still want to call the autoValue
// function once for the field, so we'll add a would-be position for it.
if (positions.length === 0 && isModifier === true && isUpsert !== true) {
positions.push({
key: fieldName,
// @ts-expect-error incorrect type in mongo-object package
value: undefined,
operator: '$set',
position: `$set[${fieldName}]`
});
}
return positions;
}

@@ -51,2 +51,3 @@ import AutoValueRunner from './AutoValueRunner.js';

isModifier,
isUpsert,
mongoObject

@@ -53,0 +54,0 @@ });

{
"name": "simpl-schema",
"version": "3.4.4",
"version": "3.4.5",
"description": "A schema validation package that supports direct validation of MongoDB update modifier objects.",

@@ -5,0 +5,0 @@ "author": "Eric Dobbertin <eric@dairystatedesigns.com>",

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