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

@byll/validated

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byll/validated - npm Package Compare versions

Comparing version 1.10.0 to 1.11.0

5

lib/src/index.d.ts

@@ -9,2 +9,7 @@ export declare const factories: any;

export declare function validate(value: any, validators: Validator[]): string[];
/**
* @param prototype: validator class
* @returns list of all possible keys on the validator
*/
export declare function getKeys(prototype: any): string[];
export declare abstract class Validated {

@@ -11,0 +16,0 @@ constructor(raw: any, options?: {

@@ -260,2 +260,20 @@ "use strict";

exports.validate = validate;
/**
* @param prototype: validator class
* @returns list of all possible keys on the validator
*/
function getKeys(prototype) {
var result = new Set();
while ((prototype = Object.getPrototypeOf(prototype)) && prototype !== Validated.prototype) {
if (!keys.has(prototype.constructor)) {
continue;
}
var subset = keys.get(prototype.constructor);
subset.forEach(function (_validators, key) {
result.add(key);
});
}
return Array.from(result);
}
exports.getKeys = getKeys;
var Validated = (function () {

@@ -262,0 +280,0 @@ function Validated(raw, options) {

2

package.json
{
"name": "@byll/validated",
"version": "1.10.0",
"version": "1.11.0",
"main": "lib/src/index.js",

@@ -5,0 +5,0 @@ "typings": "lib/src/index",

@@ -227,2 +227,18 @@ import { isValidDecimalString } from './helpers/isValidDecimalString'

/**
* @param prototype: validator class
* @returns list of all possible keys on the validator
*/
export function getKeys (prototype): string[] {
const result = new Set<string>()
while ((prototype = Object.getPrototypeOf(prototype)) && prototype !== Validated.prototype) {
if (!keys.has(prototype.constructor)) { continue }
const subset = keys.get(prototype.constructor)!
subset.forEach((_validators, key) => {
result.add(key)
})
}
return Array.from(result)
}
export abstract class Validated {

@@ -229,0 +245,0 @@ constructor(raw, options?: { Error?: new(details) => any, parse?: 'json', allowAdditionalKeys?: boolean }) {

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