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

class-validator-jsonschema

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

class-validator-jsonschema - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

__tests__/additionalProperties.ts

11

build/index.js

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

const convert = (meta) => {
var _a;
const typeMeta = (_a = options.classTransformerMetadataStorage) === null || _a === void 0 ? void 0 : _a.findTypeMetadata(meta.target, meta.propertyName);
const isMap = typeMeta && new typeMeta.reflectedType() instanceof Map;
const converter = converters[meta.type] || converters[cv.ValidationTypes.CUSTOM_VALIDATION];
const items = _.isFunction(converter) ? converter(meta, options) : converter;
if (meta.each && isMap) {
return {
additionalProperties: Object.assign({}, items),
type: 'object',
};
}
return meta.each ? { items, type: 'array' } : items;

@@ -95,2 +104,2 @@ };

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxzQ0FBcUM7QUFHckMsNEJBQTJCO0FBRzNCLDZDQUFnRDtBQUNoRCwyREFBdUQ7QUFDdkQsdUNBQW9EO0FBRXBELDJDQUF5QztBQUFoQyxrQ0FBQSxVQUFVLENBQUE7QUFLbkIsU0FBZ0IsNEJBQTRCLENBQUMsV0FBK0I7SUFDMUUsTUFBTSxPQUFPLG1DQUNSLHdCQUFjLEdBQ2QsV0FBVyxDQUNmLENBQUE7SUFFRCxNQUFNLFNBQVMsR0FBRyx1QkFBdUIsQ0FDdkMsT0FBTyxDQUFDLDZCQUE2QixDQUN0QyxDQUFBO0lBRUQsTUFBTSxPQUFPLEdBQW9DLENBQUMsQ0FBQyxTQUFTLENBQUM7U0FDMUQsT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UFBZSxDQUFDLHNCQUFzQixFQUFFLEVBQUUsQ0FBQyxRQUFRLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FDM0UsQ0FBQTtJQUNILENBQUM7SUFFRCxPQUFPLENBQUMsQ0FBQyxTQUFTLENBQUM7U0FDaEIsT0FBTyxDQUFDLGNBQWMsQ0FBQztTQUN2QixNQUFNLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRTtRQUNoQixNQUFNLENBQUMsR0FBRyxFQUFFLFNBQVMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxTQUFTLENBQUMsS0FBSyxFQUFFLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxLQUFLLE1BQU0sQ0FBQyxDQUFBO1FBQ3ZFLE9BQU8sT0FBTyxDQUFDLHFCQUFxQjtZQUNsQyxDQUFDLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLElBQUksU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFDO1lBQzlELENBQUMsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxJQUFJLFVBQVUsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFBO0lBQ2pELENBQUMsQ0FBQztTQUNELElBQUksRUFBRTtTQUNOLEtBQUssRUFBRSxDQUFBO0FBQ1osQ0FBQyJ9

@@ -9,2 +9,6 @@ # Changelog

## [2.0.2] - 2020-06-03
### Fixed
- Handling for Map fields [#35](https://github.com/epiphone/class-validator-jsonschema/pull/35)
## [2.0.1] - 2020-05-06

@@ -11,0 +15,0 @@ ### Fixed

2

package.json
{
"name": "class-validator-jsonschema",
"version": "2.0.1",
"version": "2.0.2",
"description": "Convert class-validator-decorated classes into JSON schema",

@@ -5,0 +5,0 @@ "keywords": [

@@ -117,3 +117,10 @@ // tslint:disable:no-submodule-imports ban-types

const converters = { ...defaultConverters, ...options.additionalConverters }
const convert = (meta: ValidationMetadata) => {
const typeMeta = options.classTransformerMetadataStorage?.findTypeMetadata(
meta.target as Function,
meta.propertyName
)
const isMap = typeMeta && new typeMeta.reflectedType() instanceof Map
const converter =

@@ -123,2 +130,11 @@ converters[meta.type] || converters[cv.ValidationTypes.CUSTOM_VALIDATION]

const items = _.isFunction(converter) ? converter(meta, options) : converter
if (meta.each && isMap) {
return {
additionalProperties: {
...items,
},
type: 'object',
}
}
return meta.each ? { items, type: 'array' } : items

@@ -125,0 +141,0 @@ }

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