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

openapi-typescript-helpers

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-typescript-helpers - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

31

index.d.ts

@@ -100,7 +100,13 @@ // HTTP types

/** Return `requestBody` for an Operation Object */
export type OperationRequestBody<T> = T extends { requestBody?: any } ? T["requestBody"] : never;
/** Return type of `requestBody` for an Operation Object */
export type OperationRequestBody<T> = "requestBody" extends keyof T ? T["requestBody"] : never;
/** Internal helper to get object type with only the `requestBody` property */
type PickRequestBody<T> = "requestBody" extends keyof T ? Pick<T, "requestBody"> : never;
/** Resolve to `true` if request body is optional, else `false` */
export type IsOperationRequestBodyOptional<T> = RequiredKeysOf<PickRequestBody<T>> extends never ? true : false;
/** Internal helper used in OperationRequestBodyContent */
export type OperationRequestBodyMediaContent<T> = undefined extends OperationRequestBody<T>
export type OperationRequestBodyMediaContent<T> = IsOperationRequestBodyOptional<T> extends true
? ResponseContent<NonNullable<OperationRequestBody<T>>> | undefined

@@ -156,5 +162,20 @@ : ResponseContent<OperationRequestBody<T>>;

export type JSONLike<T> = FilterKeys<T, `${string}/json`>;
/** Filter objects that have required keys */
/**
* Filter objects that have required keys
* @deprecated Use `RequiredKeysOf` instead
*/
export type FindRequiredKeys<T, K extends keyof T> = K extends unknown ? (undefined extends T[K] ? never : K) : K;
/** Does this object contain required keys? */
/**
* Does this object contain required keys?
* @deprecated Use `RequiredKeysOf` instead
*/
export type HasRequiredKeys<T> = FindRequiredKeys<T, keyof T>;
/** Helper to get the required keys of an object. If no keys are required, will be `undefined` with strictNullChecks enabled, else `never` */
type RequiredKeysOfHelper<T> = {
// biome-ignore lint/complexity/noBannedTypes: `{}` is necessary here
[K in keyof T]: {} extends Pick<T, K> ? never : K;
}[keyof T];
/** Get the required keys of an object, or `never` if no keys are required */
export type RequiredKeysOf<T> = RequiredKeysOfHelper<T> extends undefined ? never : RequiredKeysOfHelper<T>;

2

package.json
{
"name": "openapi-typescript-helpers",
"description": "TypeScript helpers for consuming openapi-typescript types",
"version": "0.0.11",
"version": "0.0.12",
"author": {

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

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