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.0-beta.0 to 1.0.0-beta.1

4

lib/index.d.ts

@@ -23,2 +23,3 @@ declare type Class = new (...args: any[]) => any;

type: T;
name: string;
parent?: {

@@ -59,3 +60,4 @@ type: Class;

decorators: any[];
constructor({ type, parent, path, converters, visitors, decorators, ...opts }: ObjectInfo<Function | Function[] | undefined>);
name: string;
constructor({ type, parent, path, name, converters, visitors, decorators, ...opts }: ObjectInfo<Function | Function[] | undefined>);
abstract proceed(): Promise<ConversionResult>;

@@ -62,0 +64,0 @@ }

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

constructor(_a) {
var { type, parent, path, converters, visitors, decorators } = _a, opts = tslib_1.__rest(_a, ["type", "parent", "path", "converters", "visitors", "decorators"]);
var { type, parent, path, name, converters, visitors, decorators } = _a, opts = tslib_1.__rest(_a, ["type", "parent", "path", "name", "converters", "visitors", "decorators"]);
this.type = type;

@@ -50,2 +50,3 @@ this.parent = parent;

this.decorators = decorators;
this.name = name;
Object.assign(this, opts);

@@ -180,3 +181,3 @@ }

for (let x of reflection.properties) {
const propResult = await convert(value[x.name], Object.assign({ path: path.concat(x.name), type: x.type }, restInfo, { decorators: x.decorators.concat(restInfo.decorators) }));
const propResult = await convert(value[x.name], Object.assign({ path: path.concat(x.name), type: x.type }, restInfo, { name: x.name, decorators: x.decorators.concat(restInfo.decorators) }));
if (propResult.messages.length > 0)

@@ -195,3 +196,3 @@ result.messages = mergeIssue(result.messages, propResult.messages);

var { type, path } = _a, restInfo = tslib_1.__rest(_a, ["type", "path"]);
const result = await Promise.all(value.map((x, i) => convert(x, Object.assign({ path: path.concat(i.toString()), type: type[0] }, restInfo))));
const result = await Promise.all(value.map((x, i) => convert(x, Object.assign({ path: path.concat(i.toString()), type: type[0] }, restInfo, { name: i.toString() }))));
const returnedResult = new ConversionResult(result.map(x => x.value));

@@ -254,3 +255,3 @@ for (const item of result) {

const { type = factoryOption.type, path = [], decorators = [], errorStatus = 400 } = opt, restOpt = tslib_1.__rest(opt, ["type", "path", "decorators", "errorStatus"]);
const result = await convert(value, Object.assign({ visitors: factoryOption.visitors || [], converters: mergedConverters, path, type, decorators }, restOpt));
const result = await convert(value, Object.assign({ visitors: factoryOption.visitors || [], converters: mergedConverters, name: path[0] || "", path, type, decorators }, restOpt));
if (result.messages.length > 0)

@@ -257,0 +258,0 @@ throw new ConversionError(result.messages, errorStatus);

{
"name": "typedconverter",
"version": "1.0.0-beta.0",
"version": "1.0.0-beta.1",
"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