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

@travetto/schema

Package Overview
Dependencies
Maintainers
1
Versions
323
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/schema - npm Package Compare versions

Comparing version 0.0.29 to 0.0.30

2

package.json

@@ -28,3 +28,3 @@ {

},
"version": "0.0.29"
"version": "0.0.30"
}

@@ -1,20 +0,9 @@

import { Field } from './field';
import { Class } from '@travetto/registry';
import { SchemaRegistry, ValidatorFn } from '../service';
import { Class } from '@travetto/registry';
import { BindUtil } from '../util';
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]
};
export interface ClassWithSchema<T> {
new(...args: any[]): T;
from<U>(this: Class<U>, data: DeepPartial<U & { [key: string]: any }>, view?: string): U;
}
export function Schema(auto: boolean = true): ClassDecorator {
return <T>(target: Class<T>): ClassWithSchema<T> => {
const res: ClassWithSchema<T> = target as any;
return <T>(target: Class<T>): Class<T> => {
const res: Class<T> = target as any;
SchemaRegistry.getOrCreatePending(target);
if (!res.from) {

@@ -26,3 +15,2 @@ res.from = function (data: any, view: any) {

}
return res;

@@ -29,0 +17,0 @@ };

@@ -13,2 +13,2 @@ type DeepPartial<T> = {

): U;
}
}
import {
Field, Url, View, Required, Alias,
BindUtil, Schema, SchemaRegistry, ClassWithSchema, Float, Integer
BindUtil, Schema, SchemaRegistry, Float, Integer
} from '../src';

@@ -5,0 +5,0 @@ import { Address } from './address';

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