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

@kubb/parser-ts

Package Overview
Dependencies
Maintainers
0
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kubb/parser-ts - npm Package Compare versions

Comparing version 0.0.0-canary-20241213202051 to 0.0.0-canary-20241213215524

4

dist/index.d.ts

@@ -15,6 +15,6 @@ import ts, { PrinterOptions } from 'typescript';

/**
* Format the generated code based on the TypeScript printer.
* Format the generated code based on Prettier
*/
declare function format(source: string, options?: Omit<PrintOptions, 'source'>): string;
declare function format(source: string): Promise<string>;
export { format, print };
export { factory_exports as factory } from './chunk-RWXGFVS2.js';
import ts from 'typescript';
import { format as format$1 } from 'prettier';
import pluginTypescript from 'prettier/plugins/typescript';

@@ -28,6 +30,17 @@ var { factory } = ts;

}
// src/format.ts
function format(source, options = {}) {
return print([], { source, noEmitHelpers: false, ...options });
var formatOptions = {
tabWidth: 2,
printWidth: 160,
parser: "typescript",
singleQuote: true,
semi: false,
bracketSameLine: false,
endOfLine: "auto",
plugins: [pluginTypescript]
};
async function format(source) {
if (!source) {
return "";
}
return format$1(source, formatOptions);
}

@@ -34,0 +47,0 @@

{
"name": "@kubb/parser-ts",
"version": "0.0.0-canary-20241213202051",
"version": "0.0.0-canary-20241213215524",
"description": "TypeScript parser",

@@ -52,2 +52,3 @@ "keywords": [

"remeda": "^2.17.4",
"prettier": "^3.4.2",
"typescript": "^5.7.2"

@@ -57,4 +58,4 @@ },

"tsup": "^8.3.5",
"@kubb/config-ts": "0.0.0-canary-20241213202051",
"@kubb/config-tsup": "0.0.0-canary-20241213202051"
"@kubb/config-ts": "0.0.0-canary-20241213215524",
"@kubb/config-tsup": "0.0.0-canary-20241213215524"
},

@@ -61,0 +62,0 @@ "engines": {

@@ -1,9 +0,27 @@

import { type PrintOptions, print } from './print.ts'
import { format as prettierFormat } from 'prettier'
import pluginTypescript from 'prettier/plugins/typescript'
import type { Options } from 'prettier'
const formatOptions: Options = {
tabWidth: 2,
printWidth: 160,
parser: 'typescript',
singleQuote: true,
semi: false,
bracketSameLine: false,
endOfLine: 'auto',
plugins: [pluginTypescript],
}
/**
* Format the generated code based on the TypeScript printer.
* Format the generated code based on Prettier
*/
export function format(source: string, options: Omit<PrintOptions, 'source'> = {}) {
export async function format(source: string) {
// do some basic linting with the ts compiler
return print([], { source, noEmitHelpers: false, ...options })
if (!source) {
return ''
}
return prettierFormat(source, formatOptions)
}

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

import ts, { LanguageVariant } from 'typescript'
import ts from 'typescript'

@@ -3,0 +3,0 @@ import type { PrinterOptions } from 'typescript'

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