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

@naturalcycles/db-lib

Package Overview
Dependencies
Maintainers
0
Versions
301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@naturalcycles/db-lib - npm Package Compare versions

Comparing version 9.24.2 to 9.25.0

12

dist/commondao/common.dao.js

@@ -971,3 +971,15 @@ "use strict";

// Joi
const start = performance.now();
const vr = (0, nodejs_lib_1.getValidationResult)(obj, schema, objectName);
const end = performance.now();
const tookMillis = end - start;
if (this.cfg.debugValidationTimeThreshhold &&
tookMillis >= this.cfg.debugValidationTimeThreshhold) {
this.cfg.onValidationTimeThreshold?.({
tookMillis,
error: !!vr.error,
table,
obj,
});
}
error = vr.error;

@@ -974,0 +986,0 @@ convertedValue = vr.value;

11

dist/commondao/common.dao.model.d.ts

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

import { BaseDBEntity, CommonLogger, ErrorMode, Promisable, UnixTimestamp, ZodError, ZodSchema } from '@naturalcycles/js-lib';
import { AnyObject, BaseDBEntity, CommonLogger, ErrorMode, NumberOfMilliseconds, Promisable, UnixTimestamp, ZodError, ZodSchema } from '@naturalcycles/js-lib';
import { AjvSchema, AjvValidationError, JoiValidationError, ObjectSchema, TransformLogProgressOptions, TransformMapOptions } from '@naturalcycles/nodejs-lib';

@@ -115,2 +115,11 @@ import { CommonDB } from '../common.db';

/**
* Defaults to undefined == disabled.
* If set - enable the monitoring of validation time and will alert on crossing the threshold.
*/
debugValidationTimeThreshhold?: NumberOfMilliseconds;
/**
* Called when debugValidationTimeThreshhold is crossed.
*/
onValidationTimeThreshold?: (info: AnyObject) => void;
/**
* Defaults to false.

@@ -117,0 +126,0 @@ * Setting it to true will set saveMethod to `insert` for save/saveBatch, which will

4

package.json

@@ -46,5 +46,5 @@ {

"engines": {
"node": ">=20.13"
"node": ">=22.10.0"
},
"version": "9.24.2",
"version": "9.25.0",
"description": "Lowest Common Denominator API to supported Databases",

@@ -51,0 +51,0 @@ "keywords": [

import {
AnyObject,
BaseDBEntity,
CommonLogger,
ErrorMode,
NumberOfMilliseconds,
Promisable,

@@ -150,2 +152,13 @@ UnixTimestamp,

/**
* Defaults to undefined == disabled.
* If set - enable the monitoring of validation time and will alert on crossing the threshold.
*/
debugValidationTimeThreshhold?: NumberOfMilliseconds
/**
* Called when debugValidationTimeThreshhold is crossed.
*/
onValidationTimeThreshold?: (info: AnyObject) => void
/**
* Defaults to false.

@@ -152,0 +165,0 @@ * Setting it to true will set saveMethod to `insert` for save/saveBatch, which will

@@ -1260,3 +1260,19 @@ import { Transform } from 'node:stream'

// Joi
const start = performance.now()
const vr = getValidationResult(obj, schema, objectName)
const end = performance.now()
const tookMillis = end - start
if (
this.cfg.debugValidationTimeThreshhold &&
tookMillis >= this.cfg.debugValidationTimeThreshhold
) {
this.cfg.onValidationTimeThreshold?.({
tookMillis,
error: !!vr.error,
table,
obj,
})
}
error = vr.error

@@ -1263,0 +1279,0 @@ convertedValue = vr.value

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