New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dryvjs

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dryvjs - npm Package Compare versions

Comparing version 1.0.0-pre-1 to 1.0.0-pre-10

dist/core/isDryvValidatable.d.ts

5

dist/core/annotate.js

@@ -22,6 +22,5 @@ import { isDryvValidatable } from './';

function annotateValidatable(validatable, ruleSet) {
var _a, _b, _c;
validatable.required =
(_c = (_b = (_a = ruleSet.validators) === null || _a === void 0 ? void 0 : _a[validatable.field]) === null || _b === void 0 ? void 0 : _b.find((rule) => { var _a; return (_a = rule.annotations) === null || _a === void 0 ? void 0 : _a.required; })) !== null && _c !== void 0 ? _c : false;
var _a, _b;
validatable.required = !!((_b = (_a = ruleSet.validators) === null || _a === void 0 ? void 0 : _a[validatable.field]) === null || _b === void 0 ? void 0 : _b.find((rule) => { var _a; return (_a = rule.annotations) === null || _a === void 0 ? void 0 : _a.required; }));
}
//# sourceMappingURL=annotate.js.map

2

dist/core/dryvProxy.js
import { dryvProxyHandler } from './dryvProxyHandler';
import { defaultDryvOptions } from './defaultDryvOptions';
import { isDryvProxy } from '../core';
import { isDryvProxy } from './isDryvProxy';
export function dryvProxy(model, field, session, options) {

@@ -5,0 +5,0 @@ if (!model) {

import { dryvProxy, isDryvProxy } from '.';
import { isDryvValidatable } from '../core';
import { isDryvValidatable } from './isDryvValidatable';
import { dryvValidatableObject } from './dryvValidatableObject';

@@ -20,3 +20,3 @@ import { dryvValidatableValue } from './dryvValidatableValue';

let resultValue;
if (typeof originalValue === 'object') {
if (originalValue && typeof originalValue === 'object') {
resultValue = ensureObjectProxy(originalValue, field, receiver, session);

@@ -51,3 +51,3 @@ if (resultValue !== originalValue) {

let proxy = undefined;
if (typeof value === 'object') {
if (value && typeof value === 'object') {
targetValue = ensureObjectProxy(value, field, receiver, session);

@@ -54,0 +54,0 @@ }

@@ -10,4 +10,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import { isDryvValidatable } from '../core';
import { dryvValidatableValue } from '../core/dryvValidatableValue';
import { isDryvValidatable } from './isDryvValidatable';
import { dryvValidatableValue } from './dryvValidatableValue';
export function dryvValidatableObject(field, parentOrSession, model, options) {

@@ -37,3 +37,3 @@ let _parent = isDryvValidatable(parentOrSession)

group: null,
status: null,
type: null,
required: null,

@@ -54,6 +54,6 @@ get value() {

get hasError() {
return this.status === 'error';
return this.type === 'error';
},
get hasWarning() {
return this.status === 'warning';
return this.type === 'warning';
},

@@ -74,3 +74,3 @@ get path() {

clear() {
validatable.status = null;
validatable.type = null;
validatable.text = null;

@@ -77,0 +77,0 @@ validatable.group = null;

@@ -16,3 +16,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

group: null,
status: null,
type: null,
get value() {

@@ -34,6 +34,6 @@ return getter();

get hasError() {
return this.status === 'error';
return this.type === 'error';
},
get hasWarning() {
return this.status === 'warning';
return this.type === 'warning';
},

@@ -53,3 +53,3 @@ validate() {

clear() {
validatable.status = null;
validatable.type = null;
validatable.text = null;

@@ -61,6 +61,6 @@ validatable.group = null;

const message = messages === null || messages === void 0 ? void 0 : messages[this.path];
if (message && message.status !== 'success') {
if (message && message.type !== 'success') {
validatable.text = message.text;
validatable.group = message.group;
validatable.status = message.status;
validatable.type = message.type;
}

@@ -70,3 +70,3 @@ else {

validatable.group = undefined;
validatable.status = undefined;
validatable.type = undefined;
}

@@ -73,0 +73,0 @@ },

@@ -10,4 +10,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import { isDryvProxy, isDryvValidatable } from '../core';
import { getMemberByPath } from '../core/getMemberByPath';
import { isDryvProxy, isDryvValidatable } from '.';
import { getMemberByPath } from './getMemberByPath';
export function dryvValidationSession(options, ruleSet) {

@@ -51,5 +51,5 @@ if (!options.callServer) {

const fieldResults = results.filter((r) => r).flatMap((r) => r.results);
const warnings = fieldResults.filter((r) => r.status === 'warning');
const hasErrors = fieldResults.some((r) => r.status === 'error');
obj.status = hasErrors ? 'error' : warnings.length > 0 ? 'warning' : 'success';
const warnings = fieldResults.filter((r) => r.type === 'warning');
const hasErrors = fieldResults.some((r) => r.type === 'error');
obj.type = hasErrors ? 'error' : warnings.length > 0 ? 'warning' : 'success';
return {

@@ -103,18 +103,18 @@ results: fieldResults,

if (result) {
field.status = result.status;
field.type = result.type;
field.text = result.text;
field.group = result.group;
const status = (_a = result.status) === null || _a === void 0 ? void 0 : _a.toLowerCase();
return status === 'success'
const type = (_a = result.type) === null || _a === void 0 ? void 0 : _a.toLowerCase();
return type === 'success'
? success()
: {
results: [result],
hasErrors: status === 'error',
hasWarnings: status === 'warning',
warningHash: status === 'warning' ? result.text : null,
success: status === 'success' || !status
hasErrors: type === 'error',
hasWarnings: type === 'warning',
warningHash: type === 'warning' ? result.text : null,
success: type === 'success' || !type
};
}
else {
field.status = 'success';
field.type = 'success';
field.text = null;

@@ -188,3 +188,3 @@ field.group = null;

path: validatable.path,
status: 'error',
type: 'error',
text: r,

@@ -195,3 +195,3 @@ group: null

}
else if (r.status !== 'success') {
else if (r.type !== 'success') {
result = r;

@@ -207,3 +207,3 @@ break;

path: validatable.path,
status: 'error',
type: 'error',
text: 'Validation failed.',

@@ -214,3 +214,3 @@ group: null

}
return result && result.status !== 'success' ? result : null;
return result && result.type !== 'success' ? result : null;
});

@@ -217,0 +217,0 @@ }

export * from './dryvProxy';
export * from './dryvValidationSession';
export * from './isDryvValidatableValue';
export * from './isDryvValidatable';
export * from './isDryvProxy';

@@ -5,0 +5,0 @@ export * from './dryvOptions';

export * from './dryvProxy';
export * from './dryvValidationSession';
export * from './isDryvValidatableValue';
export * from './isDryvValidatable';
export * from './isDryvProxy';

@@ -5,0 +5,0 @@ export * from './dryvOptions';

@@ -32,7 +32,7 @@ export type DryvValidateFunctionResult = DryvFieldValidationResult | string | null | undefined | Promise<DryvFieldValidationResult | string | null | undefined>;

path?: string;
status?: DryvValidationResultStatus;
type?: DryvValidationResultType;
text?: string | null;
group?: string | null;
}
export type DryvValidationResultStatus = 'error' | 'warning' | 'success' | string;
export type DryvValidationResultType = 'error' | 'warning' | 'success' | string;
export type DryvProxy<TModel extends object> = TModel & {

@@ -44,3 +44,3 @@ $dryv: DryvValidatable<TModel, DryvObject<TModel>>;

results: {
status: DryvValidationResultStatus;
type: DryvValidationResultType;
texts: string[];

@@ -56,3 +56,3 @@ }[];

groupShown?: boolean | null;
status?: DryvValidationResultStatus | null;
type?: DryvValidationResultType | null;
value: TValue | undefined;

@@ -71,3 +71,3 @@ parent: DryvValidatable | undefined;

text?: string | null;
status?: DryvValidationResultStatus | null;
type?: DryvValidationResultType | null;
}

@@ -74,0 +74,0 @@ export type DryvObject<TModel extends object> = {

{
"name": "dryvjs",
"version": "1.0.0-pre-1",
"version": "1.0.0-pre-10",
"main": "dist/index.js",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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