New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openapi-typescript

Package Overview
Dependencies
Maintainers
1
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-typescript - npm Package Compare versions

Comparing version 6.5.2 to 6.5.3

6

CHANGELOG.md
# openapi-typescript
## 6.5.3
### Patch Changes
- [#1320](https://github.com/drwpow/openapi-typescript/pull/1320) [`3cf78b9`](https://github.com/drwpow/openapi-typescript/commit/3cf78b920ab23624c0524e0d58338ee66acad799) Thanks [@duncanbeevers](https://github.com/duncanbeevers)! - Wrap nested readonly types in parentheses, allowing for nested immutable arrays
## 6.5.2

@@ -4,0 +10,0 @@

3

dist/utils.js

@@ -17,2 +17,3 @@ import c from "ansi-colors";

const TS_UNION_INTERSECTION_RE = /[&|]/;
const TS_READONLY_RE = /^readonly\s+/;
const JS_OBJ_KEY = /^(\d+|[A-Za-z_$][A-Za-z0-9_$]*)$/;

@@ -128,3 +129,3 @@ export function walk(obj, cb, path = []) {

function parenthesise(type) {
return TS_UNION_INTERSECTION_RE.test(type) ? `(${type})` : type;
return TS_UNION_INTERSECTION_RE.test(type) || TS_READONLY_RE.test(type) ? `(${type})` : type;
}

@@ -131,0 +132,0 @@ export function tsArrayOf(type) {

{
"name": "openapi-typescript",
"description": "Generate runtime-free TypeScript types from Swagger OpenAPI specs",
"version": "6.5.2",
"version": "6.5.3",
"author": {

@@ -6,0 +6,0 @@ "name": "Drew Powers",

@@ -35,2 +35,3 @@ import c from "ansi-colors";

const TS_UNION_INTERSECTION_RE = /[&|]/;
const TS_READONLY_RE = /^readonly\s+/;
const JS_OBJ_KEY = /^(\d+|[A-Za-z_$][A-Za-z0-9_$]*)$/;

@@ -172,5 +173,5 @@

/** if the type has & or | we should parenthesise it for safety */
/** add parenthesis around union, intersection (| and &) and readonly types */
function parenthesise(type: string) {
return TS_UNION_INTERSECTION_RE.test(type) ? `(${type})` : type;
return TS_UNION_INTERSECTION_RE.test(type) || TS_READONLY_RE.test(type) ? `(${type})` : type;
}

@@ -177,0 +178,0 @@

Sorry, the diff of this file is not supported yet

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