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

typedconverter

Package Overview
Dependencies
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedconverter - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

4

lib/validation.js

@@ -48,3 +48,3 @@ "use strict";

if (isEmpty(result) && !isOptional(i) && !isPartial(i))
return visitor_1.Result.error(i.path, `Required`);
return visitor_1.Result.error(i.value, i.path, `Required`);
else

@@ -74,5 +74,5 @@ return result;

}
return messages.length > 0 ? visitor_1.Result.error(i.path, messages) : result;
return messages.length > 0 ? visitor_1.Result.error(i.value, i.path, messages) : result;
}
}
exports.validatorVisitor = validatorVisitor;

@@ -26,5 +26,5 @@ import { VisitorExtension } from "./invocation";

function create(value: any): Result;
function error(path: string, message: string | string[]): Result;
function error(value: any, path: string, message: string | string[]): Result;
}
declare function pipeline(value: any, ast: SuperNode, opt: VisitorOption): Result;
export { pipeline, ResultMessages, Result, ParentInfo };

@@ -13,4 +13,4 @@ "use strict";

Result.create = create;
function error(path, message) {
return { value: undefined, issues: [{ path, messages: Array.isArray(message) ? message : [message] }] };
function error(value, path, message) {
return { value, issues: [{ path, messages: Array.isArray(message) ? message : [message] }] };
}

@@ -40,3 +40,3 @@ Result.error = error;

if (result === undefined)
return Result.error(opt.path, unableToConvert(value, ast.type.name));
return Result.error(value, opt.path, unableToConvert(value, ast.type.name));
else

@@ -48,3 +48,3 @@ return Result.create(result);

if (!Array.isArray(newValues))
return Result.error(opt.path, unableToConvert(value, `Array<${ast.type.name}>`));
return Result.error(value, opt.path, unableToConvert(value, `Array<${ast.type.name}>`));
const result = [];

@@ -68,3 +68,3 @@ const errors = [];

if (typeof value === "number" || typeof value === "string" || typeof value === "boolean")
return Result.error(opt.path, unableToConvert(value, ast.type.name));
return Result.error(value, opt.path, unableToConvert(value, ast.type.name));
const instance = Object.create(ast.type.prototype);

@@ -71,0 +71,0 @@ const meta = tinspector_1.default(ast.type);

{
"name": "typedconverter",
"version": "1.0.3",
"version": "1.0.4",
"description": "Convert object into classes match with TypeScript type annotation",

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

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