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

@kubb/react

Package Overview
Dependencies
Maintainers
0
Versions
402
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/react - npm Package Compare versions

Comparing version 3.0.0-alpha.28 to 3.0.0-alpha.29

1

dist/index.d.ts

@@ -43,2 +43,3 @@ import * as KubbFile from '@kubb/fs/types';

get params(): Params;
get flatParams(): Params;
toCall({ transformName, transformType }?: Pick<Options, 'transformName' | 'transformType'>): string;

@@ -45,0 +46,0 @@ toConstructor({ valueAsType }?: {

@@ -12,3 +12,3 @@ import process from 'node:process';

import autoBind from 'auto-bind';
import transformers, { createJSDocBlockText, camelCase } from '@kubb/core/transformers';
import transformers, { createJSDocBlockText } from '@kubb/core/transformers';
import { orderBy } from 'natural-orderby';

@@ -876,3 +876,3 @@

}
const parsedItem = parseItem(camelCase(key), item, options);
const parsedItem = parseItem(key, item, options);
return [...acc, ...parsedItem];

@@ -895,2 +895,14 @@ }, []).join(", ");

}
get flatParams() {
const flatter = (acc, [key, item]) => {
if (item?.children) {
return Object.entries(item.children).reduce(flatter, acc);
}
if (item) {
acc[key] = item;
}
return acc;
};
return Object.entries(this.#params).reduce(flatter, {});
}
toCall({ transformName, transformType } = {}) {

@@ -897,0 +909,0 @@ return getFunctionParams(this.#params, { type: "call", transformName, transformType });

12

package.json
{
"name": "@kubb/react",
"version": "3.0.0-alpha.28",
"version": "3.0.0-alpha.29",
"description": "Generator react",

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

"ws": "8.15.0",
"@kubb/core": "3.0.0-alpha.28",
"@kubb/fs": "3.0.0-alpha.28",
"@kubb/parser-ts": "3.0.0-alpha.28"
"@kubb/core": "3.0.0-alpha.29",
"@kubb/fs": "3.0.0-alpha.29",
"@kubb/parser-ts": "3.0.0-alpha.29"
},

@@ -92,4 +92,4 @@ "devDependencies": {

"typescript": "^5.6.2",
"@kubb/config-ts": "3.0.0-alpha.28",
"@kubb/config-tsup": "3.0.0-alpha.28"
"@kubb/config-ts": "3.0.0-alpha.29",
"@kubb/config-tsup": "3.0.0-alpha.29"
},

@@ -96,0 +96,0 @@ "engines": {

@@ -1,2 +0,1 @@

import { camelCase } from '@kubb/core/transformers'
import { orderBy } from 'natural-orderby'

@@ -149,3 +148,3 @@

const parsedItem = parseItem(camelCase(key), item, options)
const parsedItem = parseItem(key, item, options)

@@ -160,3 +159,3 @@ return [...acc, ...parsedItem]

}
//TODO use of string as `$name: $type` to create templates for functions instead of call/constructor
export class FunctionParams {

@@ -172,6 +171,20 @@ #params: Params

get params() {
get params(): Params {
return this.#params
}
get flatParams(): Params {
const flatter = (acc: Params, [key, item]: [key: string, item?: Param]): Params => {
if (item?.children) {
return Object.entries(item.children).reduce(flatter, acc)
}
if (item) {
acc[key] = item
}
return acc
}
return Object.entries(this.#params).reduce(flatter, {} as Params)
}
toCall({ transformName, transformType }: Pick<Options, 'transformName' | 'transformType'> = {}): string {

@@ -178,0 +191,0 @@ return getFunctionParams(this.#params, { type: 'call', transformName, transformType })

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