@travetto/schema
Advanced tools
Comparing version 3.3.3 to 3.3.4
{ | ||
"name": "@travetto/schema", | ||
"version": "3.3.3", | ||
"version": "3.3.4", | ||
"description": "Data type registry for runtime validation, reflection and binding.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -87,2 +87,3 @@ <!-- This file was generated by @travetto/doc and should not be modified directly --> | ||
* [@Specifier](https://github.com/travetto/travetto/tree/main/module/schema/src/decorator/field.ts#L206) attributes additional specifiers to a field, allowing for more specification beyond just the field's type. | ||
* [@SubTypeField](https://github.com/travetto/travetto/tree/main/module/schema/src/decorator/field.ts#L212) allows for promoting a given field as the owner of the sub type discriminator (defaults to `type`). | ||
Additionally, schemas can be nested to form more complex data structures that are able to bound and validated. | ||
@@ -89,0 +90,0 @@ |
@@ -206,2 +206,12 @@ import { ClassInstance } from '@travetto/base'; | ||
*/ | ||
export function Specifier(...specifiers: string[]): PropType<unknown> { return prop({ specifiers }); } | ||
export function Specifier(...specifiers: string[]): PropType<unknown> { return prop({ specifiers }); } | ||
/** | ||
* Sets the subtype field via a property decorator | ||
* @augments `@travetto/schema:Field` | ||
*/ | ||
export function SubTypeField(): ((t: ClassInstance, k: string) => void) { | ||
return (t: ClassInstance, k: string): void => { | ||
SchemaRegistry.register(t.constructor, { subTypeField: k }); | ||
}; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91831
2049
376