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

@kubb/oas

Package Overview
Dependencies
Maintainers
1
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/oas - npm Package Compare versions

Comparing version 0.0.0-canary-20240423195307 to 0.0.0-canary-20240423212734

4

dist/parser.d.ts
import { O as Oas } from './Oas-BEe7KZDj.js';
import * as OasTypes from 'oas/types';
import { OASDocument } from 'oas/types';
import 'oas';
import 'oas/operation';
declare function parse(pathOrApi: string | OasTypes.OASDocument): Promise<Oas>;
declare function parse(pathOrApi: string | OASDocument): Promise<Oas>;
export { parse };

@@ -14,3 +14,8 @@ import {

});
const document = await oasNormalize.load();
let document;
try {
document = await oasNormalize.bundle();
} catch (e) {
document = await oasNormalize.load();
}
if (isOpenApiV2Document(document)) {

@@ -17,0 +22,0 @@ const { openapi: oas } = await swagger2openapi.convertObj(document, { anchors: true });

{
"name": "@kubb/oas",
"version": "0.0.0-canary-20240423195307",
"version": "0.0.0-canary-20240423212734",
"description": "Oas helpers",

@@ -51,2 +51,4 @@ "keywords": [

"dependencies": {
"hotscript": "^1.0.13",
"json-schema-to-ts": "^3.0.1",
"oas": "^24.2.2",

@@ -57,4 +59,2 @@ "oas-normalize": "^11.0.4",

"swagger2openapi": "^7.0.8",
"hotscript": "^1.0.13",
"json-schema-to-ts": "^3.0.1",
"ts-toolbelt": "^9.6.0"

@@ -61,0 +61,0 @@ },

import OASNormalize from 'oas-normalize'
import swagger2openapi from 'swagger2openapi'
import type { OpenAPIV2 } from 'openapi-types'
import { Oas } from '../Oas.ts'
import type { OasTypes } from '../types.ts'
import { isOpenApiV2Document } from '../utils.ts'
export async function parse(pathOrApi: string | OasTypes.OASDocument): Promise<Oas> {
import type { OASDocument } from 'oas/types'
import type { OpenAPI } from 'openapi-types'
export async function parse(pathOrApi: string | OASDocument): Promise<Oas> {
const oasNormalize = new OASNormalize(pathOrApi, {

@@ -14,4 +15,10 @@ enablePaths: true,

})
let document: OpenAPI.Document
const document = (await oasNormalize.load()) as unknown as OpenAPIV2.Document
try {
// resolve external refs
document = await oasNormalize.bundle()
} catch (e) {
document = (await oasNormalize.load()) as OpenAPI.Document
}

@@ -21,3 +28,3 @@ if (isOpenApiV2Document(document)) {

return new Oas({ oas: oas as OasTypes.OASDocument })
return new Oas({ oas: oas as OASDocument })
}

@@ -24,0 +31,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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