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

@kmudrick/io-ts-openapi

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kmudrick/io-ts-openapi - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

9

dist/type-codegen.js

@@ -35,3 +35,7 @@ "use strict";

else {
return t.typeCombinator(Object.keys(properties).map((key) => t.property(key, toTypeReference(properties[key]), schema.required?.includes(key) ?? false)));
return t.typeCombinator(Object.keys(properties).map((key) => {
const isOptional = !(schema.required?.includes(key) ?? false);
const type = toTypeReference(properties[key]);
return t.property(key, type, isOptional);
}));
}

@@ -73,2 +77,3 @@ }

const isExported = true;
const isReadonly = true;
function toDeclarations(references) {

@@ -83,3 +88,3 @@ const start = [];

}
const declaration = t.typeDeclaration(name, typeReference, isExported);
const declaration = t.typeDeclaration(name, typeReference, isExported, isReadonly);
return [...acc, declaration];

@@ -86,0 +91,0 @@ }, start);

{
"name": "@kmudrick/io-ts-openapi",
"version": "0.0.15",
"version": "0.0.16",
"license": "MIT",

@@ -49,2 +49,3 @@ "repository": {

"@apidevtools/json-schema-ref-parser": "^9.0.9",
"assert": "^2.0.0",
"fp-ts": "^2.11.10",

@@ -51,0 +52,0 @@ "io-ts": "^2.2.16",

@@ -20,9 +20,7 @@ import * as t from "io-ts-codegen";

return t.typeCombinator(
Object.keys(properties).map((key) =>
t.property(
key,
toTypeReference(properties[key]),
schema.required?.includes(key) ?? false
)
)
Object.keys(properties).map((key) => {
const isOptional = !(schema.required?.includes(key) ?? false);
const type = toTypeReference(properties[key]);
return t.property(key, type, isOptional);
})
);

@@ -69,2 +67,3 @@ }

const isExported = true;
const isReadonly = true;

@@ -89,3 +88,8 @@ export function toDeclarations(

}
const declaration = t.typeDeclaration(name, typeReference, isExported);
const declaration = t.typeDeclaration(
name,
typeReference,
isExported,
isReadonly
);
return [...acc, declaration];

@@ -92,0 +96,0 @@ },

Sorry, the diff of this file is not supported yet

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