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.19 to 6.0.0-rc.20

dist/lib/ValidationUtils.js

1

dist/lib/index.js

@@ -33,2 +33,3 @@ "use strict";

__exportStar(require("./UserUtils"), exports);
__exportStar(require("./ValidationUtils"), exports);
//# sourceMappingURL=index.js.map

9

dist/lib/ObjectUtils.js

@@ -36,4 +36,9 @@ "use strict";

const validator = Reflect.getMetadata("cjs:validator", metadataObj, member);
if (validator && obj[member] && !validator(obj[member])) {
throw new Error(`Property ${member} is invalid.`);
if (validator && obj[member]) {
try {
obj[member] = validator(obj[member]);
}
catch (err) {
throw new Error(`Property ${member} is invalid. ${err.message}`);
}
}

@@ -40,0 +45,0 @@ // If recursion is requested validate the child object

@@ -43,2 +43,10 @@ import "reflect-metadata";

/**
* A function used to validate a property value.
*
* @param value The value to validate.
* @returns The validated value to assign to the property.
* @throws An exception if the value cannot be validated.
*/
export type ValidatorFunction = (value: any) => any;
/**
* Apply this to a property to specify the function that will be used to perform validation of the value.

@@ -48,2 +56,2 @@ *

*/
export declare function Validator(func: (value: any) => boolean): (target: any, propertyKey: string | symbol) => void;
export declare function Validator(func: ValidatorFunction): (target: any, propertyKey: string | symbol) => void;

@@ -17,1 +17,2 @@ export * from "./ApiError";

export * from "./UserUtils";
export * from "./ValidationUtils";
{
"name": "@composer-js/core",
"version": "6.0.0-rc.19",
"version": "6.0.0-rc.20",
"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

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