Socket
Socket
Sign inDemoInstall

@oridune/epic-odm

Package Overview
Dependencies
3
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.7 to 1.1.8

2

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

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

@@ -26,5 +26,5 @@ import { GraphQLObjectType, GraphQLList } from "graphql";

/** Set minimum length */
minLength?: number;
minLength?: number | (() => number);
/** Set maximum length (Set null for unlimited length in SQL) */
length?: number | null;
length?: number | null | (() => number | null);
/** Is this field nullable? */

@@ -31,0 +31,0 @@ nullable?: boolean;

@@ -59,10 +59,16 @@ "use strict";

throw new Error(`The value '${value}' provided for field '${name}' does not match the pattern '${options.match}'!`);
if (typeof options.minLength === "number" && options.minLength >= 0)
if (((_b = (((_a = value.toString) === null || _a === void 0 ? void 0 : _a.call(value)) || value)) === null || _b === void 0 ? void 0 : _b.length) < options.minLength)
const MinLength = typeof options.minLength === "function"
? options.minLength()
: options.minLength;
if (typeof MinLength === "number" && MinLength >= 0)
if (((_b = (((_a = value.toString) === null || _a === void 0 ? void 0 : _a.call(value)) || value)) === null || _b === void 0 ? void 0 : _b.length) < MinLength)
// Minimum Length Validation
throw new Error(`Value length (${(_d = (((_c = value.toString) === null || _c === void 0 ? void 0 : _c.call(value)) || value)) === null || _d === void 0 ? void 0 : _d.length}) for field '${name}' is smaller than expected length which is ${options.minLength}!`);
throw new Error(`Value length (${(_d = (((_c = value.toString) === null || _c === void 0 ? void 0 : _c.call(value)) || value)) === null || _d === void 0 ? void 0 : _d.length}) for field '${name}' is smaller than expected length which is ${MinLength}!`);
const Length = typeof options.length === "function"
? options.length()
: options.length;
// Maximum Length Validation
if (typeof options.length === "number" && options.length >= 0)
if (((_f = (((_e = value.toString) === null || _e === void 0 ? void 0 : _e.call(value)) || value)) === null || _f === void 0 ? void 0 : _f.length) > options.length)
throw new Error(`Value length (${(_h = (((_g = value.toString) === null || _g === void 0 ? void 0 : _g.call(value)) || value)) === null || _h === void 0 ? void 0 : _h.length}) for field '${name}' is greater than expected length which is ${options.length}!`);
if (typeof Length === "number" && Length >= 0)
if (((_f = (((_e = value.toString) === null || _e === void 0 ? void 0 : _e.call(value)) || value)) === null || _f === void 0 ? void 0 : _f.length) > Length)
throw new Error(`Value length (${(_h = (((_g = value.toString) === null || _g === void 0 ? void 0 : _g.call(value)) || value)) === null || _h === void 0 ? void 0 : _h.length}) for field '${name}' is greater than expected length which is ${Length}!`);
}

@@ -111,6 +117,9 @@ return value;

typeof options.choices === "function") &&
options.length === undefined) {
const Choices = options.choices instanceof Array ? options.choices : options.choices();
options.length = Math.max(...Choices.map((c) => c.toString().length));
}
options.length === undefined)
options.length = () => {
const Choices = options.choices instanceof Array
? options.choices
: options.choices();
return Math.max(...Choices.map((c) => c.toString().length));
};
else if (options.type === Object && options.length === undefined)

@@ -117,0 +126,0 @@ options.length = null;

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