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

@composer-js/core

Package Overview
Dependencies
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@composer-js/core - npm Package Compare versions

Comparing version 6.0.0-rc.17 to 6.0.0-rc.19

8

dist/lib/ObjectUtils.js

@@ -19,7 +19,9 @@ "use strict";

* @param obj The object or array of objects to validate.
* @param clazz The class type that contains the validation metadata.
* @param recurse Set to `true` to validate all child objects.
*/
static validate(obj, recurse) {
static validate(obj, clazz, recurse) {
const objs = Array.isArray(obj) ? obj : [obj];
for (const obj of objs) {
const metadataObj = !clazz || obj instanceof clazz ? obj : new clazz();
// Iterate through all properties of the object

@@ -29,3 +31,3 @@ for (const member of Object.getOwnPropertyNames(obj)) {

continue;
const nullable = Reflect.getMetadata("cjs:nullable", obj, member);
const nullable = Reflect.getMetadata("cjs:nullable", metadataObj, member);
// Value of '0' is valid. Don't throw on such values.

@@ -35,3 +37,3 @@ if (!nullable && (obj[member] === null || obj[member] === undefined || obj[member] === "")) {

}
const validator = Reflect.getMetadata("cjs:validator", obj, member);
const validator = Reflect.getMetadata("cjs:validator", metadataObj, member);
if (validator && obj[member] && !validator(obj[member])) {

@@ -38,0 +40,0 @@ throw new Error(`Property ${member} is invalid.`);

@@ -13,5 +13,6 @@ import "reflect-metadata";

* @param obj The object or array of objects to validate.
* @param clazz The class type that contains the validation metadata.
* @param recurse Set to `true` to validate all child objects.
*/
static validate(obj: any, recurse?: boolean): void;
static validate(obj: any, clazz?: any, recurse?: boolean): void;
}
{
"name": "@composer-js/core",
"version": "6.0.0-rc.17",
"version": "6.0.0-rc.19",
"description": "A collection of common utilities and core functionality for composerjs applications.",

@@ -5,0 +5,0 @@ "repository": "https://gitlab.acceleratxr.com/composerjs/composer-core.git",

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