bravo-formatter
Advanced tools
Comparing version 0.0.2 to 0.0.3
import { ParamItems } from './formatter/Params.js'; | ||
import { ParamTypes } from './lexer/TokenizerOptions.js'; | ||
import { ParamTypes, PrefixedQuoteType, VariableRegex } from './lexer/TokenizerOptions.js'; | ||
export declare type IndentStyle = 'standard' | 'tabularLeft' | 'tabularRight'; | ||
@@ -19,4 +19,9 @@ export declare type KeywordCase = 'preserve' | 'upper' | 'lower'; | ||
newlineBeforeSemicolon: boolean; | ||
/** | ||
* 特殊符号定义,如@{XXX} 将被识别为普通文本 | ||
* @example [{ quote: '{}', prefixes: ['$'], requirePrefix: true }] | ||
*/ | ||
variableTypes?: Array<PrefixedQuoteType | VariableRegex>; | ||
params?: ParamItems | string[]; | ||
paramTypes?: ParamTypes; | ||
} |
@@ -73,2 +73,5 @@ import { bigquery } from './languages/bigquery/bigquery.formatter.js'; | ||
const dialectOptions = typeof options.language === 'string' ? formatters[options.language] : options.language; | ||
// customize variabletypes | ||
dialectOptions.tokenizerOptions.variableTypes = options.variableTypes ? options.variableTypes : dialectOptions.tokenizerOptions.variableTypes; | ||
return new Formatter(createDialect(dialectOptions), options).format(query); | ||
@@ -75,0 +78,0 @@ }; |
{ | ||
"name": "bravo-formatter", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Format whitespace in a SQL query to make it more readable", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2267058
9166