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

@berish/validate

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@berish/validate - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

build/rule/createRule.d.ts

@@ -8,4 +8,4 @@ import { IValidateRule, IRuleObject, IRuleObjectBody, IRuleObjectFlag, IRuleErrorTextResult } from './types';

conditionAsync?: (obj: IRuleObject & IRuleObjectBody<Body>) => boolean | IRuleFlag | Promise<boolean | IRuleFlag>;
errorText?: (obj: IRuleObject & IRuleObjectBody<Body> & IRuleObjectFlag) => IRuleErrorTextResult | typeof SYMBOL_ERROR_TEXT_DEFAULT;
errorText?: (obj: IRuleObject & IRuleObjectBody<Body> & IRuleObjectFlag) => IRuleErrorTextResult | typeof SYMBOL_ERROR_TEXT_DEFAULT | void;
}
export declare function createRule<Body extends any[]>(params: ICreateRuleParams<Body>): IValidateRule<Body>;

@@ -91,5 +91,3 @@ "use strict";

return defaultErrorText;
const result = params.errorText(Object.assign(Object.assign({}, obj), { body }));
if (!result)
return defaultErrorText;
const result = params.errorText(Object.assign(Object.assign({}, obj), { body })) || exports.SYMBOL_ERROR_TEXT_DEFAULT;
if (result === exports.SYMBOL_ERROR_TEXT_DEFAULT)

@@ -96,0 +94,0 @@ return defaultErrorText;

import { IRuleObject, IRuleObjectBody, IRuleErrorTextResult, IValidateRule } from './types';
export interface ICreateSimpleRuleParams<Body extends any[]> {
name?: string;
conditionSync?: (obj: IRuleObject & IRuleObjectBody<Body>) => boolean | IRuleErrorTextResult;
conditionAsync?: (obj: IRuleObject & IRuleObjectBody<Body>) => boolean | IRuleErrorTextResult | Promise<boolean | IRuleErrorTextResult>;
conditionSync?: (obj: IRuleObject & IRuleObjectBody<Body>) => boolean | IRuleErrorTextResult | void;
conditionAsync?: (obj: IRuleObject & IRuleObjectBody<Body>) => boolean | IRuleErrorTextResult | void | Promise<boolean | IRuleErrorTextResult | void>;
}
export declare function createSimpleRule<Body extends any[]>(params: ICreateSimpleRuleParams<Body>): IValidateRule<Body>;
{
"name": "@berish/validate",
"version": "0.0.9",
"version": "0.0.10",
"description": "Validation of complex objects with support for validation maps, rules and decorators",

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

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